
Ask HN: How to improve vim productivity and workflow? - shincert
I only need my .bashrc and .vimrc with me on a UNIX machine to get around. It makes me feel all warm and fuzzy inside because it&#x27;s so minimal and portable. I love it.<p>But I have not mastered vim yet. In particular, going back and forth between files and directories is really cumbersome in larger, more complex projects. When time is critical in a project I just install Atom or something with a sidebar (it makes a huge difference to me) and move on with my life.<p>I want to improve. Specifically, how can I productively edit multiple files simultaneously in a larger codebase? Should I use tmux panes and windows? Or vim split views? Should I use a sidebar plugin for vim? Any other workflow tips?<p>Should I even use vim at all? Why bother?
======
yefim
Different strokes for different folks but I really love vim split views. I
have Ctrl-h, Ctrl-j, Ctrl-k, and Ctrl-l mapped to navigate between my splits
with ease as well as using the vim plugin Golden Ratio[1] to make the current
focused split larger than the rest. If you really need the tree view, I've
heard great things about NERD Tree[2]. Feel free to check out my .vimrc[3] for
other neat tricks and plugins :)

[1] [https://github.com/roman/golden-ratio](https://github.com/roman/golden-
ratio)

[2]
[https://github.com/scrooloose/nerdtree](https://github.com/scrooloose/nerdtree)

[3]
[https://github.com/yefim/dotfiles/blob/master/.vimrc](https://github.com/yefim/dotfiles/blob/master/.vimrc)

------
vanboxel
I really enjoy vim tabs for multiple files. Especially if I don't need to see
all of them at once, but just quickly switch between them. `:tabnew foo.txt`
to open another file, then `gt` to go to the next tab and `gT` to go back.

If you work interactively with data, you might also enjoy Slimux
([https://github.com/epeli/slimux](https://github.com/epeli/slimux)), a vim
plugin that allows you to send lines from vim to an arbitrary tmux pane. I
usually have IPython running in such a pane so I never have to copy+paste.
I've got an ebook I've been kicking around describing this workflow in more
detail here
([http://dvbuntu.github.io/compute/posts/2050/01/01/workflow.h...](http://dvbuntu.github.io/compute/posts/2050/01/01/workflow.html)).

~~~
steve1011
What's the difference between buffers and tabs? I am genuinely curious.

~~~
luxpir
Here's a nice explanation of how they are different in practice, rather than
just in theory:

[https://stackoverflow.com/questions/26708822/why-do-vim-
expe...](https://stackoverflow.com/questions/26708822/why-do-vim-experts-
prefer-buffers-over-tabs#26710166)

------
jneumann004
Use the editor that works best for you. I have used Vim every day for almost
the last two years and I have learned to work very quickly inside of it.

As far as plugins, if one sounds interesting or useful to you, install it. If
it doesn't work out, then you can delete it later. Over the years I have tried
all of the popular plugins, but I have managed to whittle it down to 4 plus a
couple of language specific plugins

Here are a couple of handy youtube videos Vim Navigation Commands
[https://www.youtube.com/watch?v=Qem8cpbJeYc](https://www.youtube.com/watch?v=Qem8cpbJeYc)
How to Do 90% of What Plugins Do (With Just Vim)
[https://www.youtube.com/watch?v=XA2WjJbmmoM&t=3477s](https://www.youtube.com/watch?v=XA2WjJbmmoM&t=3477s)

------
vkdir
Vrapper
([http://vrapper.sourceforge.net/documentation/](http://vrapper.sourceforge.net/documentation/))
lets you use Vim inside of the Eclipse IDE.

