Jump to enclosing bracket in Visual Studio Code - visual-studio-code

In Emacs C/C++/Perl/Lisp etc mode I can do Meta+Ctrl+U to run backward-up-list which takes me to the open bracket containing the current cursor position. For example, if I'm in a parameter list it takes me to the opening parenthesis after the function name, and if I'm in a statement it takes me to the opening brace for the block. How do I do the same thing in Visual Studio Code (I'm running the Mac version).
I know about Cmd+Shift+\ running Go to Bracket but that takes you to the open/close bracket matching the close/open bracket under the cursor, which is more like Meta+Ctrl+B backward-sexp and Meta+Ctrl+F forward-sexp.

you can try this VS Code extension: https://marketplace.visualstudio.com/items?itemName=OnlyLys.leaper
It provides the ability to leap out of autoclosing pairs with Tab.

Related

Eclipse - How to find missing closing brace

I'm using the Groovy editor in Eclipse. When I compile/seed my script I sometimes get the below output.
839: expecting '}', found '' # line 839, column 1
The line above is the last line in the script which doesn't tell me much. It just says there is a closing brace missing somewhere in the script. One way I typically try is to zoom out (ctrl -) as much as possible in my editor (after source code formatting) then I try to look for something that looks oddly indented. The problem is some blocks are quite long so this is not ideal...
Is there a better approach or easier way to find out where the missing brace is in Eclipse? Or using another app (i.e. Notepad++, Sublime)? I would like to avoid using online tools pasting sensitive code.
When you place the cursor after an opening brace, the editor will highlight the closing brace. And you can jump to the closing brace using Go to Matching Bracket (Ctrl+Shift+P). Similarly, you can place the cursor just before a closing brace to highlight the opening brace and use the same command to jump to it. Using these aids, you should be able to narrow down where the unpaired opening brace is.

Visual Studio Code bracket auto completion

This has been annoying me for a while. VSCode doesn't let me type a closing bracked or parenthesis or the like ( ")", "]", "}") when there is already a closing symbol of the same type.
In this WEBM you see me try to set another set of brackets and VSCode skips the closing bracket that I typed. This is extremely annoying.
WEBM
How do I disable this behaviour in VSCode? (Or correct it, so VSCode closes the inner bracket for me.)
Edit: I know I can disable auto closing brackets in VSCode with "editor.autoClosingBrackets": false. But I don't want to disable it altogether. I just want to disable the overtyping.
TL;DR: As of June 2019, it's not possible to disable only the overtyping part of the autocloseBrackets function. You can only disable auto
bracket closing altogether.
Some people suggest using the TabOut Extension for Visual Studio Code to tab out of quotes, brackets, etc.
Ok, so what I found out over at the VSC Github is this:
[...] This can be turned off via editor.autoClosingBrackets. The feature
consists of multiple parts:
one is that when ( is typed, the result is (|).
the other part that is hit here, is that when ) is typed and ) follows the cursor, ) will be overtyped.
The feature is implemented language agnostic and looks only locally at
the next character. It does not count brackets to determine if the
code is "bracket unbalanced".
(Source: https://github.com/Microsoft/vscode/issues/35799)
At the moment, it's not possible to fix this, without losing the auto
bracket closing feature. The above thread has since been closed. New one is here: https://github.com/Microsoft/vscode/issues/37315 , but no patch has come out yet.
I face the same issue,
It's because of the GIT COPILOT once I uninstall and restart the VS CODE it's working properly now

iPython update interfers with Alt-Gr combinations

I just updated Python to 2.7.13 and Anaconda 4.4.0. Since the update, I cannot type the open square bracket ("[") into Jupyter. However, I can type the closed square bracket and copy paste the open square bracket without problem. I am using a French Canadian keyboard and to type these square brackets I do need to press a combination with "Alt-Gr". "Alt-Gr" seems to trigger something in Jupyter notebook and I'm guessing the exact combinations for open square bracket is used as a shortcut for something else. I cannot find it in the list of shortcuts as "Alt-Gr" doesn't seem to be a valid key when trying to edit keyboard shortcuts. Any clue of what's causing the issue?

How do I select text inside of braces in Visual Studio Code?

In Atom I can select inside of brackets with CMD+CTRL+M. How can I do this in Visual Studio Code? I've checked the keyboard bindings, but didn't find anything.
There are 2 even better alternative commands in the keybinding file you might want to check out:
editor.action.smartSelect.grow
and
editor.action.smartSelect.shrink
They select everything in between the next boundary (quotes, brackets, curly braces...) and the selection grows to the next boundary when you hit the shortcut again.
Default shortcut is ctrl+shift+cmd+right / ctrl+shift+cmd+left, which is a bit too "finger heavy" for my taste, so you might want to rebind it (I use ctrl+up / ctrl+down).
Shift+Alt+Right for selecting all text inside the braces.
CTRL+Shift+\ for jumping between opening/closing braces (or) parentheses.

Netbeans Keyboard Shortcut to Jump out of Quotations

I'm using Netbeans 7 and programming PHP. I was wondering if anyone knew of a keyboard shortcut to jump out of quotations marks and parenthesis (besides the right arrow key). For example I would like to type a quotation, type some text, then:
"my cursor would be here -> |"
Then hit tab or something equivalent to jump outside of the quotations:
"some text"| <- my cursor would now be here
Is this possible to accomplish using netbeans?
Type the second (end) quote. Netbeans realizes what's going on and does exactly what you describe.
you should take the auto quotation as a help to minimaze errors:
"The user often writes a code that has opening and closing brackets, and this is very often source of compilation errors. If the IDE would insert a closing bracket each time opening bracket is typed, the likelihood of error is smaller, and the user also has a better visualization of the structure."
source: https://ui.netbeans.org/docs/hi/promoB/smartBrackets.html
I was looking to a "short cut" myself to allow me to jump outside the quotation even when the cursor is not at the end of the content, but I could not find it.
Like me, you might find this method useful as well: select the text you want to wrap in quotes/brackets and the press the opening quotes/brackets you like: NetBeans will do it for you.
source: How to surround a text in quotes in netbeans IDE
code safe ;)