How to execute snippet instantaneously - vscode - visual-studio-code

Is there the option to "execute snippets" right away in vscode, meaning without having to press tab? This is really the only thing holding me back from vscode because in vim I can simply configure it, so e.g. if I have a snippet which gets triggered if I type test it automatically replaces test by the snippet content without having to press any extra key like tab. Is this possible in vscode?

Related

Ctrl+D equivalent in DBeaver

I checked the DBeaver shortcuts docs page and Googled a lot but couldn't find any info on this...
Does DBeaver have a Ctrl+D equivalent (I am referring to Ctrl+D in VS Code, where it multi-selects by adding the current selection)?
Background
I work with BigQuery a lot, and in BigQuery Console and VS Code they both have the Ctrl+D functionality but not in DBeaver (at least not by default with the same hotkey)
DBeaver does not come with this functionality working by default, but you can very easily add this shortcut yourself with the following 4 steps:
On the top context menu, click Window -> Preferences. Then select User Interface -> Keys.
The command you want to add a binding to is the Multi selection down relative to anchor selection. So, on the filter text box, write multi. Select it, then on the bottom pane select the Binding text box, and press the shortcut keys down (In this case, press Ctrl+D).
Make sure that the When column changes to Editing Text. Otherwise, change this yourself. It will look like the iamge below
The Ctrl+D shortcut is already taken by the "Delete Line" command, so you need to unbind them. On the filter textbox, write ctrl+d. Then click on row that shows Delete Line, and click the Unbind Command button.
Click Apply and Close and have fun.
I believe it is Ctrl+Alt+Down (from https://dbeaver.com/docs/wiki/Shortcuts/)

How do I stop Visual Studio Code (VSCode) from linting new, unsaved files?

In Visual Studio Code (VSCode), I often want to temporarily store some text while coding. A quick way to do this is to hit Ctrl + N (to open a new file in a new tab) and then Ctrl + V (to paste the text). I can then go back to the new tab later on and retrieve the text. This is safer than using the clipboard, because I don't want to accidentally blow it away by copying something else.
However, the ESLint extension for VSCode will automatically detect that I have pasted some JavaScript code into a new file and will immediately start linting it, even though it is a brand new & unsaved file. This clutters up the "Problems" pane with spurious errors.
How do I prevent this from happening?
The solution is to click on the language icon in the bottom right hand corner, and switch it to Plain Text (plaintext).
This will obviously disable the linter, because it won't be a JavaScript/TypeScript file anymore.
It's also probably possible to make a VSCode hotkey that will do this in one keystroke, but I don't really do this pattern often enough to justify making a custom hotkey for it.
Search preferences for "Format on paste" or in settings.json enter:
"editor.formatOnPaste": true

VSCode how to automatically insert Intellisense suggestions without having to press Enter?

Default VS Code Intellisense behaviour
User is presented with a menu of suggestions
User then has to press the Up or Down arrow keys to navigate through the menu
Finally user has to confirm with Enter to insert the suggestion and close the dialog
What I would like instead
Don't need to press Enter
Suggestions are automatically inserted (and cycled through) by pressing Up/Down
Pressing any other keys will close the dialog and resume typing
To be clear, I want to replicate the default behaviour of YouCompleteMe:
When you type, a completion menu pops up. If you like the completions, you use the <Tab> key (by default, can be changed to <Enter> or <Down> arrow or whatever) to select a completion string you want. The very act of "tabbing through" the list to select the item you want inserts the candidate string. When you tab to a different candidate, the editor code is replaced with the new candidate. There is no accept key because by the point where you have the candidate you want selected in the menu the candidate has already been inserted in the editor. There is nothing to "accept". You just keep typing, the candidate has already been inserted.
Is such behaviour possible with Visual Studio Code, either by default or through a plugin?
The editor.tabCompletion option is the closest thing currently available:
By default, tab completion is disabled. Use the editor.tabCompletion setting to enable it. These values exist:
off - (default) Tab completion is disabled.
on - Tab completion is enabled for all suggestions and repeated invocations insert the next best suggestion.
onlySnippets - Tab completion only inserts static snippets which prefix match the current line prefix.
(Emphasis mine)
... except that the first Tab press hides the suggestion window.
I did some digging about editor.tabCompletion, and I found that closing the suggestion window is part of the tab completion's option original design, and that while other users have asked about an option not to close the suggestion window or specifically YouCompleteMe-style behaviour, that this is currently not supported.
"editor.acceptSuggestionOnEnter": "off",
To disable Enter to accept suggestion.

MATLAB: set keyboard shortcut to go to line where current code execution stopped

I would like to set a key short-cut. e.g. ctrl+1 or so, to go in the editor into the file and line where the 'keyboard' command stopped the current code execution in order to debug faster. Is this possible? Or does it exist already? Now, even when I click the function in the debugger tab, it doesn't go there if that function was last clicked and in the mean time you moved manually to another function in the editor. I first have to click another function in the pop down menu and than re-click to function I want to go to. Very annoying.

How can I prevent Aptana Studio 3 from completing code with the 'tab' key

I'm using Aptana Studio 3, with content assist on, and I have a really annoying problem.
Basically, I'll find myself within single quotes or some other context that one can "tab" out of, and I'll type something like, say, "login". So, when I finish typing login, I use tab to get out of the quotes, but because autocomplete has found the "LoginForm" object, instead of bringing me out of the quotes, pressing tab adds "Form" to my "Login," writing "LoginForm".
Basically, I would like to set up the editor so that "enter" autocompletes and tab simply indents or tabs out of quotes/braces/etc.
Press Esc then Tab, eventually you get used to it. I advise against editing your editor otherwise when you use another IDE you'll hit the same problem because that's what they all do.
If you really want to edit your aptanas keybindings: https://wiki.appcelerator.org/display/tis/Modifying+your+shortcut+keys