In Sublime Text, when I press Ctrl+B, it runs my application. Is there a hotkey to force it to stop running?
I'm debugging some code that often hangs, and Sublime Text ends up completely hanging. I'd like to know what hotkey I can press to stop this.
CtrlBreak (Windows/Linux) will cancel a build that is in progress. There is no default key binding for OS X, but you can create your own if you wish. Navigate to Sublime Text -> Preferences -> Key Bindings - User and add the following:
{ "keys": ["super+alt+b"], "command": "exec", "args": {"kill": true} }
If you don't have any custom key bindings yet, make sure to wrap the above with square brackets [].
Related
How can I disable this backspace behavior and remove letters in strandard way?
For some reasons in Sublime Default (Windows).sublime-keymap were changed backspace hotkey actions. I didn't add new plugins or macroses. Probably some kind of bug.
I did next steps to fix it:
Input sublime.log_commands(True)
Press backspace and check what happens. I seen this wrong command that added in file for unknown reason: command: run_macro_file {"file": "res://Packages/Default/Delete Left Right.sublime-macro"}
Open Preferences -> Key Bindings input standard backspace action by command: { "keys": ["backspace"], "command": "left_delete" },
I use Debian and I switched from Vim to Visual Studio Code, when I noticed, that there is a Vim movement extension for VS Code from vscodevim. While I was using Vim, I mapped my Caps lock key to the ESC key. In Vim it works perfectly, but VS Code is not reacting on a Caps lock input.
I hope there is a solution. If there are any questions feel free to ask.
This is how I changed my keyboard layout:
I navigated to /etc/default/
and edited the keyboard file. This is how it looks now
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="de"
XKBVARIANT=""
XKBOPTIONS="caps:escape"
BACKSPACE="guess"
The Caps lock key works also in other programs e.x. "Synaptic Package Manager"
Late answer, but may be useful for someone:
Switched CAPS and ESC in Ubuntu over the keyboard preferences section. Worked in almost all applications, but not in Visual Studio Code.
So I modified VS Code settings:
{
"keyboard.dispatch": "keyCode"
}
and it worked.
For those who have the same problems on Linux:
If in your system wide config, Caps Lock is Esc, Esc is Caps Lock ( ['caps:swapescape'] ),
disable the key mapping in your system. Make it default.
In VSCode, press ctrl+shift+p and select Preferences: Open Keyboard Sortcuts
search for the vim_escape
double click on it and press original Caps Lock and save it.
Edit your keymap config in your system.
That is it.
There is no problem. Keys are working as expected.
Enlighten by an answer from this question.
In Visual Studio Code, how to toggle between vim-emulation and no-vim-emulation when the vscodevim extension is installed?
Another solution is
Click the "Gear icon" -> Keyboard Shortcuts->type "esc" or "Escape" ->
find extension.vim_escape -> edit by click the pencil icon or right click choose change keybinding
->type you desired key and ENTER
Set the Caps-lock to act as Esc in your settings
Post this in your keybindings json for vscode (Ctrl-K Ctrl-S -> open the JSON from the icon on the top right corner):
{
"key": "capslock",
"command": "extension.vim_escape",
"when": "editorTextFocus && vim.active && !inDebugRepl"
},
If you are looking for a system wide tool, you might be interested in keyd https://github.com/rvaiya/keyd. You can avoid this setup. The readme has an example on how setup caps lock as both ctrl and esc.
Ubuntu solution
First make sure you swaped escape with capslock like: source
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:swapescape']"
Then inside VSCode press ctrl+shift+p search for Preferences: Open keyboard Shortcuts (JSON) (it will open keybindings.json) and paste:
{
"key": "capslock",
"command": "extension.vim_escape",
"when": "editorTextFocus && vim.active && !inDebugRepl"
},
{
"key": "escape",
"command": "-extension.vim_escape",
"when": "editorTextFocus && vim.active && !inDebugRepl"
}
Reload VSCode and you are good to go.
Windows solution
Install AutoHotkey
Go to AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\
Create a file caps_to_esc.ahk and insert code:
#IfWinActive ahk_exe Code.exe
Capslock::Esc
Esc::Capslock
#IfWinActive
Save, run the file and you are good to go.
What is the keyboard shortcut in SublimeText3 to manually enter a line break without executing the command option? In Rstudio I use Shift+Enter. In Excel I use Alt+Enter
I know Enter yields a newline but I don't want that. I want to continue wrapping on the current line - WITH - a line break.
I looked through the key bindings and there isn't one. If you have a macro that will do it, you can bind a hotkey to run that macro like this:
{ "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} }
Just go to Sublime Text -> Preferences -> Key Bindings and add your new one.
How do I set up a keyboard shortcut to show/hide tabs and the status bar in Sublime Text 3?
At the moment I have to go View->Show/Hide Tabs. I'm using OSX. I have for instance
{ "keys": ["shift+space"], "command": "move", "args":
{"by": "characters", "forward": true},
in my key bindings user file which I set up (thanks to this answer!) to move the cursor one space forwards by pressing shift and space, and ideally I'm looking for something similar to show/hide tabs and the status bar.
In the ST console, enter sublime.log_commands(True). Then execute the command through the menu as normal. The command being executed (with arguments if applicable) will be displayed in the ST console. You can use the information there to create a key binding to the appropriate command.
I have installed the Filter Lines plugin (Windows OS) but I can't figure out if it is possible to have a keyboard combination for the Edit > Code Folding > Fold With String as I cannot find the default keyboard combination ctrl+k ctrl+s in the Key Bindings - Default?
If this is not possible, can anyone then refer to another filter plugin, which (ideally) realtime filters the text, so I can edit all the lines in one go?
I want keyboard shortcuts for the Code Folding lines:
Just look at the plugin source and you will know what command to run as shortcut. If the name of the command class is FoldToLinesCommand, the command name in the shortcut files will be fold_to_lines.
Another solution is to open Sublime console, and enter
sublime.log_commands(True)
this will log all the commands in the console. After, you just have to run the command you want as a shortcut, look at the console output and write it in your key bindings files.
Do not forget to disable command logging when you are done to avoid useless output.
As alternative to extra plugins, I'm currently using Sublime's own folding shortcuts. Note that when making a selection, of a word or line for example, you will only fold the selected string.
The ctrlshift[ shortcut may be used to fold a code block.
Ofcourse, unfolding can be done with the related ctrlshift] shortcut.
These shortcuts are defined in the Default Sublime keymap, as fold and unfold, as following.
{ "keys": ["ctrl+shift+["], "command": "fold" },
{ "keys": ["ctrl+shift+]"], "command": "unfold" },
Hope this helps you out.