I use vs-code as my go-to editor on Windows. Recently I've installed on Ubuntu and now the default key mapping is different.
Is there any way I can set the key mapping on Ubuntu similar to what they were for Windows, or at least a subset of it?
I have created an extension that provides the default Windows keybindings. It is on the VSCode extension marketplace and called Windows Default Keybindngs.
I have tested it on Linux with VSCode 1.38.0 and 1.36.1.
The new bindings take precedence where there is a conflict, but existing, non-conflicting bindings are still available.
Basically all I did was use HolyBlackCat's suggestion to run "Preferences: Open Default Keyboard Shortcuts (JSON)" and stuff the result into the appropriate place in package.json. (Plus document it and figure out how to publish it!)
Update 2020-06-05: In response to a question in a comment, I did a search and found LinuxKeybindings, an extension that provides the default Linux bindings. I have not tried it myself but this could be useful for those wanting the Linux bindings instead of Windows bindings.
A quick way to transfer the default keymap without an extension:
VS Code Windows (source)
open "Show All Commands" / Ctrl+Shift+P
select Open Default Keyboard Shortcuts (JSON) (docs)
Note: #Ville Venäläinen's answer did not work for me for default key bindings.
copy everthing to clipboard or a temporary file (like you need it)
VS Code Linux (target)
open user keybindings / CTRL + K CTRL + S → click Open Keyboard Shortcuts (JSON) button
paste all previously copied settings to this file. If you already have custom user settings, make sure to don't overwrite them. Also preserve the file JSON structure [{}, {}, ...].
Additional notes
You can make a backup of the keymaps before. Default file locations analogue to settings.json:
Linux: $HOME/.config/Code/User/keybindings.json
Windows: %APPDATA%\Code\User\keybindings.json
If needed, also copy custom user keyboard shortcuts in source and append them in the target keybindings.json file (as explained above).
This worked well for me with a Debian target distro. If you should happen to get a key conflict, just delete or change the relevant key binding for this case.
At least with the latest VSCode, you can go to File -> Preferences -> Keyboard Shortcuts. On that page, there is a text under the search field: For advanced customizations open and edit keybindings.json. That will open you a view showing the default keybindings on the left and an empty file on the right for your own bindings. You can try to copy those bindings from Windows and save the to your Ubuntu one.
If you're not customizing your keymap, look through VSCode Keymaps for keymaps and install on both Windows and Ubuntu.
I personally use the code-settings-sync extension.
Synchronize Settings, Snippets, Themes, File Icons, Launch, Keybindings, Workspaces and Extensions Across Multiple Machines Using GitHub Gist.
Related
I have been a windows user since the beginning, just recently switched to MacOS, all the preferences settings in my Eclipse, they are all set to default with sysout option on, but when I typed sysout in eclipse, it won't automatically go into System.out.println(). I've checked several other related topics as well as most of the resources which mention 'ctrl + space' (Which worked perfectly on Windows for me). But, when I try to use 'command + space' on my Mac it just launches Spotlight search & I have even tried resetting the commands to default in Eclipse, Please let me know how I can get my sysout working.
Just to be simplify in images.
Try to unbind the shortcut on mac:
1- Mac Preferences of system
2- Choose Keyboard:
3- Go to Layout of keyboard and Uncheck "ˆspace"
You can try to change on eclipse, but if you want to use "^space" to shortcut, will be necessary unbind this on mac. By default or mac keys as shortcut to change keyboard type.
(Eu quero Ibagens!)
Suppose that I have a map on my init.vim that I want to change the behaviour depending on the folder that I am. How could you do that?
A more concrete example: I have a map on my F12 that runs the project that I am. So if I am on a python project, this F12 will run an ipython on a floaternew window, with the current file already imported. Though, if I am on a cpp project, the same F12 will build using Make and running the binary on a floaternew window as well.
Nowadays, I have these two behaviours mapped on different key bindings. But It is going to very nice if I have only one binding to "run the project". Even if I need to open neovim with some parameter in each project, like neovim --local-config mylocalconfig.vim (extending init.vim with some behaviour)
I am kind inspired by a behaviour like direnv but with .vim files.
Any ideas?
There is an option in vim set exrc which enables reading vim config files from current directory, it also works in neovim.
From docs (:h exrc)
Enables the reading of .vimrc, .exrc and .gvimrc in the current
directory. If you switch this option on you should also consider
setting the 'secure' option (see |initialization|). Using a local
.exrc, .vimrc or .gvimrc is a potential security leak, use with care!
also see |.vimrc| and |gui-init|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
I’m trying to add a couple of key-bindings to my codespace image. But I can’t find where to store the keybindings.json, when I open the file in an active codespace it’s located in /User/keybindings.json, but I can’t find it in bash or when I try to Open Folder that folder. It seems to be a virtual file.
Is there a way to add these to the devcontainer.json? Or a magic place I can send them to from my Docker File?
Based on a number of closed issues, keybindings are considered more a personal preference and are synced from the users' preferences as well as platform dependent.
To supply or override keybindings a custom extension must be created, published to the marketplace and installed through the devcontainer.json.
The VS Code documentation refers to a link to keybindings.json. This link is not present in my editor (see image). How can it be restored?
Where is keybindings.json located in Windows 10?
VS Code version: 1.29.0-insider (user setup)
I've tested this both on 1.28.0 and 1.29.0-insider. It seems that the link in question doesn't exist on the insider version. On my 1.28.0 installation, I can click the link and it will go to keybindings.json, which is found in C:\Users\<username>\AppData\Roaming\Code\User\keybindings.json. This link exists even if the file itself is deleted, and will create a new file at that location if you click it.
In the insider's version however, the link is gone, and the insider keybindings.json is installed for me by default in C:\Users\<username>\AppData\Roaming\Code - Insiders\User\keybindings.json.
If you want to open it up, you can open up the control palette with CTRL +SHIFT + P and select Preferences: Open Keyboard Shortcuts File. This does the same thing as clicking on that link in the non-insiders version, including creating the file if it doesn't exist.
I normally use the WebStorm IDE for Node.js and FE JavaScript development. However I was thinking of using Sublime Text 3 since I am running out of computing power on a crappy old Macbook Pro and ST3 should be lighter on memory and CPU.
However, my one hangup is that ST3 doesn't seem to have a command line terminal integration possible. I find this to be a very useful feature that's available in Eclipse and WebStorm.
I did some Googling and I don't see any great terminal integration plugins for ST3, is there such a thing or not?
Here is WebStorm with the terminal integrated:
Terminus does this. Supports both Unix and Windows. Works great. 👍
In View (on Windows)
Ctrl + Shift + P --> Terminus: Open Default Shell in Tab (View)
In Panel (on Unix)
Ctrl + Shift + P --> Terminus: Open Default Shell in Panel
Type exit to exit and close the terminal opened in a panel.
I installed the Sublime package TerminalView that can show a terminal window within Sublime in a separate tab.
It works with MacOS or Linux but is no longer actively supported.
Installation:
Open the command palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows) and find Package Control: Install Package
Search for TerminalView and hit Return to install.
The terminal windows has a few flaws (at least on macOS) as it seems to conflict with Sublime's keyboard shortcuts. I however use it only to automatically run unit tests when the edited program code changes. Therefore it works just fine. In that case it works best if I show the terminal window below the text editor. You can do so in the menu View > Layout > Rows: 2.
In sublime 3,
ctrl + shift + p search Package Control: Install Package
Search and install TerminalView
to set shortcuts,
go to Preferences -> Key Bindings
on right side Pane paste this,
[
{ "keys": ["ctrl+shift+t"], "command": "terminal_view_open" }
]
Now ctrl+shift+t is your shortcuts
I prefer Terminus and it's the first cross platform terminal for Sublime Text. Check this video it might help you
I tried Sublime package - TerminalView, quickly realized I couldn't copy paste things. Tried on MacOS.
Terminus(https://github.com/randy3k/Terminus ) looks good to me, it has two options
(i) opens in a tab(view)
(ii) opens also in a panel. (which I prefer most)
The below original answer is now outdated; see below answer by Svish.
I was wondering the same thing a while back, and I believe the answer is: no.
There's no good terminal integration in ST3, except, maybe, for Terminal, which simply takes you to the terminal from any given project folder.
Works ok, but not sure how much it really saves.
No way to have it in the ST3 window AFAIK.