5 ms·
Plugins you should put in your vimrc
- CeRRuTiTo 14y agoVery useful, thanks. These days I changed double quotes to single so many times and this comes just in the right moment!
- przemoc 14y agoBefore snipMate came in 2009, snippetsEmu was already out there, since 2005! It's true though, that snipMate may seem more robust. Check also pkrumins' Vim Plugins You Should Know About: http://www.catonmat.net/blog/vim-plugins-surround-vim/ http://www.catonmat.net/blog/vim-plugins-surround-vim/ http://www.catonmat.net/blog/vim-plugins-repeat-vim/ http://www.catonmat.net/blog/vim-plugins-repeat-vim/ http://www.catonmat.net/blog/vim-plugins-matchit-vim/ http://www.catonmat.net/blog/vim-plugins-matchit-vim/ http://www.catonmat.net/blog/vim-plugins-snipmate-vim/ http://www.catonmat.net/blog/vim-plugins-snipmate-vim/ http://www.catonmat.net/blog/vim-plugins-a-vim/ http://www.catonmat.net/blog/vim-plugins-a-vim/ http://www.catonmat.net/blog/vim-plugins-nerdtree-vim/ http://www.catonmat.net/blog/vim-plugins-nerdtree-vim/ http://www.catonmat.net/blog/vim-plugins-ragtag-allml-vim/ http://www.catonmat.net/blog/vim-plugins-ragtag-allml-vim/
- Hates_ 14y agoI've moved to ctrlp over Command-T as it's pure Vimscript. Feels even faster than Command-T to me: https://github.com/kien/ctrlp.vim https://github.com/kien/ctrlp.vim
- derwiki 14y agoHow many files is the project you try it on? CommandT is faster for me, but only noticeably on large projects.
- qznc 14y agoI prefer CtrlP to CommandT, since it does not requires external programs. https://github.com/kien/ctrlp.vim https://github.com/kien/ctrlp.vim
- dchest 14y agoI use FuzzyFinder instead of CommandT + BufferExplorer. http://www.vim.org/scripts/script.php?script_id=1984 http://www.vim.org/scripts/script.php?script_id=1984
- dqminh 14y agoi had trouble with CtrlP initialy because the initial load time is too slow. However, this config line fix it for me let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files'] It lets CtrlP use git to list files, which is much faster for large project
- georgebashi 14y agoI've tweaked mine to this, which includes untracked files, but honours your gitignores: let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files --exclude-standard -co'] It was annoying me that I couldn't open files I'd just created with CtrlP, as they wern't yet tracked.
- robbles 14y agoJust tried this out on my setup, and it made a huge difference. A large project that used to take ~1s to load the first time is now pretty much instantaneous.
- Argorak 14y agoI have strange issues with CtrlP, especially files not being found although they would be a clear match.
- ehynds 14y agoAre they already open / matched by wildignore?
- dguaraglia 14y agoAs ehynds points out, CtrlP won't list files that are already open. You are supposed to access those using the 'quick buffer switch' mode. I've bound that command to my Tab key, so seeing what files are open and switching between them is a snap.
- StavrosK 14y agoAny vim plugin post that doesn't contain Vundle is incomplete, in my opinion. How else are you going to manage all these plugins? https://github.com/gmarik/vundle https://github.com/gmarik/vundle
- rane 14y agopathogen
- StavrosK 14y agoVundle's better.
- cduser 14y agoYeah, all I need is a vimrc when I have vundle. I sync it using Dropbox and run BundleInstall on any of my new computers and I'm good to go with all the plugins.
- darklajid 14y agoNot sure why you've been downvoted. I agree with your vundle suggestion. I migrated from pathogen to vundle and would recommend that people using the former check out vundle again. Even if it's from the 'wrong author' (aka not from tpope).
- StavrosK 14y agoThe only difference I'm aware of (I haven't looked into it much) is that Vundle downloads plugins too, rather than just install them, but it's a pretty big difference when you're looking for a plugin manager.
- wahnfrieden 14y agoIt's huge because it lets me manage my plugins in source control much more easily than juggling submodules in git or whatnot. Instead I just have my plugins as lines in my vimrc.
- gnosis 14y agoMy favorites: * pathogen [1] * PreciseJump [2] * MRU [3] * scratch [4] * xptemplate [5] * renumber [6] [1] - http://www.vim.org/scripts/script.php?script_id=2332 http://www.vim.org/scripts/script.php?script_id=2332 [2] - http://www.vim.org/scripts/script.php?script_id=3437 http://www.vim.org/scripts/script.php?script_id=3437 [3] - http://www.vim.org/scripts/script.php?script_id=521 http://www.vim.org/scripts/script.php?script_id=521 [4] - http://www.vim.org/script.php?script_id=389 http://www.vim.org/script.php?script_id=389 [5] - http://www.vim.org/scripts/script.php?script_id=2611 http://www.vim.org/scripts/script.php?script_id=2611 [6] - http://www.vim.org/scripts/script.php?script_id=189 http://www.vim.org/scripts/script.php?script_id=189
- wahnfrieden 14y agoUse vundle instead of pathogen - it installs the plugins for you, so managing them in source control is much easier. Lines in a vimrc are much less of a headache than git submodules etc.
- karategeek6 14y ago> Lines in a vimrc are much less of a headache than git submodules etc. I disagree. This may be true if you don't understand git submodules, but git submodules are not hard to understand with just a little effort. Once understood, git submodules are very easy to work with. Also, this may be just a personal quirk, but I'm not very fond of managing vim from within vim. It would bug the living daylights out of me to load vim just to update my plugins. I'm probably the only one who feels that way, though.
- tux1968 14y agoHave to agree with the author about his picks. Excluding a couple programming-language specific plugins the only other ones that i'd include on a longer list would be: EasyGrep - A nice quick way to search for arbitrary text when ctags/cscope doesn't have the answer. https://github.com/vim-scripts/EasyGrep https://github.com/vim-scripts/EasyGrep QuickFixSigns - Show marks associated with each line in a buffer. Also shows lines that have been changed from what has been committed to Git. https://github.com/vim-scripts/quickfixsigns https://github.com/vim-scripts/quickfixsigns Would be interested to know what others have to say about SuperTab since i'm thinking of giving it a try. https://github.com/ervandew/supertab https://github.com/ervandew/supertab
- goatslacker 14y agoDefinitely give supertab a shot. It's recently become one of my favourite plugins and now I'm tabbing religiously
- ninjay 14y agoThank you for showing how to use the plugins, most of these articles don't. I looked at the rest of the site, bookmarked! Can I make an article suggestion though? I'm a new(ish) vim user that is always on different systems. I need a way to quickly install/remove my vim settings and plugins. A tutorial how to do this would be awesome. Take for granted vim and git are already installed, my ideal workflow would be something like this: git clone git://blah.blah/my_settings.git ./my_settings/install.sh Now I can run vim and my whole environment will be ready. If I make any changes I should be able to run git push to update the repository. Then I could run remove.sh to clean everything up. Is there a system like this out there already?
- danbee 14y agoThoughtbot dotfiles (https://github.com/thoughtbot/dotfiles https://github.com/thoughtbot/dotfiles) works something like that. I've branched it for myself and extended it.
- StavrosK 14y agoAs I posted above, there's Vundle: https://github.com/gmarik/vundle https://github.com/gmarik/vundle You just copy your .vimrc over and Vundle installs everything.
- ninjay 14y agoVundle seems like it only takes care of the plugins. I'm looking for a vim install system, like Python's setup.py.
- darklajid 14y agoCan you elaborate on your requirements/wishes here? For me my vim environment consists of my vimrc plus plugins. Granted, I pick plugins based on the "doesn't need extra steps to work" requirement. vundle therefor restores my setup completely from a (potentially restored or managed in a git repository) vimrc file. What's missing for you?
- intractable 14y ago
- tsahyt 14y agoAmong the things I personally couldn't do without these days snipMate, which is mentioned in the article. Then there's clang_complete which made me very happy. Finally a compiler-based auto-completion for C in vim. Last but not least there's fugitive. That's really most of what I need since vim already provides a lot of useful features by itself.
- imalolz 14y agoI agree to these five, and add: * matchit - extends % functionality to support HTML/XML tags and also functions, blocks, conditionals in many languages. * Supertab - tab completion done right. * Tagbar or Taglist - code tree browser.
- jeromche 14y agoNice to see another VIM article on Hacker News.
- intractable 14y agoEvery time an article like this comes up, snipMate seems to be mentioned. This particular author even pointed to the old repository which appears unmaintained and has not had a check-in for two years. Where's the love for UltiSnips? [1] UltiSnips is actively maintained and well documented, not to mention supporting many more features, such as Python interpolation. More info at [2]. [1] https://github.com/SirVer/ultisnips https://github.com/SirVer/ultisnips [2] http://fueledbylemons.com/blog/2011/07/27/why-ultisnips/ http://fueledbylemons.com/blog/2011/07/27/why-ultisnips/
- matthiasv 14y agoActually, where's the love for neocomplcache? [1] neocomplcache is actively maintained and well documented, not to mention supporting many more features, such as file path completion, register completion, omni completion and Vim completion. [1] https://github.com/Shougo/neocomplcache https://github.com/Shougo/neocomplcache
- tdfx 14y agoJust switched to neocomplcache from AutoComplPop. Enjoying it very much so far.
- gaving 14y ago+1 for ultisnips, definitely the superior option when it comes to templating.
- davidp 14y agoCan you elaborate?
- don_draper 14y agoI just installed it. It's pretty good. The docs aren't great though. I hate sitting through screencasts.
- rbonvall 14y agoWhile the original author has abandoned snipmate, there is a fork that is actively maintained: https://github.com/garbas/vim-snipmate https://github.com/garbas/vim-snipmate I've been a happy user of snipmate, but I'll give ultisnips a try. Thanks for the tip!
- petepete 14y agoI already happen to have these in my setup; if you're a git user I highly recommend fugitive.vim too. https://github.com/tpope/vim-fugitive https://github.com/tpope/vim-fugitive
- matthiasv 14y agoI tried to incorporate it in my workflow several times, but usually I end up <C-Z>ing the Vim process and commit, branch etc. via the command line. I understand that Fugitive _might_ help resolving merge conflicts, but this is really just a small percentage of my daily Git workflow. Maybe, there is some deeper sense in it that I haven't grasped yet?
- d0m 14y agoI clicked the article thinking "Please, don't say Surround, Cmd-T, snipmate or Buffer Explorer".. These are amongst the most popular plugins for Vim and every week there are blogs saying exactly the same thing. Note: I have nothing against this blog in particular.. but please, upvoters, try to upvote new stuff.
- intractable 14y agoI agree. But, I must say: no matter how repetitive these articles, I pick up something new in the HN comments every single time.
- karmicthreat 14y agoThis is perfect since I'm just starting with vim.
- davidarkemp2 14y agoIn my experience, it's better to spend a long time playing with Vim, and then look at plugins. There's a lot that Vim does out of the box without any additional tools, and spending time learning to use (some) of it without trying to make it more like another editor is the only way you're going to get better at it. Learn about buffers and how to manage them before using BufExplorer. Learn the (many) movement keys, and insertion, append, replace, substitue, change, options before you use Surround. It may sound odd, but learn to use the tool by itself before you try and plugin anything else, otherwise you'll just get lost.
- lengarvey 14y agoI'd say that it's better to start off with installing vundle (https://github.com/gmarik/vundle/ https://github.com/gmarik/vundle/) and then whenever you feel like you're having problems doing something like file/buffer navigation, auto-completion or making vim pretty then go out looking specifically for something you like and vunlde will make it really easy to install just by pointing at the github. Whatever you do, don't install syntastic unless you want your vim to run awfully slow.
- icambron 14y agoI disagree. As someone who started using Vim recently, the issue wasn't learning modes/key sequences as it was just reaching feature parity with my previous editor (note that doesn't mean "acts like my previous editor", just "is at least as capable as my previous editor"). If I can't open files really quickly, I feel lost and upset, so I took care of that very early in the learning process by setting up CtrlP. Same with some other plugins. More generally, to me, the features that happen ship with Vim aren't special. I want the best editor for me, which might require features the builders of Vim didn't want to include. Vanilla is just another flavor.
- 14y ago
- don_draper 14y agoinstalling snipmate through pathogen is still a dark art
- johncoltrane 14y ago1. Download 2. Unzip in ~/.vim/bundle 3. Done How is that "dark art"?
- thurn 14y agoEmacs versions to check out: Surround: wrap-region (https://github.com/rejeep/wrap-region https://github.com/rejeep/wrap-region) Command-T: ido-mode with ido-find-file snipMate: YASnippet Syntastic: flymake Buffer Explorer: ibuffer
- naglfar 14y agoI actually tried really hard to get ido-mode to recursively search files under the current directory, but I was never successful. Is there some really easy modification I have overlooked? Because that is one of the major advantages CtrlP or Command-T have - and trying to use https://github.com/emacs-helm/helm https://github.com/emacs-helm/helm with https://github.com/bbatsov/projectile https://github.com/bbatsov/projectile turned out to be by far too slow.
- begriffs 14y agoI recently "declared vim bankruptcy" and rebuilt my vimrc from scratch. I want a full-featured vim, but I want to keep it responsive. There are many fancy presets out there https://github.com/skwp/dotfiles https://github.com/skwp/dotfiles https://github.com/carlhuda/janus https://github.com/carlhuda/janus https://github.com/spf13/spf13-vim https://github.com/spf13/spf13-vim https://github.com/vgod/vimrc https://github.com/vgod/vimrc but they freak me out. They turn vim into a singing, dancing, syntax/spell checking, indexing, buffer Whack-a-mole. My philosophy is that vim shouldn't do anything behind your back, but it should do great things if you ask. * Jumping to definitions * Finding all uses of a symbol in a repo * Running things + A test + Code in a repl * Git blame, diff * Summarizing methods in open file * Navigating my (rails) app When putting this together, I found Vundle to be the easiest package manager. Just specify any desired vim plugin github repos in your vimrc and let the :BundleInstall, :BundleClean etc commands do the rest. I used the standard plugins for most of the stated objectives, but there are places where I found some tricks. The coolest trick is running external programs without locking vim. You can send commands and selections to a tmux terminal using Vimux: https://github.com/benmills/vimux https://github.com/benmills/vimux After wrangling with running vim under tmux, I discovered that the vimux plugin works in MacVim too when tmux is running alongside. The thing I run most often is tests. In Rubyland people advise using Guard, which runs tests automatically when test files change. However this goes against my "don't do things behind my back" philosophy. Vim-turbux is more my taste. It extends vimux to run cucumber and rspec tests with the press of a key: https://github.com/jgdavey/vim-turbux https://github.com/jgdavey/vim-turbux The next area where most megadotfile presets are lacking is finding the uses of code. Finding code definition is pretty well handled by exuberant-ctags and vim-rails, but finding code uses is trickier. The cscope utility does this, but its language support is limited from what I could tell. Another contender is GNU global. Its setup is...interesting: http://simple-and-basic.com/2008/10/using-rtags-ang-gtags-for-coding-ruby.html http://simple-and-basic.com/2008/10/using-rtags-ang-gtags-fo... I couldn't get it working and the GTAGS files it generates cluttered my repos. I cheated and just mapped a key to do :Ggrep (git-fugitive) on the current word. While cscope or global would give the finest results, a massive grep comes close. Let me know, anyone, if you've gotten the tagging systems working better. My work in progress is here: https://github.com/begriffs/dotfiles https://github.com/begriffs/dotfiles I'd appreciate any criticism; I have lots to learn.
- johnkchow 14y agoOne of my favorite plugins that hasn't been mentioned so far is vim-powerline https://github.com/Lokaltog/vim-powerline https://github.com/Lokaltog/vim-powerline. It makes Vim have a really polished look to it, and more important: tells you which Git branch you're currently in.
- tomjakubowski 14y agoFor me, vim-powerline gives a much stronger visual indicator of the current mode. Changing the color of the whole statusline really stands out.
- equalsione 14y agoOTF isn't mentioned often but is extremely useful if you have to work with log files on a regular basis. It allows you to define up to 10 search terms and highlights them in different colors, making it easy to see patterns of output in logs. It doesn't sound that amazing at first but is worth trying if you herd log files for a living. http://vim.sourceforge.net/scripts/script.php?script_id=634 http://vim.sourceforge.net/scripts/script.php?script_id=634
- keithpeter 14y agohttps://github.com/davidbeckingsale/writegood.vim https://github.com/davidbeckingsale/writegood.vim The Writegood scripts can be handy if you write non-fiction prose in Vim. A strange synchronicity: I came across the page at http://matt.might.net/articles/shell-scripts-for-passive-voice-weasel-words-duplicates/ http://matt.might.net/articles/shell-scripts-for-passive-voi... and duly copy/pasted the bash scripts and ran them over some text files. Quite useful. Then I saw this thread and wondered if anyone had done a vim plug in for them. And davidbeckingsale has.
- modarts 14y agoSo.. we like Vim now?
- johncoltrane 14y agoWow, another post with the exact same plugins as all the other posts. These are all the 13 plugins currently sitting in my bundle directory: * AutoComplPop Provides auto completion. I like/need auto completion less and less, these days, so this one is on its way out. I tend to deactivate it and use my old custom mappings for omni completion instead. The no plugin way: inoremap ,, <C-x><C-o> * Commentary Toggles comments. The no plugin way: 0i// :s+^//++ * CtrlP Super sleek fuzzy file/buffer/tag navigation. I love it. The no plugin way: :e filename :sp *na<tab> :vs **/fi<tab> :sb *na<tab> nnoremap <leader>ls :ls<CR>:sb<Space> etc. * DelimitMate Automatically adds the second "')]}. The no plugin way: inoremap { {}<left> * EasyGrep Handy cross-files/buffers search/replace. More convenient than the default mechanism. The no plugin way: :vimgrep <cword> *.js | copen * InsertImg (customized) Inserts an <img> tag with the correct width and height. * SnipMate I use the old one as it does everything I need without any problem. The no plugin way: :help abbreviations * Sparkup Uses CSS syntax to quickly create large HTML layouts: div.aclass*5 > p{lorem ipsum} + img.anotherclass[src=/images/img.png] * Surround See the article. This one is almost a good reason in of itself to switch to Vim. * Syntastic Syntax checking of many languages on the fly. Super handy. * Tabular Because I like my code neatly aligned. * Visincr I actually don't use this one much but it helps a lot when I need to write lists of numbers/letters. * Word-Column The new kid on the block. Provides a text-object for columns. and the 14th, currently testing: * EasyMotion
- FixThisPOSSite 14y agoThe term is "plug-in".