Live data from Hacker News

Show HN: Build your own Vim emulation for VS Code

johtela.github.io

11–20 of 51 posts

Re: Show HN: Build your own Vim emulation for VS Code

#11
post #6

Vim's power doesn't come from using single-letter commands to do things but, rather, in the language-like (action, verb, noun) expressions the whole ecosystem enables: "daw" to delete a word, "cit" to replace the "inner" part of a tag and start typing, numbered prefixes to execute an action that number of times, etc. See also: https://stackoverflow.com/questions/1218390/what-is-your-mos... aka "Your problem with Vim…

One of the best resources that I have used (in the distant past) is vim golf[1]. It's a super fun way to level up your vim skills. [1] https://www.vimgolf.com/

The issue I always had with it is that you can’t see the really good answers (unless that’s changed). I wanted to push an “I give up” button so I could access answers that would help me learn.

Re: Show HN: Build your own Vim emulation for VS Code

#12
post #4
post #2

This is an interesting approach. I find the popular vim emulation extension (vscodevim) is a bit buggy and has lots of "uncanny valley" gaps. At work I use vscodevim, and at home I use vim with TypeScript plugins. Both approaches have lots of annoyances. Maybe a weekend dedicated to ModalEdit could give me the experience I'm really after. I'm also excited for Oni Vim 2, which is a commercial product who's promise is…

Have you tried the neovim integration setting? I find that almost everything works as I would expect it to nowadays.

That only uses neovim for ex mode. Full integration of neovim requires digging into less widely used extensions such as https://github.com/asvetliakov/vscode-neovim

I found vscode macros particularly painful. Slow & where vim optimizes things. Typing abc^H^Hsdf will seamlessly play out as asdf, but with vscodevim I have to watch the macro repeat my mistake each time

Re: Show HN: Build your own Vim emulation for VS Code

#13

Why use VSCode at all then? I've found coc.nvim and language servers to be every bit as good as VSCode in terms of code completion and definitions. I'm mostly writing Go, C, Javascript, and HTML/CSS. But, so far it's been working great. And, I'm a fairly recent convert to vim (neovim).

For those that are unaware, it’s literally the same system underneath. Vscode talks to language servers to do all the work and they’ve architected the system in such a way that others can talk to them too. Coc.vim provides the plumbing to do that from vim. It’s a great project. Took me a while to get things configured properly but it’s been great for doing all my typescript work.

Re: Show HN: Build your own Vim emulation for VS Code

#14
post #6

Vim's power doesn't come from using single-letter commands to do things but, rather, in the language-like (action, verb, noun) expressions the whole ecosystem enables: "daw" to delete a word, "cit" to replace the "inner" part of a tag and start typing, numbered prefixes to execute an action that number of times, etc. See also: https://stackoverflow.com/questions/1218390/what-is-your-mos... aka "Your problem with Vim…

OP here. I completely agree with that. The goal of ModalEdit is not to emulate those verb-noun commands. VS Code's commands operate on selections, so it is very cumbersome to turn them to work in Vim way. Instead, you should try to mimick something like [Kakoune][1] which is another modal editor that uses the selection as command target.

I'm sure ModalEdit doesn't tempt any hardcore Vim users to use VS Code. But there are a lot of VS Code user's who have used Vim and like idea of modal editing. Having an extension that you can configure from ground up is the value proposition I was aiming for; not to make a poor man's Vim clone.

[1]: https://kakoune.org/why-kakoune/why-kakoune.html

Re: Show HN: Build your own Vim emulation for VS Code

#15
post #12
post #4

Earlier quoted context omitted.

Have you tried the neovim integration setting? I find that almost everything works as I would expect it to nowadays.

That only uses neovim for ex mode. Full integration of neovim requires digging into less widely used extensions such as https://github.com/asvetliakov/vscode-neovim I found vscode macros particularly painful. Slow & where vim optimizes things. Typing abc^H^Hsdf will seamlessly play out as asdf, but with vscodevim I have to watch the macro repeat my mistake each time

I have used this extension a bit and it works great as far as I can tell. Whereas with the older popular VS Code vim extension, I would get broken behaviour within minutes of use. And I am not a particularly proficient vim user, this would have just been navigating, using visual mode a bit, correcting some stuff.

Re: Show HN: Build your own Vim emulation for VS Code

#16
post #8
post #4

Earlier quoted context omitted.

Have you tried the neovim integration setting? I find that almost everything works as I would expect it to nowadays.

this one or something else? https://marketplace.visualstudio.com/items?itemName=asvetlia... I've been waiting for someone to make that work before diving into vscode and if it's solid looks like I have my weekend project.

The vscode-vim extension has an option to use neovim for ex mode commands

Re: Show HN: Build your own Vim emulation for VS Code

#17
It's disappointing to see from comments here that there's no true and performant Vim integration for VS Code.

It used to be the same thing with Eclipse and JetBrain's IDEs. Whatever Vim plugins existed were slow and falling into the uncanny valley, where they lacked support for many features or did things in slightly unexpected ways.

Torn between Vim and effectively Vimless IDEs, I chose to stick to the former and do what's possible to bring an IDE-like experience via plugins, though you still miss out on a lot in my experience, and any feature you want in Vim requires a lot more learning and configuring.

The promise of NeoVim was to provide true and complete Vim behavior in IDEs via its headless network protocol; but the indication here is it still hasn't happened.

Re: Show HN: Build your own Vim emulation for VS Code

#18

It's disappointing to see from comments here that there's no true and performant Vim integration for VS Code. It used to be the same thing with Eclipse and JetBrain's IDEs. Whatever Vim plugins existed were slow and falling into the uncanny valley, where they lacked support for many features or did things in slightly unexpected ways. Torn between Vim and effectively Vimless IDEs, I chose to stick to the former and do…

It's here https://github.com/asvetliakov/vscode-neovim

Re: Show HN: Build your own Vim emulation for VS Code

#19

Why use VSCode at all then? I've found coc.nvim and language servers to be every bit as good as VSCode in terms of code completion and definitions. I'm mostly writing Go, C, Javascript, and HTML/CSS. But, so far it's been working great. And, I'm a fairly recent convert to vim (neovim).

The only thing which makes me not switch from VSCode to Vim is the debugger (specifically Node.js). I haven't found anything in Vim to make debugging pleasent. I hope there will be an easy to use Debug Adapter Protocol frontend impementation for Vim.

Re: Show HN: Build your own Vim emulation for VS Code

#20
post #4
post #2

This is an interesting approach. I find the popular vim emulation extension (vscodevim) is a bit buggy and has lots of "uncanny valley" gaps. At work I use vscodevim, and at home I use vim with TypeScript plugins. Both approaches have lots of annoyances. Maybe a weekend dedicated to ModalEdit could give me the experience I'm really after. I'm also excited for Oni Vim 2, which is a commercial product who's promise is…

Have you tried the neovim integration setting? I find that almost everything works as I would expect it to nowadays.

I am using it and I am considering disabling it on a daily basis. Not only is it slow as mentioned elsewhere, it interacts poorly with other VSCode features, like automatic bracket matching, intellisense etc. I find that when recording macros, I have to be very careful to consider what the vim part might think just happened and try and work around it.

But every time I disable it, I immediately miss normal mode. So yeah, as happy as I am with VSCode (which is a lot), the situation is suboptimal.

Post reply on HN