I'd like to customize some of the Sublime Text 3 keybindings to mimic IntelliJ IDEA. One of them is opening a file from the current project, also known as Goto Anything in Sublime jargaon. I followed the instructions in this answer to find out that the default key binding for "Goto Anything" is ⌘ + p on a Mac, like so:
{ "keys": ["super+p"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }
I added a new keybinding as follows:
[
{ "keys": ["shift+shift"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }
]
It, however, doesn't work; pressing shift twice in rapid succession does precisely nothing. When I open the console, I see the following message:
Unable to open /Users/me/Library/Application Support/Sublime Text
3/Packages/Default/Default (OSX).sublime-keymap
According to this ticket, this message is harmless but misleading, and is just an indication that Sublime is opening a file.
What's wrong then?
OP here; I found this post in Sublime blog.
ST doesn't support using only modifier keys in a keybinding.
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 am working with the sublime 3 text editor. I am modifying the User version of the keymap, however, it does not seem to be replacing the default keymap hotkeys. Specifically, in the Default keymap, I see the following assigned for the "copy" hotkey:
{ "keys": ["ctrl+insert"], "command": "copy" },
{ "keys": ["ctrl+c"], "command": "copy" },
There are two hotkeys assigned for the copy command, and I am not sure why. I use the latter command in my User keymap, but the hotkey is not working. The ctrl+insert hotkey is the one that is taking precedence.
Is there a way to modify the Default keymap for Sublime?
I don't see this conflict. But if you do, you can set a hotkey command to none if you don't want it to use.
{
"keys": ["ctrl+insert"],
"command": "none"
},
I use VSCode with the VSCodeVim extension. When in Insert Mode, I can press "CMD-S" to save. When I do, I would also like to exit Insert Mode automatically instead of pressing "ESC" as well.
Is this possible?
I was looking for a solution similar to this issue as well.
It appears that multiple commands cannot be mapped to key bindings in vscode; however, I've found an extension, macros, that let's you do this.
If you use the below steps with the macros extension, I believe that you'll have the solution you're looking for, until vscode implements something to address this feature request.
Step one, edit user settings with the below:
"macros": {
"saveAndExitVimInsertMode": [
"workbench.action.files.save",
"extension.vim_escape"
]
}
Step two, edit keyboard bindings:
{
"key": "cmd+s",
"command": "macros.saveAndExitVimInsertMode"
}
VSCodeVim extension supports insert mode key bindings. Here is a link to the extension readme that describes this feature.
Here is a snippet you could put in your settings.json.
"vim.insertModeKeyBindingsNonRecursive": [
{
"before": [ "<C-s>" ],
"commands": [
{ "command": "workbench.action.files.save" },
{ "command": "extension.vim_escape" }
]
}
],
After reloading your vscode window you can pressing ctrl+s to exit insert mode and save the file.
open Show Command Palette (Ctrl+Shift+P). enter 'open keyboard shortcut' ,
search 'extension.vim_escape' and edit it to be 2 times caps lock key.
In my Sublime Text 3, the shortcut Ctrl+A moves cursor to the front of line as expected. However, Ctrl + E does not move cursor to the end of line. Then, I find out that this works: Command+RightArrowKey on Mac.
Anyone knows why Ctrl+E does not work as expected in the official shortcut documentation? What command shall I configure in the keybinding map?
My User key binding is very simple.
[
{ "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": true} },
]
When keys don't do what you expect in ST3 it's a good idea to install FindKeyConflicts
Install it through Package Manager and it'll help you work out why things aren't doing what you thought they should
The shortcuts listed are specific to the platform and the version of the Sublime Text. Here is the list of all the shortcuts, there is also a comparison chart here. Further, if you are getting started with Sublime Text3 this link might prove helpful.
I'm trying to mimic the functionality I set in Sublime Text that allows me to move the cursor much like 'j' or 'k' in VI. In the Windows world I guess it would be similar to a pgup/pgdn, however I'd like to just go up/down one line not one page.
Here's my bindings in Sublime Text that I'd like to mimic:
[
{"keys": ["ctrl+i"], "command": "move", "args": {"by": "lines", "forward": false}},
{ "keys": ["ctrl+k"], "command": "move", "args": {"by": "lines", "forward": true}}
]
Edit: As Logarr pointed out, the easier way to phrase this is I want to mimic the Up/Down arrow keys using ctrl+i and ctrl+k
There are already Vim extensions for Visual Studio. There is the free VsVim extension that works in Visual Studio 2010+ and ViEmu which works in Visual Studio 2003+ plus a few other applications.
If you just want to remap the up and down keys, then you can change the keyboard mapping. From Tools->Options find the Keyboard section. From there you can change the key bindings for Edit.LineDown and Edit.LineUp. You may want to select the Text Editor for the "Use new shortcut in:" setting so these changes only affect the text editor.
This would have been trivial if Microsoft hadn't ripped the macro functionality out of Visual Studio.
You could install AutoHotKey and write a simple script. This would have the advantage that you could apply these keymappings to any applications you like as well as Visual Studio.