As benibela from the TeXstudio development group answered:
The cursor has to be placed directly at the border of the
parenthesis/environment. I.e. if |
marks the cursor, it has to be either there: |\begin{example}
or there: \begin{example}|
(where it is highlighted)
So, if you have the following code snippet
\begin{itemize}
\begin{enumerate}
inner content
\end{enumerate}
\end{itemize}
and place the cursor like this (notice the yellow highlighting):
you can use Ctrl+Shift+P, I (for Parenthesis/Inner) to get
or Ctrl+Shift+P, O (for Parenthesis/Outer) to get
Also available is:
- Ctrl+Shift+P, J to jump to the corresponding
begin
/{
or end
/}
,
- Ctrl+Shift+P, M to find a mismatching brace.
In TeXstudio, to create a new code snippet and associate it with a keyboard shortcut, you can create a Macro and then assign a Shortcut to it.
To do this:
1. Go to the "Macros
" menu and choose "Edit Macros
"
2. In the "Edit Macros
" dialog, click on the "Add
" button, in the lower left corner of the dialog
3. Give the "Macro" a Name, fill the "Abbreviation
" text field with $..$
and put your LaTeX code in the "`LaTeX Content" text area with your LaTeX code in this method leave the "Type" radio button with the default value of "Normal"), as illustrated below:
EDIT: As an alternative method, in this "Step 3", (Step of the "Edit Macros
" dialog) - and since the idea is to "create" a new environment (in this case, bmatrix) - you may choose the "Environment
" radio button, in the "Type
" option, instead of the default value of "Normal
". If you do that, make sure that %bmatrix
(yes, that percentage sign before bmatrix
is supposed to be there) is the content in the "LaTeX Content"
text area (and clear the content of the "Abbreviation" text field). The advantage of this alternative method, as I see it, is that the cursor will be "correctly" placed inside the environment when the Macro is activated. Here's a screenshot for this step with this alternative method:
4. Click in the "OK" button to close the dialog
5. Go to the "Options
" Menu and choose the "Configure TeXstudio...
" command (first command of the Options Menu)
6. In the "Configure TeXstudio...
" dialog, choose "Shortcuts" in the vertical navigation in the left side, and expand the "Menus" -> "Macros" option in the right hand side, to reveal your Macros, including your newly added "3: My Bmatrix Macro" like shown here:
7. Double click the "Current Shortcut
" column and press the "Ctrl+Shift+B" key combination. This will change the value of the column to "Ctrl+Shift+B
"
You'll probably get a warning dialog box saying that the Keyboard shortcut "Ctrl+Shift+B" is already assigned to the command "Unnamed Bookmark". Click on the "Yes
" button to accept the replacement of the Keyboard Shortcut.
8. Click on the "OK
" button on the "Configure TeXstudio...
" dialog to close it.
That's it! :-) Pressing Ctrl+Shift+B
in your documents will insert the code for the bmatrix
environment, from now on.
Best Answer
As you have noticed
So now we have numerous problems and you could simply delete the ini file, thus loosing ALL customisation including all the key changes. That would be the best advise to give when someone has ignored all the previous warnings. However:-
You know you can change each key back to its default, one by one like this.
Knowing they are stored in the TeXstudio.ini file like this
The simplest bulk solution WITHOUT TeXstudio active (otherwise it will save the unwanted customisation again), is to simply delete all those rogue entries keeping as few as is possible.