DEV Community

loading...

I'm switching to vim!

Siddharth
13. Coding for a hobby
・1 min read

I just took a short look at the (neo)vim docs, and I'm officially moving to (neo)vim (and tmux)! I have just used it for a few days, but I really can feel the power it gives me. Not to mention that it really saves my 6GB ram for other uses.

A snapshot of my coding session

And I encourage all of you to do the same. It really is super faster (I come from vscode, and it is really faster). Vim has everything you need – Syntax highlighting, Split screen, File explorers(!), Autocomplete(!), Tabs, Folding lines(!), Indentation autofixing(!), macros, line bookmarks, integrated terminal like interface and what not (I should make an article on it soon). Vim is basically equivalent to VSCode for me.

Discussion (142)

Collapse
turutupa profile image
Turutupa • Edited

It's great that you changed to vim, seems very exciting! It would be cool if you could explain the process on how you changed to vim. Personally I use VSCode with vim extension for keyboard shortcuts. And I think it would be really cool to move fully to vim, but it's hard... first problem is file navigation. VSCode makes it so easy to open up files using ctrl/command + p. There might be some other stuff that I'd miss from VSCode when moving to vim but file navigation is my road blocker I guess.

How did you overcome that?

Collapse
siddharthshyniben profile image
Siddharth Author

The process how I switched to vim? I don't get it. I just installed vim and started using it. No plugins installed yet

About file navigation, there is a builtin file explorer. Just cd to the parent folder, open vim, and run the :Explore command (I guess you know what the :commands)

You get something like this:

Image

Collapse
turutupa profile image
Turutupa

That actually answered my doubts. So no plugins for file navigation, explorer & buffers as well I suppose. Thanks!

Thread Thread
siddharthshyniben profile image
Siddharth Author

You rarely need plugins. Most of the stuff is built in.

Thread Thread
mafflerbach profile image
mafflerbach

But there are plugins for vim as well.
Eg. for filenavigation (with a tree is nerdtree) but netrw (:Explorer) has as well a tree view ( cycling with i between the views)

For fuzzy search over files vim-fzf, i think it handles the open buffers as well, but if not - there is defnitly a plugin for it somewhere....

Thread Thread
siddharthshyniben profile image
Siddharth Author

Yeah there are a lot of plugins.

I'm having some trouble installing plugins, especially because I'm using neovim which is a bit different.

Thread Thread
aghost7 profile image
Jonathan Boudreau

vim-plug should be roughly the same on neovim and vim. Been using it for several years, can recommend.

Thread Thread
siddharthshyniben profile image
Siddharth Author

Hmm, but I'm having trouble installing it on my outdated machine

Thread Thread
aghost7 profile image
Jonathan Boudreau

What is the error you're getting?

Thread Thread
siddharthshyniben profile image
Siddharth Author

Fixed it now, used vim-plug instead of vundle

Thread Thread
aghost7 profile image
Jonathan Boudreau

Nice work, all the best.

Collapse
vinodnimbalkar profile image
Vinod Nimbalkar

If you are planning to use neovim version 0.5+ then try github.com/nvim-telescope/telescop..., Its cool.😎

Thread Thread
siddharthshyniben profile image
Siddharth Author

I don't think I'll have such deep filesystems... I might try it once i get back to angular

Thread Thread
turutupa profile image
Turutupa

wow, that is a cool plugin

Thread Thread
ludamillion profile image
Luke Inglis

It's an absolute beast. And I mean that in the best way. Pairing that with NeoVim 0.5+'s built in LSP features and you have a lot of VSCode's ground covered.

Collapse
navhalarjun profile image
Arjun Navhal

It's rekated to putty

Collapse
brandonwallace profile image
brandon_wallace

Turutupa, You can use a popular plugin called NERDTree for file navigation. You can also use FZF. I have both installed because they work differently. NERDTree is good when you know where your file is. FZF is good when you know part of the file name.

Vim is highly configurable, I but you can get anything that works in VSCode to work in Vim. Check out this article:

Vimrc Configuration Guide - How to Customize Your Vim Code Editor with Mappings, Vimscript, Status Line, and More

freecodecamp.org/news/vimrc-config...

Collapse
siddharthshyniben profile image
Siddharth Author

Thanks for the tip!

Collapse
turutupa profile image
Turutupa

By the comments I've seen so far and what I have seen lately related to vim file navigation, I think a good combination would be

  • fzf
  • nerdtree
  • harpoon

Gotta try it. Cheers for the help!

Collapse
felixfong227 profile image
Felix Fong • Edited

πŸ‘‹ I have been using VSCode with Vim extensions for a good couple of years now, and I have been successfully and happily switch to full Vim(neo) for the pass 5+ months . And to my surprise that VSC and Vim can be quite similar with little to no config at all πŸŽ‰

And as for file navigation with ctl/cmd + p, there is a vim extension call Ctrlp github.com/kien/ctrlp.vim

Hope it helps πŸ˜„

Collapse
turutupa profile image
Turutupa

Nice, I'll check it out. I just feel like without a fast an easy way of switching between files it's a no go for me. This one seems like a good one though, thx for sharing :)

Thread Thread
ludamillion profile image
Luke Inglis

Something a lot of new Vim users don't know about is the c-^ mapping which allows you to jump back and forth between the two most recently visited buffers. Added bonus the most recent buffers are local to windows/splits.

Thread Thread
felixfong227 profile image
Felix Fong

I believe in VSC’ Vim it’s mapped to the ctl+i keybindπŸ€”

Thread Thread
turutupa profile image
Turutupa

didn't know about c-^ ! that's a good one, thanks!

Collapse
sakethkowtha profile image
sakethk

There is plugin called Telescope u can try that. U will like it

github.com/nvim-telescope/telescop...

Thread Thread
moopet profile image
Ben Sinclair

That's only for neovim, though. Other plugins like vim-fzf will work on regular vim too and give you a lot of the same functionality.

Collapse
klvenky profile image
Venkatesh KL • Edited

I've tried to convert to vim atleast thrice & had to falllback as I've different requirements compared to others (atleast I think so). I work with/modify multiple projects at a time as I work heavily on microservices built in an event driven system. So I really never have any memory of the function previously written nor the code.

I'll tell you what I expect from my editor (vscode now)
1) quick navigation(ctrl+p) - solved it using fzf/ctrl-p
2) quick search (ctrl+ shift+f) - hard to get around this
3) find function/variable by name(ctrl+t -> not that great but still does decent work. I'd prefer intellij's double shift, but it's an IDE so different story altogether) - didn't last till this point
4) easier to configure language support(vim-polyglot does well here but I'd like little less config)
5) sensible defaults(neovim does this I think)
6) easy navigation to error like from terminal
7) Goto definition - my biggest problem, I couldn't find something that'll work well for multiple languages. Coc.vim has some awesome support as per multiple articles but I couldn't find a single place to configure as it has a separate config file so it's a little tricky for me to manage.
8) find all references - I think vscode nails it. I know I could do a search/grep for text but I'd ideally have similar variables in same file as I do a lot of ETL/ELT.
9) simpler Emmet support - I did try installing the plug-in but could make it easy to go with.
10) snippet manager - I don't use snippets heavily but it's a nice to have feature

I'd love to know if there are better solutions for these issues which should make me switch to vim.

I did try using vscode vim but I work a lot in zenmode so search goes for a toss here as the activity bar gets hidden.

Collapse
turutupa profile image
Turutupa

Hey man, you got very valid points and I must admit I didn't realize how much stuff I needed till I tried moving from VSCode to vim. Fortunately a lot of people replied to my comment and I have learnt a lot of good stuff in the past week.

I cloned Lunarvim (neovim based) which comes packed with a bunch of plugins and it does cover a lot of the stuff you mentioned. I've seen there are other known configs such as Lvim and Gleipnir, but I can't say which one is better or the differences between one and another.

I'll respond to some of the points you mentioned in case it helps you out.

1 - this is nicely done with Telescope
2 - still learning how to do this, but to be honest I don't think I'll need it so much anymore as I can search for references with Lsp saga (i think that's the name) or I believe you can use built-in vim funcionality by pressing gd
Points 3,7 and 8 slightly similar to this
(link to lsp saga: github.com/glepnir/lspsaga.nvim )

4- language support is a pain in the ass, luckily lunarvim also covers it

I do enjoy a lot working with VSCode + vim plugin though and I 100% understand why you'd stick with VSCode.

Thanks for sharing your experience!

Thread Thread
klvenky profile image
Venkatesh KL

Thanks I'll checkout the resources mentioned. All the best to all

Collapse
yoann9344 profile image
Yoann Guillard • Edited

2/ is a simple git grep could make the job ?
3/6/7/8/ I think it depends on the quality of your LSP, I'm happy of Ale : bind AleGoToDefinition ; AleFindReference ; github.com/dense-analysis/ale#5xi-...
Then just configure your preferred LSP for each language you use.
9/ I never get bothered by Emmet, so I don't get your concern (except on vscode)
10/ I think ultisnippet is nice, I have to check my config

Thread Thread
klvenky profile image
Venkatesh KL

I will have to spend some time figuring that out then. I am not one of those super person's who become productive within a week. May be I need to figure it out.

I am not that great with color schemes & all so I would like some nice color scheme recommendations as well.

Thread Thread
siddharthshyniben profile image
Siddharth Author

There are a lot of built in ones. Try desert.

Thread Thread
klvenky profile image
Venkatesh KL

Sure I'll check it out. Thanks

Thread Thread
yoann9344 profile image
Yoann Guillard

I'm starting to remake and clean my full config, 'cause I would like to switch to nvim. So I can share my dot config, once it will be done.

Collapse
gosukiwi profile image
Federico Ramirez • Edited

There are lots of plugins you can use for finding files. The most popular right now is fzf, give it a shot, I'm sure it can beat your VSCode workflow in a few days of customization/learning :P

I personally use ctrlp + ripgrep

Collapse
turutupa profile image
Turutupa

oh man... I thought it would never be possible to fully move to vim... but someone shared me lunarvim (github.com/ChristianChiarulli/Luna...) which comes with telescope and it is a beast

Thread Thread
gosukiwi profile image
Federico Ramirez

Prebuilt configurations are great for getting started. Once you are used to it, maybe after a few years, consider trying to customize it and remove what you don't need/want. Read the documentation and learn if there's a way you can replace a plugin with just native Vim functionality. And eventually, try writing your own config from scratch. That's where Vim shines. But it's not an easy process ^^;

Thread Thread
turutupa profile image
Turutupa

Totally agree. Some people suggest to start from scratch your own config, but I feel like it has been a way better introduction to vim using pre-built configs than having to create one myself without understanding a thing. At least now I have a decent notion from the time I've spent setting up lunarvim + tweaking some stuff to accommodate to my needs.

Collapse
yoann9344 profile image
Yoann Guillard

The most underestimated vim's functionality that we should teach to beginners is vim session, allowing to save your session like any IDE !
stackoverflow.com/questions/164261...

Collapse
turutupa profile image
Turutupa

Hey Yoann, how do you use vim sessions? And I don't mean like what commands you use or anything like that. More like, how you use vim sessions in your workflow?

Thread Thread
yoann9344 profile image
Yoann Guillard

I just use it simply, I have quickly a lot of tabs opened, so when I have to change the project on which I'm working or when I shutdown then I save the session at the root of the project. But it could be interesting to save it automatically, once I screwed and killed the vim process and I lost a dozen of open tabs and the workflow that went with it ^^'

Rarely, I work on more than one functionality at the same time, then I use and save 2 sessions in the same project.

Collapse
jdeepd profile image
Nova_Striker • Edited

Checkout NerdTree plugin . I use a combination of fzf and nerdtree to navigate and its blazinglyfast compared to mouse switching. Combine all of them with a multiplex terminal like kitty or tmux, you are now a rocket.

Edit : Also, dont forget about vifm

Collapse
turutupa profile image
Turutupa

I see that combination working for me. What I don't fully see is what it has to offer that VSCode + vim extension already offers. I also have ctrl + p to open files fast in VSCode. Plus configuration is way easier in VSCode, for example, one thing I really like in VSCode is being able to set line height so code isn't so cramped together.

Another annoying one is syntax highlighting. Last time I used vim it wouldn't recognize React + Typescript (tsx), so then I have to spend a bunch of time just to be able to have that working :/

My feeling is to stay with VSCode and use vim for fast editing.

thanks for adding vifm, didn't know that one

Thread Thread
jdeepd profile image
Nova_Striker

Ya , for a web developer, VS Code Vim is probably the best because the default Vim has some problems with formatting and indenting HTML and CSS. You can get it to work exactly as VSC but it will take a lot of time in configuring it. For me, I think I have invested a lot of time in configuring Neovim to my liking πŸ˜… and plugins like Vim move , quick scope , vim wiki and doge keeps me hooked to it.

Thread Thread
turutupa profile image
Turutupa

mind sharing your config? :)

Thread Thread
jdeepd profile image
Thread Thread
turutupa profile image
Turutupa

thanks man :D

Collapse
retr0c0de profile image
Anguram Shanmugam

Watch DistroTube youtube he has a playlist on vim
or
Search for this book "Mastering Vim Quickly by Jovica Ilic"

Collapse
rebuilt profile image
rebuilt

Check out lunarvim. It's made specifically for users switching from vscode github.com/ChristianChiarulli/Luna...

Collapse
turutupa profile image
Turutupa

God. Fucking. Bless. You.

This is exactly what I have been looking for. Not so much cause it brings a similar exp to VSCode, cause it is vim, I don't expect to have the same experience. But because it is an easy out-of-the-box config. This is very important for me, cause whenever I change to a different machine I always try to keep my configs simple and easy to install. Same with tmux. I use oh-my-tmux instead of my own config so I can easily install it wherever I go. Obviously I could create my own configs, but it makes way more sense for me to use the already existing ones from people with way more experience.

Sorry for the long reply, long story short: this is awesome.

Perhaps a simpler config would have been sufficient, but I am definitely trying this out. Thanks again!

Collapse
kaushikrishi profile image
Kaushik Rishi

Hey, There is a vim plugin called ctrl.p that does the same job but much faster, also there is another package called fzf which does similar thing.

Collapse
siddharthshyniben profile image
Siddharth Author

fzf is a general purpose library to fuzzy find files. Many plugins use fzf under the hood

Collapse
gchandran profile image
Hemachandran G

Each tool has its own set of ups and downs. In the case of Text Editors, Vim is good for code maintaining i.e, where you do more updations than writing something new. But, when we are building something from the scratch, we might need more third-party support and GUI intensive workflows, that's where using Vim is not a good idea.

Collapse
gnsp profile image
Ganesh Prasad • Edited

I have built a number of things from scratch, including but not limited to, a couple of compilers, an UI library in react, few websites end to end, few web services, a number of fun side projects; I have done a number of freelance projects during my time in college too. I have never needed anything more than a terminal (guake on my Linux machine and iterm2 on my work laptop) and a browser (chrome only. I use browserstack for testing/previewing on other browsers). Vim has been an integral part of my Dev setup. It may not have all features of a modern IDE, but it's best at what it does-- text editing. For all other features that I need in my workflow, there is always a CLI tool that specialises in that. Even though I have tried multiple IDEs over the years, I found that the only useful thing that comes out-of-box with IDEs is static code analysis. This is the only thing that doesn't come with vim out-of-box, you need plugins for that. Most of the useful text editing features in modern IDEs are present in vim or covered by some plugin. Also I found that autocompletion in other IDEs feel fancier, but it's generally faster to write code without autocompletion as long as you are a decent typist and know what you're doing; also if your class, method and variable names are so verbose that autocompletion is faster than typing them out, then it's an indication that you need to reconsider the way you're naming stuff.

Collapse
siddharthshyniben profile image
Siddharth Author

Woah, you've built a lot of stuff

Collapse
aghost7 profile image
Jonathan Boudreau

What would be an example for a GUI workflow?

Collapse
siddharthshyniben profile image
Siddharth Author

What do you mean?

Collapse
siddharthshyniben profile image
Siddharth Author

Yeah, vim really is made for editing. But really most developers spend more time editing than coding - at least I do

Collapse
val_baca profile image
Valentin Baca

"But really most developers spend more time editing than coding"

huh?

Thread Thread
gchandran profile image
Hemachandran G

It depends on the situation and the environment. Let's say you are a freelancer, most probably you'll be creating different new projects. If you are working in a Company, it's highly probable that you'll be maintaining the codebase.

My conclusion is to, use the right tool for right work.

Thread Thread
siddharthshyniben profile image
Siddharth Author

I mean we usually type out our code then spend a lot of time running it, and tweaking it and debugging it right?

At least it applies to me

Thread Thread
siddharthshyniben profile image
Siddharth Author

I mean we usually type out our code then spend a lot of time running it, and tweaking it and debugging it right?

At least it applies to me

Thread Thread
val_baca profile image
Valentin Baca

Thanks. I see: I just never saw "editing" as separate from "coding" or that "coding" only meant when it was written the first time.

To me it's just all coding and all editing.

Personally, I used to be a vim power user, and I'm still glad I learned it and still use it very often. However, as my primary editor, VS Code has really taken over for me.

Compared to vim, with VS Code I've never lost a file or even a single edit, I don't have to mess with swap or backup files.

But like others have said, they're tools. They're not religions. Pick the best for the situation and there's no harm in learning something new.

You can checkout my ~/.vimrc here: github.com/valbaca/dotfiles/blob/m...

And my "virc" which is a more minimal vimrc here: github.com/valbaca/dotfiles/blob/m...

Thread Thread
siddharthshyniben profile image
Siddharth Author

Yeah the swap file thing is real. It's happened to me a few times

Collapse
hanpari profile image
Pavel Morava

I had this notion once. After a few days, I returned to VS Code obediently.

Collapse
leob profile image
leob

Right ... VIM is great, but I don't believe in the current hype about switching away from VSCode to a bare bones editor - for the record, VSCode is an editor, it's pretty lightweight and a far cry from traditional heavy IDEs like Netbeans/Eclipse and so on ... VSCode for the win :)

Collapse
siddharthshyniben profile image
Siddharth Author

I don't too πŸ˜‚. You don't have to switch if you have a good computer (not a 10 year old one like mine) which can handle VSCode or if you already use all of vscode features.

Thread Thread
leob profile image
leob • Edited

I think we agree then, mine is almost 10 years old as well but I've got 16 GB inside so why not just use that RAM ;)

Thread Thread
siddharthshyniben profile image
Siddharth Author

Mine is a 2010 MacBook which runs macOS 10.12 (I really need to upgrade). There is a computer which runs windows 10 here but I won't use it πŸ˜‚

Thread Thread
leob profile image
leob

Windoze ;) no neither would I, haha

Collapse
siddharthshyniben profile image
Siddharth Author

I'll see if that happens to me! πŸ˜…

Collapse
jdeepd profile image
Nova_Striker • Edited

Either ways, In future if you move to Vscode and want to use Vim config again, Use VSCode Neovim plugin instead of the famous VScodeVim. The reason is that VsCode Neovim uses a complete Neovim instance in the backend which means you can run Neovim plugins inside Vscode(something which the latter did not allow.)

Collapse
justintime4tea profile image
Justin Gross

Welcome to the fold!

I made the switch from VS Code a couple weeks ago ( took ~2-3 days to adjust) and am now at feature parody with the features I was using in VS Code.

For me it wasn't so much about optimizing resource consumption but rather having a portable easy and quickly reproducible dev env setup that I could connect to from anywhere. It is nice to save gigabytes of RAM though :)

I switch between computers a lot and had been using SSH Remote plugin to do all my work in a remote Linux setup. Combining TMUX persistent sessions, neovim and vim sessions means I can connect from anything/anywhere and it's all ready to rock and roll all the time! It even works well connecting to my dev env from an Android device using TERMUX! With a nice portable keyboard I could totally do all my work from a silly little Android tablet or Chromebook.

I started with the coc plugins but then quickly jumped to nightly neovim + native lsp. Primarily writing Rust applications but also have had great success with typescript and Vue/nuxt application development. If anyone is stuck getting something set up or has questions on how you might do something in neovim that you were previously doing in Code please ask me here and I'll share any feedback that I can!

Collapse
siddharthshyniben profile image
Siddharth Author

Thanks! I'll ask you if anything comes up.

Collapse
leob profile image
leob

Your mean your VSCode is using SIX GIGABYTES of memory? I don't know but I guess you might be doing something wrong ...

Anyway, while I'm also a fan of VIM and use it frequently besides VSCode, there's no way I'm going to do away with my VSCode just to save a few bytes of RAM - I think VSCode is well worth the memory it consumes ... and VIM is also great, they make a great pair.

Collapse
siddharthshyniben profile image
Siddharth Author • Edited

Nope VSCode is not using 6gb. I have a total of 6gb and vscode uses a huge chunk of it. Throw in Chrome and you have problems

Another thing is I don't really use all the features of vscode, so I really thought vim would be nice

Collapse
leob profile image
leob

Okay that makes sense ...

Collapse
khajin1 profile image
evalPenny • Edited

Vim is pretty great. But, the UI is pretty ugly and it's pretty difficult to use (at least for me).

Note: I usually use Atom for small project (since Atom is pretty slow for large project), Visual Studio Code for debugging, and Sublime Text for large project.

Collapse
brandonwallace profile image
brandon_wallace • Edited

If you consider the UI to be ugly add a color scheme. There are a ton of them available. One popular color scheme is called Molokai. This repository, all by itself, has 128 color schemes available!!

github.com/chriskempson/base16-vim...

Just copy all the *.vim color schemes into your ~/.vim/colors/ directory. Try the color schemes in Gvim and Vim to see how they look. Also you can add a custom font like Hack font or a font you have installed on your system .

Collapse
vinodnimbalkar profile image
Vinod Nimbalkar

Yes, I agree but initially, Vim or Neovim is more like DIY stuff. You've to try things that are better for you and create a unique configuration (dotfiles). It's unique version of yourself.
check out this UI - github.com/siduck76/NvChad

Collapse
siddharthshyniben profile image
Siddharth Author

For me, I just don't use the tools it provides too much. But it's not that ugly for me, especially because I have made TUIs and also my font does a great job at ligatures

Collapse
khajin1 profile image
evalPenny • Edited

@siddharthshyniben , Just for the record, I stopped using Sublime Text.

Thread Thread
khajin1 profile image
evalPenny

@siddharthshyniben , I decided to use Neovim.

Collapse
mafflerbach profile image
mafflerbach • Edited

I see quite often in the comment "here you can use my dotfiels, vimrc etc" At this point i would recoment to take a peak in the conf, but not blindly use them, I dont linke spaceVim either. I ve added plugins, when i needed it, and not because they sound maybe usefull. If I noticed i use features often, but have to type much i create a mapping for it.
eg:

" ripgrep for the current word/WORD under cursor  
noremap <leader>a :Rg <C-r>=expand('<cword>') <CR>
noremap <leader>A :Rg <C-r>=expand('<CWORD>') <CR>

" yank in WORD into register a s or q
map <leader>1 "ayiW
map <leader>2 "syiW
map <leader>3 "qyiW

" using resgister a and s for search and replace
map <leader>rp :%s/<C-R>a/<C-R>s/g
Enter fullscreen mode Exit fullscreen mode

also strg+f in comand node is very helpfull, if you want to alter a command from the history or th ecurrent one.

You workflow has to develop and will change over the time as well you vimrc will. I compare the vimrc to underware. Its your underware, which fits to you, and you don't realy want, that somebody else shit in it.

Collapse
elvisoric profile image
Elvis Oric • Edited

When using nvim, you can create terminal buffer with :terminal command

Collapse
mr_destructive profile image
Meet Gor

save time, just

:term

will work ;)

Collapse
siddharthshyniben profile image
Siddharth Author

Nice tip!

Collapse
taufik_nurrohman profile image
Taufik Nurrohman

Welcome to the club!

I am using Vim and try to make it to look like an IDE by installing NERDTree etc. FYI, Vim 8.x already has built-in plugin system. So, no need plugin manager at all if you don’t care much about the plugin updates.

Here’s my .vimrc

Collapse
phantas0s profile image
Matthieu Cneude • Edited

You won't regret it.

I'm writing a series of article to learn Vim if you're interested.

I've also written an entire book how to build a mouseless development environment with the shell as the central part. I explain in details how to configure Arch Linux, i3, tmux, Neovim, and Zsh altogether for building a coherent whole. It changed my life as a developer years ago.

Hope it helps!

Collapse
siddharthshyniben profile image
Siddharth Author

Nice! I'll check out the book sometime

Collapse
samuelabreu profile image
Samuel Abreu

I'm using neovim for almost 2 years now, and my advice is, don't try to replace one for another, chance is you get disappointed. Same for emacs.

Start using for small tasks (like quick edits or specific tasks like json files), and improve your config files as needed.

If you still have the urge to use more, research for plugins for specific needs, for development Coc is really good for beginners.

Collapse
siddharthshyniben profile image
Siddharth Author

I'm thinking of first writing the code in VSCode and then doing all other edits and debugging in vim

Collapse
gnsp profile image
Ganesh Prasad

The learning curve is steep. But it's worth the effort, vim makes editing code much efficient. You'll have to find the right plugins for your needs though.

I have been using vim since 2012, I have tried a number of other modern text editors over the years, but haven't found anything as efficient as vim.

Collapse
javierromario profile image
π•π•’π•§π•šπ•–π•£ β„π• π•žπ•’π•£π•šπ• 

I have been using this awesome opinionated init file to help make the transition smooth, includes a load of plugins and some sensible keybindings to make it feel like a first class citizen on your computer
Be sure to checkout the readme!

github.com/Blacksuan19/init.nvim

Collapse
siddharthshyniben profile image
Siddharth Author

Thanks! I use the default nvim config for now

Collapse
klvenky profile image
Venkatesh KL

Hey all,

I've just seen that neovim 0.5 is now released(4 days back). We can try out the LSP quite easiy as per the docs.

People who are not interested in nightly versions(like me, atleast for vim) can go & give it a shot.

Collapse
darthbob88 profile image
Raymond Price

I used gvim for a while back in college, and still use it a little bit because it's the default editor in my git config. The problem I always have is that, in the time it takes me to learn its shortcuts and add the plugins I need, I could have learned an actual language.

Collapse
siddharthshyniben profile image
Siddharth Author

Speaking of git config, I gotta change my default editor. Thanks for the (unintentional) heads up!

Collapse
lepinekong profile image
lepinekong

problem is all tutorials suck I haven't found one single one that suits me ;)

Collapse
siddharthshyniben profile image
Siddharth Author

I could try to write one. Beginners are better at explaining beginner stuff

Key word: try.

Collapse
lepinekong profile image
lepinekong

already tried and gave up :)

Collapse
hulakdar profile image
Simon Kamoza

Ok, text editing using vim is my favorite time of the day
But how about debugging? Go to definition?

Collapse
mafflerbach profile image
mafflerbach

for (n)vim is vimspector and vim-dap. vimspector is quite good, but i dont have experience with dap.

For general heavy IDE stuff - take a look in coc-vim this thing supports a lots of stuff like quickfix, go to definition/reference, show docs, and some other codeactions. This extension supports most of the features which a lsp is providing.

But here its maybe worth it to take a look in to the nvim lsp feature which should cover the same stuff.

But vim ist still just only a text editor. The learning curve is high, and most of the time you will at least pay with your time to adapt, and have maybe script addiotional stuff, that it can support your workflow. (like trigger your builds, tests or debug session with a shortkey)

Collapse
siddharthshyniben profile image
Siddharth Author

I actually don't use my IDE for debugging. So I'll never know the difference, I guess?

I actually don't use most of my IDE, so I'm really comfortable with this transition.

Collapse
alexisfinn profile image
AlexisFinn

just BTW, in case someone is wondering, the number one reason Vim makes you faster and feels better is that it forces you to learn touch-typing and to rely on keyboard shortcuts.

But the truth is (and I love vim mind you) if you learned/remapped your keyboard shortcuts on pretty much any other editor, you'd attain the same efficiency. Just as a tiling window manager will make a standard desktop environment feel cumbersome because you have to use the mouse, but that's not true, you just haven't bothered to learn and optimise the shortcuts on a full-fledged DE like Gnome or KDE, but they can be just has efficient.

The only real advantage of vim is the near endless possibilities and configurations, allowing you to really custom tailor it to your workflow. I love this but then again I love configuring and tweaking things, if you don't like that then just go with you editor of choice, learn to touch-type and to use shortcuts as much as possible, and I can guarantee you'll be just as productive as you would have been if you had taken the time to learn and configure Vim.