7 ms·
Turning vim into an IDE through vim plugins
- bechap 9y agoHaving seen this article when I first started using vim seriously, I'd recommend fzf.vim in place of ctrl-p and ALE in place of Syntastic. The former I find is much more performant, and the latter takes advantage of Vim8 / neovim's asynchronous features. Plus, fzf.vim comes with Ag, which effectively replaces Ack.vim (albeit, with a little bit of tweaking).
- Svenstaro 9y agoI think you can get better results with ctrlp when using cpsm as its matcher. fzf.vim always starts at the top and cpsm actually minds your current file.
- javitury 9y agoThat is the reason I chose neomake, because syntastic was dragging vim down. I'm curious, how does ALE compare to neomake?
- lloeki 9y agoUsing ALE right now. By design: Syntastic runs synchronously on save, Neomake runs asynchronously on save, ALE runs asynchronously as you type. Neomake is good but I see no reason to go back from ALE which works brilliantly.
- FBT 9y agoNeomake can do that too: https://github.com/neomake/neomake#setup https://github.com/neomake/neomake#setup
- red2awn 9y agoYou can go even further by using FZF+ripgrep, it's so much faster.
- memco 9y agoThe article also recommends neocomplcache, whose github says its deprecated and to use neocomplete, which is also deprecated and suggests you use deoplete. At least the chain ends there for now.
- zelos 9y agoFZF is fantastic, but has anyone managed to make it work in MacVim? I just get weird display corruption and control characters in my search string when I use it. Works great in the terminal and neovim.app etc.
- mythrwy 9y agoSurprised they recommend a single colorscheme (jellybeans) at bottom of article. Moving between machines and terminals different colorschemes seem to work better than others. This has like a million colorschemes (OK, slight exaggeration but it does have more than I've been able to review. Usually pick from 5 or 6 favorites commented out in .vimrc). https://github.com/flazz/vim-colorschemes https://github.com/flazz/vim-colorschemes Also they recommend https://github.com/Shougo/neocomplcache.vim https://github.com/Shougo/neocomplcache.vim (which I've used for years). Reviewing some vim plugins the other day I noticed that github hasn't been updated in 3 years and recommends another plugin now. (Don't plan on switching until it breaks though). Guessing this article may be a few years old? <edit>Yes, it says 2014 at top
- Insanity 9y agoMight be good if the date could be mentioned in the title:-)
- erikb 9y agoThis should be only an experiment at best. Please don't waste so much time trying to turn a tool into something that it is explicitely not. If you just want an IDE experience use one that already exists. If you want to build your own out of plugins, use something like Emacs that has something like that as a core feature. If you really want to learn vim though, then please learn the IDE that it is already integrated in: Linux. Linux based OSes are the most extensive IDEs because in the past nobody thought there would be a difference between a programmer and a computer user. So it's the most complete system that you can find. And additionally to solving all your programmer problems you also learn an OS and its components on the way.
- rimher 9y agoThere'll always be a part of me that wants to learn vim better and set something like this up. Then there's the other part of me, that just uses Sublime instead.
- Rainymood 9y agoThe learning curve is steep but learning Vim is worth it.
- geowwy 9y agoSubjectively I think it's worth it because vim feels more comfortable to me but I'd be surprised if Textmate/Sublime/Atom are any less productive. They're all pretty good editors.
- icc97 9y agoMost of these plugins make Vim more like ST. Having switched from ST to Vim I have spent lots of time trying to add in the bits I miss. But there are benefits of Vim that ST are ever likely to have fully: * Open Source * Editing inside ssh * The programmable way of editing which you'll never teach yourself if you don't dive in. I can't even quantify if this is better, but it feels better and you only need a few percent improvement over your editing/refactoring speed to be worth it over the years * fully custom, you set it up exactly the way you want it. I never felt tempted to create shortcuts in ST, but it's much more standard in Vim * it's good to understand Vim's way of editing even if you go back to other editors * in theory you can pretty much do everything that ST can do in Vim but I don't think you'll get the full power of Vim if you try to recreate it in ST
- 59nadir 9y agoWhile I would never sell it as "turning vim into an IDE", I use most of these plugins. ctrl-P is great, but I would probably switch to fzf if I was bothering to update my vimrc and plugins lately. Fundamentally, I think people trying to sell emacs/vim with plugins as "turn X into an IDE" are sort of not getting what people see and get from IDEs, though. There's quite a bit more integration that goes into IDEs and what you're making is a pretty barebones/poor IDE with these plugins. Most languages, though, don't need an actual IDE for them to be great. You need the auto-completion, automatic compilation/error checking, jump to definition, easy-to-reach documentation, etc., for them to instantly be super productive while coding. Spacemacs with Haskell plugins is one of the best coding experiences I've had and it even taught me some patterns that I didn't know about. Another highlight is OCaml tooling that works really great with both Emacs and vim.
- geowwy 9y ago> There's quite a bit more integration that goes into IDEs and what you're making is a pretty barebones/poor IDE with these plugins. I think even that's putting it generously. It's not turning vim into an IDE at all, just adding some modern text editor features like you'd find in Atom or Sublime.
- c256 9y agoI don’t disagree on principle, but a highly-configured Emacs can easily reach levels of integration that I think is worthy of the “Integrated Development Environment” label. For vim, I suspect it’s more like “as close to IDE level as a dedicated vim user is likely to want”. (Fwiw, I use Emacs a lot, vim a little, and my hardcore IDE usage is several years back, so maybe that’s just my biases showing.)
- maccard 9y ago> a highly-configured Emacs can easily reach levels of integration that I think is worthy of the “Integrated Development Environment” label I disagree. I've _never_ seen an integration into emacs that comes close to a _good_ integrated debugging experience. Similarly, the navigation/refactoring integrations tend to feel bolted on, rather than integrated. (you're using projectile and irony mode? They both have different representations of what your "project" is, so you have to keep both up to date). Again, actually "building" from emacs is something I've never seen done well. You've inevitably got the compile command which you have to write yourself, but my IDE can parse its own project file, generate a list of targets and configurations (predefined compiler flags for optimisation/definitions) and build those in one keystroke. I've also never seen any integration of any autocomplete that works with configurations either.
- suprfnk 9y agoThis is from [2014] and contains outdated information. Can someone update the headline? As posted elsewhere, we now have vim 8, ALE instead of Syntastic, fzf/fzy instead of ctrl-p, and more.
- 127 9y agoI tried very hard to get used to Vim. I just feel compared to something like Visual Studio Code it's still very clunky. I can understand why people who have used it for a decade prefer Vim over other text editors. They already know how to use it and how to integrate it into their workflow. For a newcomer this task, it seems, is nigh insurmountable. Are there people who recently got into it and think it's the superior way to code and why? For me, it was a lot of wasted time trying to learn Vim and finding out that other editors that I already use are as good or better.
- dozzie 9y ago> I just feel compared to something like Visual Studio Code it's still very clunky. From my perspective, if you're trying to turn Vim into an IDE, you're using it in the wrong way. Vim is an excellent text editor and leave it at that. Whatever you still need (build system, file management, version management, package management, debugging, log collection, and so on), build your environment with external tools that have nothing to do with Vim.
- dan00 9y agoThere's no question, that editors like vim or emacs have a very steep learning curve and it might not payoff for everyone. I'm using vim now for ~15 years and it all started during university on a unix machine with a limited number of options, so I was somehow forced to learn either vi or emacs. I don't know if I would have ever learned vim if I had the options of today. But I also like powerful tools, so perhaps I still would have, and what I like most about these more powerful editors is the ability to optimize them to my prefered workflow. Sometimes you've to fiddle a bit around, which can be very annoying, but at the end I almost always get to a solution I like to work with.
- cocktailpeanuts 9y ago> I tried very hard to get used to Vim. I just feel compared to something like Visual Studio Code it's still very clunky. This just means you failed to get used to Vim. Has nothing to do with it being "clunky". I use Vim for many cases, and other IDEs for when I'm forced to use them, such as Android studio (IntelliJ) for Android, XCode for iOS, and certain languages where it's hard to remember the syntax, so I think I'm qualified to answer, coming from a user of all of these editors. For dealing with API-heavy frameworks I think IDE is good. But even then I prefer to have some sort of Vim plugin integrated into the editor so I can take advantage of shortcuts from both the IDE itself and the Vim scheme. One benefit with Vim is that it's become almost a standard that you can find vim plugin in any IDE (Except for recent changes in XCode) so you can just expect to jump on to any editor and be immediately productive, without having to learn each editor command. You don't have that for Sublime or Atom. Sure some editors have similar commands for dealing with similar features, but not always. It's an "editing scheme", not just a single editor. This is why it's much more efficient in the grand scheme of things than any other editors exactly because of that, in my opinion. Editors will come and go, but editing schemes are forever.
- chewz 9y agoI recommend vim-workspace for IDE-like tabs. Helped me a lot in working with Vim buffers. https://github.com/bagrat/vim-workspace https://github.com/bagrat/vim-workspace
- jmsmistral 9y agoGood list! Also, if you work with databases (particularly PostgreSQL) and want to work with them from Vim, check out dbext: http://jonathansacramento.com/posts/20160122-improve-postgresql-workflow-vim-dbext.html http://jonathansacramento.com/posts/20160122-improve-postgre... Link to dbext here: https://github.com/vim-scripts/dbext.vim https://github.com/vim-scripts/dbext.vim
- Lio 9y agoThat article seems somewhat out of date now. For a more up to date approach I'd suggest Drew Neil's Modern Vim book (still in beta)[1] and using async language server plugins[2] [1] https://pragprog.com/book/modvim/modern-vim https://pragprog.com/book/modvim/modern-vim [2] https://langserver.org/ https://langserver.org/
- bgrohman 9y ago"NERDTree satisfies this need of mine, replacing vim’s built-in netrw file navigator with a nicer-looking, less buggy, more fully featured alternative." Wait, what's wrong with the built-in netrw? I actually started with NERDTree before I knew netrw existed. After discovering netrw, I switched to it instead. I think it looks just fine and prefer it to the more complex NERDTree.
- icc97 9y agoI agree, it's better to work with the internal tools if possible. I did install Tim Pope's vinegar plugin [0] as it adds some nice tweaks to netrw. But I've since switched to using FZF [1] and hardly use netrw anymore. [0]: https://github.com/tpope/vim-vinegar https://github.com/tpope/vim-vinegar [1]: https://github.com/junegunn/fzf/blob/master/README.md#as-vim-plugin https://github.com/junegunn/fzf/blob/master/README.md#as-vim...
- bgrohman 9y agoCool, thanks for the recommendations. I've tried ctrlp for fuzzy finding, and it works ok. Might give FZF a try though.
- bgrohman 9y agoI'm surprised the author didn't mention vim's sessions feature. The ability to close the editor/IDE and pick up right where you left off can save a lot of time when working with multiple large projects. It's easy enough to use on its own, but I have a small wrapper plugin that adds a few features for ease of use: https://github.com/bgrohman/vim-bg-sessions https://github.com/bgrohman/vim-bg-sessions.
- icc97 9y agoFor which Tim Pope's Obsession plugin [0] is fantastic. It solved a whole bunch of weird conflicts that I had with plugins. [0]: https://github.com/tpope/vim-obsession https://github.com/tpope/vim-obsession
- bgrohman 9y agoCool, I haven't used that one. I'm sure it's great coming from Tim Pope. Mine's working fine for me at the moment, though.
- sfifs 9y agoWhy not just use an IDE if that's what you need with a Vim mode plugin rather than shoe horning Vim into something it is not really meant to be. Virtually every major IDE has a Vim mode.
- 59nadir 9y agoI use IntelliJ with IdeaVim at work and I can vouch for it, but the truth is that even the better plugins for the more mainstream IDEs suffer from strange and annoying issues. For example: ysiw)j. will not actually surround a word in parens (without a space at the edges) and then move down and do the same to the word on the line below. Surround commands cannot be repeated in IdeaVim. It's about as good a try as I've seen at emulating vim outside of Emacs, but it's certainly not complete at all. What you said about shoehorning vim into being an IDE can be said about shoehorning IDEs into being decent editors. It's extremely hard to get both and depending on the language it's better to get the IDE with so-so editing or get the stellar editing with most of the productivity boons of nice integration.
- pfranz 9y agoSpeaking for myself: * Vim mode in IDEs often only implement the most basic vim commands * I'm able to work remotely over a slow/spotty connection * I really hate waiting 10-30 seconds for my editor to start. Often I want to peek at code, then change my mind and want to edit it. I can remotely login and start my editor in less time than most IDEs take to load. * I like dropping to my shell (not just a shell) Who says what vim is meant to be? A lot of example vim setups I see are too much for me (too much to set up, too fickle to maintain, too slow in practice)...many of those apply to IDEs for me. But it's nice to see what's out there and how other people fit the pieces together.
- tzhenghao 9y agoI'll add one more suggestion: https://github.com/airblade/vim-gitgutter https://github.com/airblade/vim-gitgutter "A Vim plugin which shows a git diff in the gutter (sign column) and stages/undoes hunks."
- fourseventy 9y agoThats a cool plugin but I had performance problems with it once a file gets above about 1k lines of code so I had to uninstall it :(
- taternuts 9y agoI'll be honest, the only time I try to tweak my VIM setup to be close to an IDE is when I have no other options (developing on a remote box). It's always a pretty frustrating experience IMO.