DEV Community

Discussion on: Who said that VIM cannot compete with IDEs?

Collapse
 
bendem profile image
bendem

The four features I use most in my IDE that are not available in vim or will be really hard to have working imo:

  • quick fixes (auto import, unwrap/wrap variable, surround with)
  • extract/refactor (extract to variable, to method, to field, rename symbol accurately across project)
  • navigation (jump to declaration, find usage)
  • type based autocomplete

those are based on code semantic, and are really good because the IDE understands the code, it's not just text, it's AST. That is, imo, the difference between text editors and IDEs, and the reason why vim will never compete with IDEs.

Collapse
 
bezirganyan profile image
Grigor Bezirganyan • Edited

Well, actually most of your issues can be fixed :) Yes they don't do the job for 100%, since as you said it doesn't understand your code, but it can come pretty close

Auto import

Python - vimpy
Java - JavaImp
JS - ImportJS

Syntax check

Syntastic or
YouCompleteMe

Refactoring

I've heard about clighter8, which can do some refactoring for C/C++, haven't checked myself though

Navigation

The goto command in YouCompleteMe

Type based autocomplete

YouCompleteMe

Collapse
 
ekaj2 profile image
Jake Duth

By the way, Vim will use ctags by default for jumping to definitions/declarations. Just do ":!ctags -R ." in the root folder (":pwd" to check and ":cd" to move, of course) and it will make the tags file for you. Then you can jump around with "Ctrl-]" with the cursor over the function/class/whatever you want to jump to; "Ctrl-T" returns to the previous file.

To add a bit more, the "Ctrl-]" will add buffers to the tag stack and "Ctrl-T" will go back up that stack, so that you can go into however many files deep and get back to the top.

Some things in Vim that I didn't get in an IDE (keep in mind I decided to switch to Vim less than a month ago):

  • Macros, ., and mappings all quickly do whatever I want to whatever I want...I will never have to sit at my computer and do the same things over and over again just because I couldn't figure out how to automate it in my IDE
  • Jumping to the sections of code in which I have made changes with "Ctrl-o" (and forwards with "Ctrl-i")
  • Branched undo hierarchy - I haven't actually gotten into this yet, but know it exists and can't wait to learn it...I've been messed over with the lack of this feature multiple times before
  • Unity 3D integration - I'm currently working on a project in Unity (which I've got plenty of experience in) and I decided that I am not going to keep trying to deal with Visual Studio and MonoDevelop. Now I can actually recompile my code in two keystrokes, search the error messages, and jump to the exact line in my file in which the error occurred (this last one is the only one I could do in Visual Studio).
  • Vim is available anywhere. I have it on Windows 7, Windows 10, OSX, CentOS 7, Raspbian, Ubuntu, and Android. I use it literally every day on at least 4 of those. I think Blender and Slack are the only other apps I have ever used that runs on all of these operating systems.

I currently have 0 plugins and have not downloaded anyone's .vimrc