
Vim plugins I use - prakashdanish
https://prakashdanish.github.io/2018/06/30/vim-plugins-i-use.html
======
jherdman
Here are some I find invaluable:

* FZF. Perhaps the best fuzzy finder for Vim [https://github.com/junegunn/fzf/](https://github.com/junegunn/fzf/)

* ALE. Asynchronous Linting Engine, totally awesome. [https://github.com/w0rp/ale](https://github.com/w0rp/ale)

* Polyglot. A "best of" language pack. [https://github.com/sheerun/vim-polyglot](https://github.com/sheerun/vim-polyglot)

* Plug. IMHO the best plugin manager going [https://github.com/junegunn/vim-plug](https://github.com/junegunn/vim-plug).

* Fugitive. The best git wrapper there is [https://github.com/tpope/vim-fugitive](https://github.com/tpope/vim-fugitive)

* vim-test. A plugin that helps you run tests from inside of Vim. [https://github.com/janko-m/vim-test](https://github.com/janko-m/vim-test)

Outside of that, switch to NeoVim if you haven't already
([https://neovim.io/](https://neovim.io/)). Or give Oni a chance, it looks
really promising ([https://www.onivim.io/](https://www.onivim.io/)).

~~~
wrboyce
While I appreciate your comment, we can already guess that you believe the
packages you have chosen to be “the best” at their job. Without further
narration (and I’ve only singled you out due to being the topmost comment),
comment sections like this have a tendency to become a dumping ground for
vimrc snippets.

Could you expand on why? Personally I’d be particularly interested on your
thoughts about vim-plug, as I use pathogen currently and I seems to do
everything I need.

~~~
farresito
\- You can update all the plugins with PlugUpdate; furthermore, they are
updated in parallel.

\- You can lazy load plugins

\- You can execute commands after a plugin update (e.g. building the new
binary for youcompleteme)

Those are the major points I think.

~~~
jessaustin
Lots of people like plugin managers. I prefer to use "git clone" and "stow".
Much less magical, and I feel I have a better understanding of what's going on
with my configuration.

~~~
pfranz
I have a plugin manager that can help you with that!

Seriously, isn't part of the problem that vim by default looks for all plugins
in one directory? Tim Pope's Pathogen does the minimum here and lets each
plugin have its own directory (which translates to git repo). You're
responsible for going to each directory and updating them.

~~~
jessaustin
I'm doing that too. I clone into "~/.config/nvim/stow/", then _stow_ figures
out how to put all that stuff into the proper places. Occasionally there is a
conflict, but that is usually for files that I don't want anyway, like "build"
or "LICENSE".

------
mhd
Let's get this out of the way: "How to Do 90% of What Plugins Do (With Just
Vim)":
[https://www.youtube.com/watch?v=XA2WjJbmmoM](https://www.youtube.com/watch?v=XA2WjJbmmoM)

And if you want to see some crazy vim usage, there's always Damian Conway:
[https://www.youtube.com/watch?v=aHm36-na4-4](https://www.youtube.com/watch?v=aHm36-na4-4)

~~~
tomcooks
I keep a semi-pristine vimrc because of the first video, after having seen how
heavy vim plugins can be on my low end equipment

------
snarfy
I gave up trying to make Vim into an IDE. It's a text editor. It's an
excellent one, but that's what it does. The plugins just aren't very good.
NerdTree is not a good file browser. None of the autocomplete/intellisense
works very well. It does work, but requires a lot of setup, and let's be
honest, a TUI isn't the best way to interact with autocomplete dropdowns.

Most of the IDEs have vim like features or plugins. It works a lot better the
other way - make your IDE into Vim.

~~~
Justsignedup
Text editors and IDEs are quite different.

For everz we've ben trying to shove one into the other.

Every IDE has a sort of shitty text editor.

Every text editor tries to make a shitty IDE.

Can someone please ackgnowledge that the reality is that neither is a good
approach? I wish that I could have complete integration between VIM and
JetBrains suite. Would be nice if the JetBrains platform could render a VIM
inside itself as the actual text editor but kept 100% of its features as vim
plugins to be installed. That way nobody has to re-invent the wheel on great
text editing (emacs falls into this category too) and actually making
intelligent IDEs.

~~~
pault
This is the goal of the Oni project, but it's still early in development and
there's lots of work left to do. Yes, it's electron but in my experience it
never uses more than a few hundred MB of ram.

[https://github.com/onivim/oni](https://github.com/onivim/oni)

~~~
sjellis
Oni is my current text editor, and even though it's pre-1.0, it's been a
fantastic experience. It starts fast, looks great, works perfectly as a Vim
(it supports standard Vim plugins), and requires almost no configuration (I
don't know why the built-in Prettier code formatting is shipped disabled, but
you should turn it on).

------
Sir_Cmpwn
This list is far from conservative. Vim isn't an IDE and shouldn't be made
into one - effective vim users ^z out of vim and use Unix as their IDE.

Here's my more conservative plugin list:

[https://git.sr.ht/~sircmpwn/dotfiles/tree/.vimrc](https://git.sr.ht/~sircmpwn/dotfiles/tree/.vimrc)

fugitive: I use this for the sole purpose of :Gblame because the command line
blame tool that ships with git is frustrating to use.

ctrlp is there for opening files quickly in large codebases. It's better than
NerdTree and fits more nicely into my workflow.

surround should be built into vim.

editorconfig is useful because I work on a large variety of projects.

The rest of the plugins are syntax highlighting related. ctrlp and surround
are the only ones which meaningfully change the experience of using vim.

~~~
JackCh
I don't see why being effective in vim means you ^z out of vim to run `ack` or
`grep`, instead of pressing ^f (for example) to run Ack.vim on the <cword> and
have the results displayed next to your code in a window that, when you select
the item you want, opens that corresponding file in a buffer with your cursor
already on the line in question. Certainly you don't need ack.vim, you could
just ^z and do it the old fashioned way, but where is the utility in that?

As for the unix philosophy, it's all about programs doing one thing and doing
it well... but isn't it also about composing those programs to do the job you
need done? If you're just ^z'ing out of vim to run `grep` or `ack`, how do you
get those results back into vim? copy/paste it through your terminal emulator,
using tmux in the best case scenario? How is that more in line with the unix
philosophy than simply having vim shell out to those utilities for you?

^z to run unix utilities is like coping the output of one command into a file
on disk before sending it to another, instead of simply piping the output of
one into the input of another using the functionality of your shell. If vim
filling in for a shell violates the philosophy, then damn the philosophy. I'd
rather have _" the traditional shell+domain specific shells(vim, ranger,
etc)"_ than turn the traditional shell into a one-size-fits-poorly shell.

[https://github.com/mileszs/ack.vim](https://github.com/mileszs/ack.vim)
(Because ack.vim and plugins like it are actually in keeping with the so-
called unix philosophy for reasons I outlined above, you don't actually have
to use `ack` with ack.vim. I use it with `ag` (the silver searcher) instead.)

~~~
Sir_Cmpwn
>Certainly you don't need ack.vim, you could just ^z and do it the old
fashioned way, but where is the utility in that?

Because ack.vim can't be piped into other tools. You can't, for example, limit
your search to the last 50 files modified. Or only to executable files. You
can't pipe the results into sed or make matching files world-readable. Sure,
you could install ack.vim, slow down vim's startup and bloat your
installation, or you could just hit ^z and use the unparalleled power of the
Unix shell.

>How is that more in line with the unix philosophy than simply having vim
shell out to those utilities for you?

Sometimes it's not. But vim has ! built in, you don't need plugins to run
commands from it. I do it all the time.

~~~
pasabagi
One thing I don't understand, is how do you handle mistakes with the 'unix-as-
ide' approach? I was using sed to refactor. Now, I typically use bufdo
%s/foo/bar/gc, because it's much more forgiving. It's the same story with a
lot of stuff you can ctrl-z for - if you can do it inside vim, it's usually
far easier to control and roll back.

~~~
C0d3r
Git helps you with those mistakes, otherwise, yes, very unforgiving

------
crehn
I personally use no plugins [1]. Zero friction moving from host to host. Vim
is a great text editor, not a great IDE. For anything more sophisticated I
prefer just switching to something like VS Code (with Vim bindings of course).

[1]
[https://github.com/hoffa/dotfiles/blob/master/.vimrc](https://github.com/hoffa/dotfiles/blob/master/.vimrc)

~~~
iforgotpassword
Same. I had quite a lot some time in the past, but also made the "using vim on
some foreign machine and being confused as hell" experience by trying to use
hotkeys or commands that didn't exist. Also just keeping the config synched
between my own hosts was more annoying than I anticipated. Not to mention
resolving conflicts between different plugins, or random stuff breaking when
updating anything.

Nowadays I have a vimrc that just tweaks vanilla features the way I like, plus
some highlighting for certain keywords regarding a C codebase I occasionally
work on. The only plugin I use is a modified version of DetectIndent.

~~~
JackCh
> _" Same. I had quite a lot some time in the past, but also made the "using
> vim on some foreign machine and being confused as hell" experience by trying
> to use hotkeys or commands that didn't exist."_

I've found that setting a custom colorscheme in vim averts this problem
completely. If I see my colorscheme, my muscle memory is primed for my config.
If I see the default vim colorscheme, my muscle memory reverts to default vim.

If somebody gave me a copy of otherwise vanilla vim to use that had my
colorscheme, that would certainly throw me for a loop. But so far nobody has
been that diabolical.

------
aquova
People seem to swear by NerdTree, but I personally don't see the purpose of
it. Sure it may be nice to see your file structure sometimes, but having a
terminal open or even just the actual folder window open solves that.
Everything else can be done with the built-in :Ex command, which lets you
navigate to open files, create new files, rename, delete, mostly everything
you want.

As for other plug-ins, there are a few I would recommend (can you tell I'm a
Tim Pope fan?):

\- vim-commentary: Gives bindings for commenting out code quickly:
[https://github.com/tpope/vim-commentary](https://github.com/tpope/vim-
commentary)

\- vim-surround: Easily surround selected text with symbols:
[https://github.com/tpope/vim-surround](https://github.com/tpope/vim-surround)
\- vim-unimpared: Adds bindings for some misc. commands, like enabling
relative line numbers and spellcheck: [https://github.com/tpope/vim-
unimpaired](https://github.com/tpope/vim-unimpaired)

\- vim-repeat: Allows many more commands to be repeated with . :
[https://github.com/tpope/vim-repeat](https://github.com/tpope/vim-repeat)

\- VimCompletesMe: A much more bare-bones auto-completion tool than
YouCompleteMe, hitting tab gives you matches from your previously typed text.
It's also all in vimscript so it's much easier to install and manage:
[https://github.com/ajh17/VimCompletesMe](https://github.com/ajh17/VimCompletesMe)

\- Pathogen: A plug-in manager, if you can call it that. It simply re-adjusts
the file paths so you can centralize your plugin directory. Some plug-in
managers will auto-update, but I never liked that, just run git pull if you
wish to update a plugin: [https://github.com/tpope/vim-
pathogen](https://github.com/tpope/vim-pathogen)

There are some other cosmetic ones I like as well, like airline, and vim-
highlightyank, but that's a personal preference.

~~~
mattbreeden
> Sure it may be nice to see your file structure sometimes

And you can just use the built in :Ex for that

------
tomxor
> vim-gitgutter

I'm not a vim user (yet), but this feature is built into Atom and I've come to
find it indispensable. I'm a bit of a commit diff freak (I like it neat and
tidy), and once i've finished messing around on some branch I want to
gradually converge to some simple differences, a git diff type gutter is
really helpful in visualising ("watch git.." can come close but nothing is as
good as in editor integration).

------
tcbawo
If you write C or C++, this script is handy for switching between source and
header files: [https://github.com/vim-scripts/a.vim](https://github.com/vim-
scripts/a.vim)

------
jhare
It's simple but tpope/vim-surround is another favorite. Pope pope pope pope.

~~~
pletnes
This plugin should have been implemented in vim proper. Many vim binding
plugins for other editors do, e.g intellij vim bindings.

------
epicide
I like that the intro paragraph discusses the pros and cons of vanilla vs
plugins.

For those that want to take a look at some more vanilla approaches to some
common tasks, Max Cantor has a great talk about that on YouTube [0].

[0]:
[https://www.youtube.com/watch?v=XA2WjJbmmoM](https://www.youtube.com/watch?v=XA2WjJbmmoM)

------
baby
How is the plugin management in vim? I use emacs and it’s a pain to setup. You
need to modify a config file (.emacs) in order to add plugin lists (melpa).
You then browse the list through a shortcut (M-x list-packages) and you only
see names, no description or ways to look for something specific. Once you
installed your plugins there are no real way to access a manual or learn them.
Often you will need to modify config files to make them usable.

~~~
mhd
The Emacs package list has a description field on the right, a shortcut for
more info (?) and after it's installed you've got C-h m and often info pages
(C-h i). What's wrong with that?

Vim has no unified plugin structure, there are several plugin manager packages
(often installed via git clone). I personally use vim-plug[i] which is more on
the minimal side, but there are others like pathogen or vundle. No real
centralized plugin repository like melpa, I don't think one of the plugin
managers I've used had some kind of common install-screen. You mostly enter
the github address and execute the package update vimscript. I've seen more
Emacs info packages than :help docs, but in most cases I'm browsing the githup
README.md/.org anyways.

[1]: [https://github.com/junegunn/vim-plug](https://github.com/junegunn/vim-
plug)

------
SebNag_
Missing the most important one:

[https://valloric.github.io/YouCompleteMe/](https://valloric.github.io/YouCompleteMe/)

:)

~~~
nerdwaller
I’ve moved from YouCompleteMe to Deoplete. While YCM is good, the plugin
support for deoplete seems a bit more extended and easier to set up (ymmv).
Maybe I just messed something up every time I tried to rework my vimrc with
YCM though, it’s probably likely :D

~~~
steeef
+1 for Deoplete. As long as you're using NeoVim or a more recent version of
Vim (8.0+) with a few plugins, it just works.

------
sandov
I've doubted for long about learning Vim or Emacs.

I like the default vim keybindings, but I don't like having to install plugins
in order to make my editor usable, I like the batteries-included concept.

But when I try to learn Emacs I can't accept the fact that I have to press M-v
to go up one screenful. It must become really uncomfortable really fast.

~~~
mattbreeden
You can try Evil mode which gives you vim keybinds in Emacs:
[https://github.com/emacs-evil/evil](https://github.com/emacs-evil/evil)

------
icc97
I spent a day or two recently figuring out how to get the vim-airline (aka
powerline) icons to work properly, going through pretty much every single
font/theme option on Windows (even in the DOS prompt) and Linux. I added a
dummies guide [0] to the Wiki.

For a Windows console user - it's worth noting that since they got 24-bit
colours working in the console the work is now on-going to get the colours
properly working in terminal Vim [1].

[0]: [https://github.com/vim-airline/vim-airline/wiki/Dummies-
Guid...](https://github.com/vim-airline/vim-airline/wiki/Dummies-Guide-to-
Powerline-fonts-on-Fedora,-Ubuntu-and-Windows)

[1]:
[https://github.com/vim/vim/pull/2060](https://github.com/vim/vim/pull/2060)

------
h43z
The build in vim alternatives for

nerdtree :E<CR>

fuzzy finding :e __/ index<Tab> (index being part of filename)

autocompletion <CTRL-P> while in insert mode and typing word

------
nyolfen
no mention of my favorite, vimwiki:

[https://github.com/vimwiki/vimwiki](https://github.com/vimwiki/vimwiki)

------
Zeetah
Is there anything for Vim that mimics the Syntax formatting of Source Insight
([https://www.sourceinsight.com/doc/v4/userguide/Manual/Concep...](https://www.sourceinsight.com/doc/v4/userguide/Manual/Concepts/Syntax_Formatting_and_Styles.htm))?

I'd love to switch to Vim...

~~~
timwaagh
that would require actually understanding the code. it could be done i guess
these days with the async that came in 8.0 but would require some pretty heavy
vimscripting.

------
clircle
As an Emacs user, I'm so curious about vim packages. Does vim have packages
that are akin to adding a major mode in Emacs? Some of the packages on this
list look like the vim version of minor modes or little helper functions.

~~~
nsomaru
Vim has a limited number of "modes" \-- insert, normal, command and visual.
These are not analogous to Emacs modes AFAICT. A vim package/plugin typically
modifies/enhances behaviour in these modes. Where they can, useful operations
are bound to a key combination.

You spend most of your time in Vim (when editing) in normal mode, executing
deft movements and register usage to behave as a surgeon upon the text, as it
were. Vim's noun/verb with multipliers make this an effective editing
paradigm. Enlightened users have reported "thinking in Vim."

Vanilla Emacs to a vim user feels like you're always in "insert" mode.
Chording everything felt a little weird, and I gave up on evil-mode because it
wasn't vim enough for me.

~~~
clircle
Right, I am an evil user myself. My question was about the vim equivalent of
major modes in Emacs --- Does vim have a concept of major mode (a set of
language specific functionality, one major mode per buffer)?

~~~
JackCh
Not formally in the Emacs sense, but you can of course have configuration only
load depending on the filetype so you end up with different keybindings (or
other settings) depending on what sort of file you're in.

------
arthurz
Vim-zen fails to install on Windows [https://github.com/prakashdanish/vim-
zen/issues/9](https://github.com/prakashdanish/vim-zen/issues/9)

------
jamslater
I think that
[https://github.com/simeji/winresizer](https://github.com/simeji/winresizer)
is a good tool. we'll able to become windows resize easier.

~~~
prakashdanish
I came across this before but since I was using tmux splits back then, this
sounded like unnecessary overhead but now that I've been using vim splits
excessively, this is proving to be a nice little addition.

------
commandlinefan
I stay away from plugins for fear that I’ll get so used to them, I’ll be lost
if I sit down in front of a terminal that doesn’t have them installed.

~~~
h1d
And you waste 95% of the time you use your own vim with painful default? Some
people seem to want to live by your statement but I treat it pointless. Just
pretend the default vim is another editor and live with your customized
version.

------
timwaagh
hmmm. i dont use any myself (i tried omnisharper and the java equivalent for
more quickly finding syntax errors but quickly dropped them as they are
unreliable).

here are some plain vim alternatives:

1\. goyo: i write markdown quite a bit. it is not necessary to have much for
this except perhaps syntax highlighting. hiding the status line can likely be
done with a few configuration directives.

2\. gitgutter. for the described use case: <ESC>:new<ENTER>:read !git diff use
the search :/ to go from one diff to the next

3\. vim-surround

for a word: (<ESC>wa) for a line: (<ESC>$a)

depends on the situation, but i'd need more to be sold to use this plugin.

4\. vim-autoclose as described here it might possibly be nice except if you
have to write a smiley, an arrow, or similar. if you never need to i can see
this being useful, but the effect is quite minimal, as going to the end of the
current line is a matter of <ESC>$ and inserting a closing parenthesis after
it is a matter of a) .

5\. vim-commentary visual block mode is sufficient for this usually. java:
(<ctrl>+v)<ESC>$g$0i//<ESC>

6\. the gruvbox color scheme looks pretty neat. however: the built-in desert
scheme works well on almost every machine and is included by default, so there
is no real need to go to this amount of trouble. if you work regularly under a
shared root account via ssh, i think it is wise to stay away from custom color
schemes.

7\. could be useful actually, i might try it. however find and grep and other
external tools can be used from vim as well. the only gain by using this is
that results appear as you type instead of after. marginal gains.

<ESC>:new<ENTER>:read !find -name 'bla' 8\. i think the preinstalled netrw
plugin is just fine for exploring. it can be configured to run in a treemode
too with some configuration. and the advatage is that it will be available on
your average shared server account as well, so it pays much more dividend to
learn netrw over nerdtree.

9\. sounds like a simple remapping. you could just use the default key
<ctrl>+p . the nice thing is that this will be available on shared servers.

10\. importing is pretty easy already. here is how i do it. importing
<ESC>1giim<ctrl-p> whatever dropping <ESC>/import\ what*<ENTER>dd

~~~
git-pull
> 6... the built-in desert scheme works well on almost every machine ...

Agreed.

For a bit of an optimization to that:

\- [https://github.com/rainux/vim-desert-
warm-256](https://github.com/rainux/vim-desert-warm-256)

Not many stars on it, but works on a few machines without needing to have
extra stuff installed.

------
Exuma
Here are all the ones I use. Out of this list, tkae a look at vim-sneak. It's
very lightweight and quite cool.

    
    
      Plug 'mileszs/ack.vim',                        {'as': 'vim-ack'}
      Plug 'vim-airline/vim-airline',                {'as': 'vim-airline'}
      Plug 'slashmili/alchemist.vim',                {'as': 'vim-alchemist'}
      Plug 'ap/vim-css-color',                       {'as': 'vim-css-color'}
      Plug 'hail2u/vim-css3-syntax',                 {'as': 'vim-css3-syntax'}
      Plug 'ctrlpvim/ctrlp.vim',                     {'as': 'vim-ctrlp'}
      Plug 'ck3g/vim-change-hash-syntax',            {'as': 'vim-change-hash-syntax'}
      Plug 'Raimondi/delimitMate',                   {'as': 'vim-delimitmate'}
      Plug 'junegunn/vim-easy-align',                {'as': 'vim-easy-align'}
      Plug 'elixir-editors/vim-elixir',              {'as': 'vim-elixir'}
      Plug 'airblade/vim-gitgutter',                 {'as': 'vim-gitgutter'}
      Plug 'fatih/vim-go',                           {'as': 'vim-go'}
      Plug 'junegunn/goyo.vim',                      {'as': 'vim-goyo'}
      Plug 'othree/html5.vim',                       {'as': 'vim-html5'}
      Plug 'pangloss/vim-javascript',                {'as': 'vim-javascript'}
      Plug 'othree/javascript-libraries-syntax.vim', {'as': 'vim-javascript-libraries'}
      Plug 'tpope/vim-markdown',                     {'as': 'vim-markdown'}
      Plug 'tmhedberg/matchit',                      {'as': 'vim-matchit'}
      Plug 'scrooloose/nerdcommenter',               {'as': 'vim-nerd-commenter'}
      Plug 'scrooloose/nerdtree',                    {'as': 'vim-nerdtree'}
      Plug 'chr4/nginx.vim',                         {'as': 'vim-nginx'}
      Plug 'prettier/vim-prettier',                  {'as': 'vim-prettier'}
      Plug 'tpope/vim-rails',                        {'as': 'vim-rails'}
      Plug 'tpope/vim-repeat',                       {'as': 'vim-repeat'}
      Plug 'cakebaker/scss-syntax.vim',              {'as': 'vim-scss'}
      Plug 'justinmk/vim-sneak',                     {'as': 'vim-sneak'}
      Plug 'tpope/vim-surround',                     {'as': 'vim-surround'}
      Plug 'gasparch/tagbar',                        {'as': 'vim-tagbar'}
      Plug 'SirVer/ultisnips',                       {'as': 'vim-ultisnips'}
      Plug 'mbbill/undotree',                        {'as': 'vim-undo-tree'}
      Plug 'maxbrunsfeld/vim-yankstack',             {'as': 'vim-yankstack'}

------
rco8786
I have a somewhat similar setup with the addition of BufferGator and YCM.

That said, what’s described here is nowhere close to “vanilla” vim.

