Personally, my problem with trying to use Vim keybindings in VS Code is not about the motions of moving around/editing the code itself, but everything else. You end up in plenty of situations where you have to resolve using the mouse because you ended up on some sub-page or whatever, where you either need to resolve using the mouse or keep pressing Tab until you get to where you want to go. Installing plugins is one…
perhaps onivim would be a good VSCode alternative for you, I think they have a mode like the browser vim extensions that labels everything on screen with a key you can press instead of clicking. https://onivim.io/
VSCode-Neovim: Use embedded Neovim in VSCode without emulation
51–60 of 112 posts
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#52Personally, my problem with trying to use Vim keybindings in VS Code is not about the motions of moving around/editing the code itself, but everything else. You end up in plenty of situations where you have to resolve using the mouse because you ended up on some sub-page or whatever, where you either need to resolve using the mouse or keep pressing Tab until you get to where you want to go. Installing plugins is one…
> Installing plugins is one good example of this, where even if you use a Vim plugin (or this, it seems), you still need to resolve to using the mouse/Tabbing to actually install the plugin itself.
I agree with you here, but I rarely need to install new plugins. It's certainly not a task I repeat for a given plugin. Plugins are actually the reason I do primary development in VSCode instead of Neovim natively. I can set up linters, language highlighters, etc in VSCode much faster than I can in Neovim. The ecosystem in VSCode also seems to be bigger for what I've done in the last few years.
---
Anyways, here are some VS Code keybindings I've found essential to go hand-in-hand with vscode-neovim. These few probably get me to 90% keyboard navigation for day-to-day editing.
cmd-shift-m: toggle the bottom tray problems (works as a universal way to show/hide the bottom)
cmd-b: toggle the left sidebar (in whatever context it was last in)
cmd-shift-e: show the current file in the left sidebar
cmd-0: move context/focus to the left sidebar cmd-1: move context/focus to the editor cmd-2: move context/focus to the right editor (or open an editor split, if not yet split)
ctrl-1,...9: highlight Nth tab from the left ctrl-0: highlight rightmost tab
cmd-p: fuzzy find file cmd-shift-p: fuzzy find any installed action by description
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#53Earlier quoted context omitted.
> Installing plugins is one good example of this, where even if you use a Vim plugin (or this, it seems), you still need to resolve to using the mouse/Tabbing to actually install the plugin itself. Sounds like a minor annoyance at best... Where vim-mode is important to me is editing and navigating code, not when installing plugins...
As I said, it's one example. Anything outside the code window suffers from the same problem, not just installing plugins...
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#54Personally, my problem with trying to use Vim keybindings in VS Code is not about the motions of moving around/editing the code itself, but everything else. You end up in plenty of situations where you have to resolve using the mouse because you ended up on some sub-page or whatever, where you either need to resolve using the mouse or keep pressing Tab until you get to where you want to go. Installing plugins is one…
I guess I am the target market. I don't mind using the mouse when I'm not in the "flow" of editing. Even browsing code, scroll wheels are pretty expressive, and clicking to jump to definition is fine. Ok not typing, so I don't need to keep my hand on the home row. But the actual editing doesn't use the mouse.
gd (go to definition)
You'll also like
gh (peek definition)
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#55I tried this plugin a few years ago. It was neat but ultimately buggy and not ironed out enough to use daily. To people who currently use it, has it improved noticeably?
Back then, I used a custom homebrew tap to get the proper Neovim version installed, and the plugin mostly worked. Occasionally the editing context would get messed up, and still does. I've found that changing tabs inside VSCode resets the neovim context, and that's a nearly-instant fix for most issues I see now.
It also works with the default version of Neovim from homebrew. No more custom tap needed.
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#56I use the regular vim extension in VSCode. How does this compare to that?
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#57Would love to see if people have a good experience with this. The only thing keeping me on neovim is the ergonomics of my config. If I can have that, PLUS the discoverability of all the LSP features, hovering, consolidated error messages, etc. without it breaking all the time, I would switch in a heartbeat.
For unrelated reasons I've gone back to neovim. But I used this in vscode for about a year. It works well. I found it got stuck once a day or so and I had to restart vscode. That might have improved by now. Having your keybinding-related config spread out across so many different places (nvim's config, vscode's preferences and keybinding files) is a bit annoying, and I found after initial setup I kept forgetting what…
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#58Would love to see if people have a good experience with this. The only thing keeping me on neovim is the ergonomics of my config. If I can have that, PLUS the discoverability of all the LSP features, hovering, consolidated error messages, etc. without it breaking all the time, I would switch in a heartbeat.
Been using it for a couple of years. No problems. You don't get the "absolute fullest" (neo)vim experience because you don't get the buffers/panes like you do in nvim though.
ctrl-w s : will split horizontally ctrl-w v : will split vertically
Commands work, and I just tested buffers specifically. I can type :buffers and I see a list. I was able to get vscode to switch tabs with :b 209 (I don't normally inspect buffers this way, but it's integrated and it works).
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#59I love neovim but I don’t have a good replacement for the git plugin of vscode. I haven’t found my way to replicating that experience in neovim. I tried lazygit but I find the diff viewer hard to understand and navigate. Diff view ( https://github.com/sindrets/diffview.nvim ) might be it, but I haven’t made the time to install a newer version of git from source (Debian…)
Besides showing the git signs in the gutter, it can do staging, diffing, navigation between hunks, line blame, can show deleted lines etc. If you have more advanced workflows, it might not be enough though. I use lazygit quite often as well.
Re: VSCode-Neovim: Use embedded Neovim in VSCode without emulation
#60I forget all of the settings I changed to make it work for me, but it's mostly usable as a vim replacement now.
I needed to set 'use control keys' or something like that, so I can use Ctrl-[ instead of ESC to enter command mode, something I've done since Vim 2.0 days (and before that in Elvis).
I also override vim bindings for Ctrl-X, Ctrl-C, Ctrl-V, (cut/copy/paste), Ctrl-Z, Ctrl-Y (undo/redo) so I can use vscode for that behavior instead. I'll also use the normal vim commands for those also (like yy, p, etc). Best of both worlds I suppose.
My only gripe with this approach is undo/redo stacks can sometimes get lost between vim and vscode handling it. There is a similar extension for Visual Studio which has never lost the undo/redo stack like the vscode extension does.
Is any of this any better with the newest vscode-neovim? I tried vscode-neovim a while back and had go back to vscodevim after having problems.