I want to create a custom keymapping in vscode that would help me write special text faster when writing in LATEX.
Example of what I mean :
I'm using the \color{choosen_color}{text} command in latex.
I have written "some text" and within that I want to use the above command over the "text" word.
Instead of having to write it manually, I want that if I select "text" and then press Ctrl+Alt+c, vscode automatically writes \color{}{text} and place the cursor between the first brackets.
Any idea how to do it ?
Ok, so thanks to #rioV8 I figured it out.
What I was looking for is the VsCode Keymapping snippets.
More about it here :
https://code.visualstudio.com/updates/v1_9#_insert-snippets
Visual Studio Code snippet as keyboard shortcut key
Related
I want to set up automatic text replacement shortcuts in Visual Studio Code similar to snippets in SQL Complete or text replacements on iOS. So for example: if I type ssf I want VS Code to replace it with SELECT * FROM. (Or alternatively, offer it as an autocomplete suggestion).
How can I set up automatic text replacement rules in VS Code?
you can use extensions such as the "JavaScript (ES6) code snippets"
Is there a keyboard shortcut How to make VS Code treat/reopen/reload files without extension as a certain language?
Just to be clear, here's my use case:
Sometimes I have a big JSON I need to read so I copy it in VsCode new file but since it's a new file I have to save it a s JSON extension to read it in the correct format. So my question is: Is there a way to specify the language for this new file(without extension) to open it as JSON for example?
Thank you
I found these two options:
// The following example associates all files in a folder `somefolder` to PHP:
"files.associations": {
"**/somefolder/*.*": "php"
}
https://code.visualstudio.com/docs/languages/overview#_can-i-map-additional-file-extensions-to-a-language
// The default language mode that is assigned to new files.
"files.defaultLanguage": "html"
https://code.visualstudio.com/docs/languages/overview#_how-do-i-set-the-default-language-for-new-files
Add the lines of your choice to settings.json.
Nevermind guys I found it:
The feature is called Change Language Mode.
The default shortcut is Ctrl+K M if you want to customize it here's the name of the command:
workbench.action.editor.changeLanguageMode
You can also click in the lower right of VSCODE window to change the language mode:
how do I escape using a suggestion? ex every time I write a test the suggested text is TextDecoderStream and as soon as I invoke test it changes to TextDecoderStream(). It also selects TextDecoderStream when I hit enter and tab.
If you are trying to declare a variable name try to embrace it between brackets e.g. "[text]".
If you're looking for another solution try this: Visual Studio Code: close suggestion box on `esc`?
I want to keep track of a todo list in Visual Studio Code.
Is it possible to display/toggle strikethrough text:
task not yet done
̶t̶a̶s̶k̶ ̶d̶o̶n̶e̶
(used https://www.piliapp.com/cool-text/strikethrough-text/ for the above).
Looking for a solution natively or with an extension. The strike-through text needs to be displayed in the text file (like the functioning of org mode in emacs) and not in some output window (like the rendering of a HTML/Latex/MD document).
Any experts in Visual Studio Code that know if this can be done and how to do it ?
You can make strikethrough in vscode with the help of TODO Highlight extension:
"todohighlight.keywordsPattern": "(~~.+?~~)|(✔.+?\n)|(\\[x\\].+\n)",
"todohighlight.defaultStyle": {
"color": "none",
"backgroundColor": "none",
"textDecoration": "line-through"
},
Use patterns that you usually use for done todos. The above works for such:
[x] done
✔ done
~~done~~
After that you can either use plain typing or find some toggling extension or write one yourself.
Try the extension "Strike for VSCode", looks very lightweight extension.
Highlight the text you want to strikethrough and hit CTRL K + backspace.
CTRL K + backspace again to toggle.
You can use the built in function of adding "~~" before and after the text
so its like:
~~strikethrough~~
which strikes the words in between.
This can be done without extensions.
I'm trying to use Notepad++ with the Progress programming language.
I have installed the language definition in %APPDATA%\Roaming\Notepad++ as userDefineLang.xml and syntax highlighting is working correctly.
I've put a file in the notepad++ Plugins\APIs directory named progress.xml, but the contents are not recognized by Notepad++.
I've also removed all the other language files from that directory and Notepad++ still shows the exact same autocomplete suggestions it did before I removed them.
Also, when typing in a program, it looks like every word in the file is an auto-complete suggestion, not just the keywords or function names.
Anyone know how to track this down?
Notepad++ provides 2 types of features:
Auto-completion that read the open file and provide suggestion of words and/or functions within the file
Suggestion with the arguments of functions (specific to the language)
Based on what you write, it seems what you want is auto-completion on function only + suggestion on arguments.
To do that, you just need to change a setting.
Go to Settings > Preferences... > Auto-completion
Check Enable Auto-completion on each input
Select Function completion and not Word completion
Check Function parameter hint on input (if you have this option)
On version 6.5.5 of Notepad++, I have this setting
Some documentation about auto-completion is available in Notepad++ Wiki.
The answer is to DISABLE "Enable auto-completion on each input". Tested and works perfectly.