5 ms·
Frankly I find vim an hindrance to the type of projects I work on. One of the most common things I use an IDE for is navigation (between files) and vim is not
by Illniyar 12y ago
Frankly I find vim an hindrance to the type of projects I work on.
One of the most common things I use an IDE for is navigation (between files) and vim is not very good at it compared to IDEs, here's why:
* no tabs
* no project structure
* in my IDE (eclipse based or intellij based) I can ctrl-click a class/object/other to navigate into that object's definition
* in my IDE I can search for classnames, I can press ctrl-T to find who inherits from something, ctrl-alt-H to find who uses something etc...
when I find myself actually writing code, it's usually a line or two in each of several files (because modern programming paradigms tell us we should split code as much as possible), or modifying some copy pasted snippet I found on google - so navigation is extremely important even when editing.
beyond that, there are simply some things that help writing code that a text editor cannot do:
* auto-complete(with annotation to tell you what the function variables are)
* debug inside your IDE
* run code-lint, auto-build on typing to detect errors, etc...
* auto refactor (I.E. extract method, move variable, extract class etc...)
* format all your files according to your pre-specified project guideline.
* sharing you IDE configuration with other contributors
* showing when files are/aren't in version control and integrating version control so that you view history in your IDE.
There are probably projects out there where a full-featured text editor is a real game-changer and is worth the days/weeks it'll take to use it intuitively, but I never worked or know anyone who worked on such a project (even when I started projects from scratch);
- wz1000 12y agoMost if not all of of these can be achieved using plugins. Some are present by default. > no tabs It does have tabs, they're just called buffers instead(there is something called "tabs" too, but they're not what you expect tabs to be) > sharing you IDE configuration with other contributors Sharing your vim configuration is as simple as sharing your .vimrc
- Illniyar 12y agoI think the major benefit I derive from what I mentioned is the constant visual cues and the immediate availability. With buffers (unless I'm missing something) you need to type a command to list all your 'tabs' and another command to get to the tab in question. Project structure is similar - it's always visible, and you can always see what other files are close by. I don't think that can be achieved with plugins, though I never knew there were plugins until now. Do people who use vim regularly install plugins for it?
- wz1000 12y agoYes, all of this can be achieved using plugins, including immediate visibility of tabs and project structure. Check out powerline(https://github.com/powerline/powerline https://github.com/powerline/powerline) or vim-airline(https://github.com/bling/vim-airline https://github.com/bling/vim-airline). A nice configuration for Haskell which I often use to bootstrap new machines is haskell-vim-now(https://github.com/begriffs/haskell-vim-now https://github.com/begriffs/haskell-vim-now). That includes almost all the features you mention.
- woogley 12y agoYou can use :tabe to open a new tab, and then `gt` and `gT` to switch tabs. This is somehow controversial to some[1] but it never bothered me. As far as file navigation though, I just use crtlp[2] [1]: https://stackoverflow.com/a/103590 https://stackoverflow.com/a/103590 [2]: https://github.com/kien/ctrlp.vim https://github.com/kien/ctrlp.vim
- wampus 12y agoAdd this[1] to .vimrc for easy navigation between multiple files in each tab: map <C-J> <C-W>j<C-W>_ map <C-K> <C-W>k<C-W>_ set wmh=0 Load a new file with the split command: :sp <file> and use Ctrl+j or Ctrl+k to switch between the splits. It's a handy way to organize and edit multiple files. [1] http://vim.wikia.com/wiki/Switch_between_Vim_window_splits_easily http://vim.wikia.com/wiki/Switch_between_Vim_window_splits_e...
- deleted 12y ago[deleted]
- DennisP 12y agoThe author of the article wrote an excellent vim emulator for Visual Studio, so I suspect he agrees with your points on the merits of IDEs :)
- thomasahle 12y agoI recently started using IntelliJ, and at install it suggested using the vim emulator. Being able to use vim shortcuts together with IntelliJ features has been one of my best editing experiences to date.
- snarfy 12y agoThe only one of those things I don't have inside vim is debugging, and mostly because I haven't tried. Plugins have come a long way. For C# I use OmniSharp for Vim.
- callahad 12y ago> sharing you IDE configuration with other contributors Check out http://editorconfig.org/ http://editorconfig.org/
- je42 12y ago* No tabs. -> multiple vim plugins provide really confortable tabs. * No project structure. -> plugin. if you want that kind of tree next to your editor. (i.e. Nerdtree) * in my IDE (eclipse based or intellij based) I can ctrl-click a class/object/other to navigate into that object's definition -> tag search plugin. Haven't played with it much though. * in my IDE I can search for classnames, I can press ctrl-T to find who inherits from something, ctrl-alt-H to find who uses something etc... -> I believe there are some plugins for but here i haven't seen anything good so far. * auto-complete(with annotation to tell you what the function variables are) -> you complete me. plugin. * debug inside your IDE -> good point. have to wait for Neovim for this - I believe. Installing current WIP version from neovim is on my todolist. ;) * run code-lint, auto-build on typing to detect errors, etc... -> syntastic. * auto refactor (I.E. extract method, move variable, extract class etc...) -> good point. don't know any good plugin. * format all your files according to your pre-specified project guideline. -> plugin.;) * sharing you IDE configuration with other contributors -> here truly most IDEs suck. For vim you find lots of shared vimconfig on github. * showing when files are/aren't in version control and integrating version control so that you view history in your IDE. -> if you need to do in the editor... there is plugin for that. However, i found git command line is usually find. and for more serious committing I use GitX (L).
- weaksauce 12y agoI used to use Gitx but source tree is considerably better.
- je42 12y agoi found source tree to be very slow for the repositories that I have to deal with. GitX (L) dealt with them much better.
- MetaCosm 12y ago> * in my IDE I can search for classnames, I can press ctrl-T to find who inherits from something, ctrl-alt-H to find who uses something etc... >> -> I believe there are some plugins for but here i haven't seen anything good so far. Language dependent, Go has "Oracle" for example, for finding callers, etc. > * debug inside your IDE >> -> good point. have to wait for Neovim for this - I believe. Installing current WIP version from neovim is on my todolist. ;) Clewn. > * auto refactor (I.E. extract method, move variable, extract class etc...) >> -> good point. don't know any good plugin. Language specific, Go has multiple and lots of people write small bits of script to do this -- but it is a place IDEs are far ahead of Vim. > * showing when files are/aren't in version control and integrating version control so that you view history in your IDE. >> -> if you need to do in the editor... there is plugin for that. However, i found git command line is usually find. and for more serious committing I use GitX (L). Nerdtree & git-nerdtree.
- StevePerkins 12y agoEh, half of this list actually IS possible with Vim, either through a plugin or simply out-of-the-box keyboard shortcuts. The other half are features that separate IDE's from text editors in general. I do agree that I'm infinitely more productive in an IDE than I ever would be with any plain text editor (e.g. autocomplete-hints, refactoring support, etc etc). After discovering the JetBrains suite of IDE's some years ago, I can't imagine using anything else for application development. However, the point of vi/Vim is not so much the editor application itself... but rather its keybindings and modal editing approach in the abstract. Those concepts are decoupled from the actual editor, because every major IDE has plugins which make them available in its environment as well. The "IdeaVim" plugin for JetBrains IDE's is amazing, letting you mix-and-match between Vim commands and normal JetBrains shortcuts in a very intuitive way (or at least intuitive if you're familiar with Vim). If you're happy with your current working environment, then rock on. But if you're fluent with vi/Vim (and it is a significant learning curve), then you can absolutely have the best of both worlds. To me, arguing about whether to use an IDE or an editor is pretty silly. But the question of whether or not to use modal editing and a suite of standard shortcut commands within an IDE is a much more interesting matter.
- lfowles 12y agoMy biggest problem with vim is that I can get it configured with all of the plugins to emulate a GUI IDE, but it does nothing to help if I can't remember the shortcuts. Off by one character? Whoops, you activated the RootNuker Plugin on Buffer 3. Discoverability is terrible, one of the few things that I feel is actually faster with a mouse.
- MetaCosm 12y agoAbsolutely. That said, I think modern IDEs suffer from huge discoverability problems as well. The truth is, when you have thousands of features, discoverability had to give way to documentation.
- aidos 12y agoThere's no doubt, vim isn't big on making it easy to find your way around. I don't think that matters so long as you're methodical in your approach to learning it. It's important to master the basics and then add new tools one at a time. The amazing thing about vim is that each new command can be composed with your existing knowledge set, so just learning what, say, 's' does gives you a whole lot more power. Also, while the discoverability might suck, the built in manual is just incredible.
- merger 12y agoIt becomes a lot harder to switch programming languages and tools once you are dependent on some of these IDE features. Switching from using Eclipse for Java to using Closure without quite the tooling you've had before could be pretty hard if you join a new team.
- jqm 12y ago-No tabs? How about :tabedit? -No project structure? Well, there is nerdtree. Or a separate terminal window open to the file system which is usually the way I do it. -Autocomplete with annotation? Nice plugin for that. -Debug? I'm running in separate terminal window anyway. I can debug there. -Auto refactor? No thanks. I'd rather do that myself. -Format according to guidlines? There is probably a plugin, but for the once or twice that happens third party tools work just fine. Don't need that in the editor. -Sharing your configuration? Very easy. Just copy your .vim and .vimrc files over. -Showing files in that aren't in version control? Remember my separate terminal window that's open? I don't want everything in the editor. But there is probably a plugin if you really need it. ____________ Here are the advantages: Cost, Ubiquity, works over SSH the same way. Takes two seconds to move my config files and I'm right back in the environment. Plus I know it and it is fast as heck. There probably some others I'm forgetting. Honestly, it sounds like you haven't taken the time to get to know Vim. And that's ok... if you have something that work for you then no need. But lots of the things you claim are advantages of your setup really aren't.
- threatofrain 12y agoIn my view, Vim is no longer just a program that people use, but a way to do things. In this view, I am hopeful for the NeoVim project to bring Vim-the-way to other editors, including your favorite IDE. One of my pains was that Vim-the-program was not ready to go, and that configuring or adding plugins to Vim was a real nuisance, and I think due to terminal limitations, Vim-the-program could never have some of the features other programs had.
- MetaCosm 12y agoThere have been a lot of replies addressing a few of your concerns, I will attempt to hit all of them. The only one that really has any no great solution is the refactoring support. > * no tabs There actually are tabs, but they probably don't work the way you expect, they are closer to viewports or workspaces, but they are there. You can also use assorted plugins to improve tabs and/or emulate them. > * no project structure Not sure I understand this way -- no enforced structure? Neither to IDEs, no tree viewer -- there are bunches of tree based file viewers. > * in my IDE (eclipse based or intellij based) I can ctrl-click a class/object/other to navigate into that object's definition This is supported by the tags system in Vim, which depends on ctags. :tselect, C-], lots more -- this exists out of the box. > * in my IDE I can search for classnames, I can press ctrl-T to find who inherits from something, ctrl-alt-H to find who uses something etc... This obviously very specific to some language you have in your head, as many of those things don't make sense in some languages. That said, this is supported in various languages by various plugins (In Go, Oracle for example). > when I find myself actually writing code, it's usually a line or two in each of several files (because modern programming paradigms tell us we should split code as much as possible), or modifying some copy pasted snippet I found on google - so navigation is extremely important even when editing. Agreed, which is why Vim has so many ways from jump-to-def to jump-to-file to various smart plugins for rails and C and <X>. > * auto-complete(with annotation to tell you what the function variables are) Gobs of plugins do this for Vim -- normally language specific and they tend to work rather great. > * debug inside your IDE See Clewn, full gdb support integrated with vim. > * run code-lint, auto-build on typing to detect errors, etc... Vim has all of that, syntastic will show errors in the left bar as you type, setting things to autorun is trivial, all major languages already have this. > * auto refactor (I.E. extract method, move variable, extract class etc...) Language specific (as is your IDE's features, because to do requires understand the language), but this exists in limited form for Go and C++ -- and I am sure others. The level isn't up to major IDEs. That said, many of these things are easily scriptable in vim. > * format all your files according to your pre-specified project guideline. Tons of vim support for this, even supporting standard 3rd party like EditorConfig. > * sharing you IDE configuration with other contributors I think you will find far more vimrc files shared in the wild than any IDE. > * showing when files are/aren't in version control and integrating version control so that you view history in your IDE. Fugitive has great time travel features for flipping through versions of files and seeing differences. Use git-nerdtree to add git status to nerdtree.