VsVim | Vim Emulator Plugin for Visual Studio | Text Editor library
kandi X-RAY | VsVim Summary
kandi X-RAY | VsVim Summary
VsVim === VsVim is a free vim emulator for Visual Studio 2017 through to 2022.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of VsVim
VsVim Key Features
VsVim Examples and Code Snippets
Community Discussions
Trending Discussions on VsVim
QUESTION
I'm using vsvim, sometimes I highlight code in insert mode with my mouse and want to copy or cut it out. But I don't know-how. Instead, I have to change back to normal mode, highlight it again then cut it. I tried to Ctrl+O but it would get rid of the highlight. Does anyone know how to solve this? highlighted text in insert mode
...ANSWER
Answered 2021-Apr-24 at 11:17I have not used this extension, but when running vim natively, if you highlight stuff in insert mode, you can right-click and click on copy. Not sure whether this works in Visual Studio. However, reading the docs in GitHub I see there is a vim.handleKeys
setting, that you can set in settings.json
and you could specify C-c
and C-v
to be false in order to support Ctrl+c and Ctrl+v natively. The doc provides this example:
QUESTION
I have some shoulder pain that I am trying to get rid of by using vscodevim.
My biggest problem with vscodevim so far is that is sometimes collides with VS code shortcuts. For example I often save all my files with Ctrl+K S
. But with vscodevim enables, instead that key combination does something else.
I feel tired about the prospect of having to build a configuration with my own key VS Code key bindings, that don't conflict with vsvim. I hope there is a better solution.
So I ask you, my better knowing colleagues, how do you solve this problem?
...ANSWER
Answered 2020-Jun-16 at 16:49There is no easy way out for avoiding conflicts between vscode shortcut and vscodevim bindings. I suggest you to use vim keybindings instead of vscode shortcuts wherever possible. Vscodevim can prove to be a good gateway to vim provided you are open to relearning how you use vscode.
Instead of building your own configuration that doesn't collide with vscodevim you could redirect the effort in finding a way to do the same thing in vim. You can search web or use vim help.
Vim help is really comprehensive and easy to read. If you have vim installed you can use :help
or :h
followed by a specific subject, for example if you need to read about navigation type :h navigation
.
Now you have two choices and I will try to use example you provided i.e. saving a file :
Use bindings available for saving file in vim.
Vim provides so many shortcuts just for saving and quitting files, in vim try
:help write
and:help quit
to know more. Many of those shortcuts works in vscodevim too.To save file :
:w
to save a single file:wa
to write all buffers (in vscode all modified files).
Remove the bindings from vscodevim and use vscode shortcut.
You can delegate the key combination back to vscode. I suggest you do this only if there is any vscode shortcut that is absolutely necessary for you and it conflicts with vscodevim as doing this may result in some related vim bindings to not work. To know what Ctrl+k does in vim type
:h ctrl-k
in vim.If you want to use
Ctrl+K S
for saving file do following:Open vscode settings and search for
vim handlekeys
or directly open vscode'ssettings.json
:add following
"vim.handleKeys": {"": false}
I don't know if this a better solution but I was in your situation and tried different ways to solve it. Finally I found it was much easier to use vim keybindings than trying to coerce vscodevim.
QUESTION
Edit: I just tried this in the VSVim extension in VS2019, and it worked as expected. I'm starting to think that VSCodeVim extension for VSCode doesn't handle captures properly?
I am trying to search my typescript file for a list of variables that have not yet been assigned an initial value, and set it to = null
.
ANSWER
Answered 2020-Jan-28 at 18:08Apparently in VSCodeVim, capture groups are recognized with $1
, $2
, etc.. rather than \1
, \2
, etc...
So, using this worked:
QUESTION
In .vimrc
, I can test whether I am loaded in GVim by testing for has('gui_running')
. Is there a similar feature flag that VsVim uses so I can test whether VsVim is currently running?
The reason is that there are some mappings that I use in regular Vim that cause problems when run within VsVim and so I'd like to avoid loading them when run inside VsVim.
...ANSWER
Answered 2020-Jan-22 at 19:01For now, I found a workaround by using a ~/.vsvimrc
file. I just set a has_vsvim
variable in .vsvimrc
, then source my normal .vimrc
file, in which I can check for the has_vsvim
flag.
~/.vsvimrc:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install VsVim
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page