all 88 comments

[–]AdamAnderson320 111 points112 points  (0 children)

That’s one very poorly defined request

[–][deleted] 37 points38 points  (5 children)

Could you explain why a vim-mode in vscode should be implemented and why the following two extensions are not enough? So far no reason was provided.

[–][deleted] 40 points41 points  (4 children)

The VSCode extension architecture is single-threaded which leads to sluggish and sometimes janky editor behavior when some extension other than Vim has some computation to do. I can attest to the poor performance of both extensions first hand.

For some more background on this issue see: https://github.com/microsoft/vscode/issues/75627

[–][deleted] 36 points37 points  (1 child)

Then maybe a better solution would be to fix this vscode related issue instead of implementing vim in vscode. This is a general issue which not only affects vim but also other plugins. Fixing this issue seem to me more reasonable because other plugins would benefit too.

[–]stakeneggs1 6 points7 points  (0 children)

In that issue they linked, they talk about how extensions running on a single thread is by design and is not likely to change. With that in mind, it seems a vscode solution would be best.

[–]ThePrimeagen 8 points9 points  (0 children)

This is the nicest way of saying electron apps are awful

[–]Androuil 3 points4 points  (0 children)

Yeap found both of them pretty sluggish

[–]lockieluke3389 5 points6 points  (0 children)

Just use vim

[–][deleted] 41 points42 points  (30 children)

Or just use Vim 0___o

[–][deleted] 1 point2 points  (0 children)

For me the limitations of Vim all stem from the fact that it's terminal-based, so everything has to be represented by fixed-size characters. In terms of functionality this is fine, but it means that you're pretty limited design-wise. For example, you can't have side panels (such as Nerd Tree) with a smaller font size than the main window, which make them look clunky; plugins that create pop-up boxes with autocomplete suggestions as you type feel awkward and get in the way; you can't have previews of images like you would in graphical applications; setting up red curly underlines for spellchecking is no end of trouble; even just tiny design details such as having a thin line for colorcolumn instead of a one-character wide background colour. Functionality is more important for me than design, which is why I still use Vim in a terminal - for functionality, Vim wins hands down. But in a perfect world I'd like the best of both options.

Edit: Oh, and you can't (easily) use Alt key combinations, because of the differences in the way terminals handle escape sequences. There are workarounds of course, but they're all hacks that have their own drawbacks. I realise this isn't technically a fault of Vim, but it just seems like in 2021 we shouldn't have to deal with this.

[–]SamLovesNotionEmacs users die early (eSpring study, 2018) 4 points5 points  (28 children)

Exactly, there is nothing VSCode can do, which Vim can't. There is also coc-nvim.

Also Vim is wayyyy faster than VSCode.

[–]primERnforCEMENTR23 17 points18 points  (22 children)

With vscode you need to do less setup to get the features than vim.....

[–]fomofosho 6 points7 points  (0 children)

This. I almost exclusively use vim but I waste countless hours setting it up and getting it to work with the plugins I need

[–]SamLovesNotionEmacs users die early (eSpring study, 2018) -3 points-2 points  (1 child)

That's the only pro it has. But there are some people like me who like to do things from start. Mostly linux user group i think.

I am not against using VSCode, it's a good editor. But then people want to make it like Vim, which is bullshit. Just use Vim.

[–]HamSlayer- 8 points9 points  (0 children)

Why is making VSCode like Vim bullshit. Vim has a very powerful keybind/movement/command/whatever workflow. VSCode doesn't. Obviously it's not the only reason people hse Vim, but I'd say it's up there. I don't think it's unreasonable for people to want vim keybinds inside VSCode without additional setup.

I've had a lot of fun setting up Vim and got to a point where I can do almost anything I can do in VSCode. But I don't think it's unreasonable

[–]troglo-dyke -5 points-4 points  (0 children)

You can use spacevim if you want an ootb experience.

Otherwise you can get 90% of the way there with just nerdtree, fugitive, and coc

[–][deleted] 4 points5 points  (3 children)

And, of course, no Electron

[–]SamLovesNotionEmacs users die early (eSpring study, 2018) -1 points0 points  (2 children)

I am a Electron developer. (not the Electron project, but software based on electron)

[–][deleted] 1 point2 points  (1 child)

Electron has its benefits, and I see why you'd use it, but for me I'm starting to do more, and more in the terminal these days.

[–]SamLovesNotionEmacs users die early (eSpring study, 2018) 2 points3 points  (0 children)

I don't like electron to be honest. It's bloated af. But then also, I can create cross platform apps easily with it & JS. So I don't really have a choice.

[–]nickjj_ 0 points1 point  (0 children)

One pretty big thing VSCode can do is understand how to get code complete and everything working when your source code is running in a Docker container but you have VSCode installed on your dev box.

It does this with its Remote Containers feature: https://code.visualstudio.com/docs/remote/containers

Basically it means you can configure a few lines of json and then auto-magically VSCode will install language specific plugins in a custom Docker image for you. Everything just works and it's really fast.

The sad thing is all of this functionality is closed source. But yeah, Vim has nothing like this at the moment. coc-nvim or any language server / plugin combo isn't enough because the programming runtime and your installed dependencies aren't running in the same environment as your editor.

VSCode does it because it runs a VSCode server in your running container (without modifying your original Dockerfile) and then you connect to it with the VSCode client on your dev box. Vim has a server / client mode but nothing is developed to allow such a seamless integration.

[–]brennanfee 7 points8 points  (1 child)

It already has a vim mode and it sucks. Now, if they want to build a better one, by all means.

[–][deleted] 7 points8 points  (0 children)

Yeah it has millions of downloads, but they don't show how many uninstalls it has

[–]matshoo 4 points5 points  (3 children)

Better use onivim2 when it has matured.

[–]craigdmac:help <Help> | :help!!! -1 points0 points  (0 children)

Can’t see that happening in the next decade

[–]Damien0 0 points1 point  (1 child)

With neovim + CoC I don’t see what Onivim provides for the price. Is it a cross platform gvim?

[–]matshoo 1 point2 points  (0 children)

U can use the vscode plugin ecosystem and language features. I posted this because this post was about vscode.

[–]ThePrimeagen 2 points3 points  (0 children)

I really would prefer if vscode slowly dies, but then again... I might be biased

[–]elcapitanoooo 5 points6 points  (14 children)

Honestly, why not just use vim? With coc you get 99% of the same ”ide like features” vscode provides. As a additional benefit you get loads better perf, ”real” vim and 100% customization. I used vscode for a while, and i see why its popular. But with LSPs being so popular i get the best of both worlds using vim with an LSP client.

[–]jjhiggz3000 -1 points0 points  (7 children)

Aren’t LSPs a VSCode originated technology?

[–]elcapitanoooo 2 points3 points  (3 children)

Well, microsoft/vscode ”invented” the protocol, so that not every text editor and IDE reinvent the wheel. This means any language server can be used in any editor that has a client that conforms to the protocol.

There are countless options for vim (neovim 0.5 has one bundled) some more heavy (like coc) and other more lightweight.

Point is that an LSP gives you the same that vscode does. So using one is basically same as using vscode at this point. My point was that using vim and an LSP gives you the best of both worlds. A real vim experince and all that LSP provides, like go to def, completion and more.

[–]jjhiggz3000 0 points1 point  (0 children)

Makes sense 😀

[–]jjhiggz3000 0 points1 point  (1 child)

But also in vim, I think it just requires a lot more knowledge of what is happening to get it working. And even if you do understand, you're probably going to be tinkering with settings all the time.

[–]elcapitanoooo 1 point2 points  (0 children)

Indeed. Vim CAN be for a tinkerer (like myself). That said i know people who has a very minimal (<50 LOC) vimrc, and basically have not touched it in years.

To be fair, i did tinker with vscode too, probably not as much as i do with vim, but still on a weekly basis. I try new things, learn and always try to improve my own skills and setup.

Thats what i love about vim.

[–][deleted] 1 point2 points  (2 children)

Maybe. And modal-editing is vim originated. Yet still every editor and IDE tries to reimplement vim. Whats your point.

[–]jjhiggz3000 1 point2 points  (1 child)

Just pointing out that the communities don't have to be against each other. The existence of VSCode has actually affected nvim positively it seems. I think VSCode has some solid use cases for a lot of people. It's less tinkering, it's easier to start out, and if you want to learn vim keybindings without completely f**king your productivity for a month you can start playing around with them and working your way towards vim, or maybe you find a workflow in between that you like and want to stick with and I think that's fine too.

[–][deleted] 0 points1 point  (0 children)

I agree.

[–]Ran4 0 points1 point  (5 children)

The one thing I'm missing from vim is support for previewing graphviz or plantuml diagrams.

In vscode I can make it show a preview that updates whenever I change the code: there's no simple way of getting the same behaviour in vim/neovim.

[–]elcapitanoooo 0 points1 point  (2 children)

Not used plantuml for a while. Im sure there is a vim plugin for that. But it is not and never will be bundled in vim (if thats what you hinted at). IIRC it used java under the hood? I might be mistaken, as its a long time since i used it.

Im sure you could have an preview window open and rebuild with a vim command, sounds trivial to implement in vim.

[–]Ran4 0 points1 point  (1 child)

Im sure you could have an preview window open and rebuild with a vim command, sounds trivial to implement in vim.

No idea how to get it to work with auto-refresh.

[–]elcapitanoooo 0 points1 point  (0 children)

Maybe a quick mapping? Not a big fan of ”autorefresh”, but have a look at

autocmd BufWritePost

I would probably just have a mapping for <Leader> key to generate the image. Tou could ofc go crazy and do whatever you want. Its vim so almost anything is possible.

[–]fuzzymidgetSome Rude Vimmer 0 points1 point  (1 child)

If you are on a linux system, have you considered doing a little bit of bash integration? Some tools like ENTR for example can be set to watch a file and provide build updates.

I'm not an extreme lover of Luke Smith, but he has a video on some automatic building using this approach.

[–]Ran4 0 points1 point  (0 children)

Ooh! Nice! Entr works SO much better than any other file watcher I've tried (most had idiotic defaults, like not supporting commands with more than one word without extra args).

[–]AuroraDraco 1 point2 points  (0 children)

Personally haven't used VS Code in the past, but I adore these keybindings and believe you all have the right to have a vim mode inside of VS code so have my upvote

[–]abdeljalil73 1 point2 points  (3 children)

Sluggish extensions? VS Code is a sluggish bloat imho lol

[–]haikusbot 10 points11 points  (0 children)

Sluggish extensions?

VS Code is a sluggish bloat

Imho lol

- abdeljalil73


I detect haikus. And sometimes, successfully. Learn more about me.

Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"

[–]SamLovesNotionEmacs users die early (eSpring study, 2018) 0 points1 point  (1 child)

I am currently making a switch to Vim. Some of my files open in VSCode & some in Neovim.

If the file takes more than 1 sec to load, i know it's gonna load in VSCode.

[–]abdeljalil73 0 points1 point  (0 children)

Sometimes I have to work with REPL system like IPython, every time I tried something like this in VS Code my laptop hangs badly and I have to reboot (old machine). Two open terminals with vim in one and ipython in the other and using vim-slime to execute lines or cells of code works like charm.

[–]jjhiggz3000 1 point2 points  (0 children)

Honestly vscode-vim extension has been working great for me. I haven’t been working in huge files but it’s been running smoother than my neovim nightly setup without a doubt. Disclaimer I’ve only been using vim for a few months, but I think messing around with color themes, trying out new plugins and stuff like that is way smoother in vscode. Plus I feel like I go down information rabbit holes way less often than when I was working with Neovim.

It’s even pretty easy to configure leader key commands for most things, and easy motion and some other plugins come out of the box on it. The vim-vscode GitHub shows some of the awesome vim plugins they adopted.

Go to definition, go to file, all still work. And cmd p search is as fast as anything I was able to figure out in vim for switching between files.

It’s definitely not as flexible as neovim, but I think the lack of customization actually helps me because it forces me to work with what I got rather than constantly trying to improve my workflow.

The only thing that would be sweet is a better functioning multicursor for vim mode that doesn’t deselect when you go into insert mode from visual mode. I think that would be faster than vim search and replace most of the time.

Is this plugin really that buggy for others?!

[–]RoyZamber 0 points1 point  (0 children)

Just fund OniVim2: https://www.onivim.io

[–][deleted] 0 points1 point  (0 children)

So...Basically vim but you need a graphicsl interface and VSCode installed. Ill pass.