DEV Community

loading...

Who said that VIM cannot compete with IDEs?

Grigor Bezirganyan
Data Scientist
・3 min read

main

Every developer has a favorite text editor or an IDE, and as long as developers exist, Text Editor wars are not going anywhere. The two main forces of the so called "Editor War" are Vim and Emacs. They are both great and can do a lot, but... but they are not an IDE.

I've heard many developers, who are in love with vim or Emacs, but use IDEs like clion, CodeBlocks, VisualStudio, etc., because of certain features.

But wait! What if I tell you that you can turn your vim or Emacs into an IDE? Yes, it will work, and in majority of cases it will work better and faster than your traditional IDE, at least for C/C++ it does.

Configuring vim to become an IDE

Well, the main basic features of an IDE are

  • Code completion
  • Error detection
  • Debugging

Of course there are many more features that IDEs have, and it is possible to configure vim to do most of them, but in this post I will only speak about these main three.

So let's look at each feature and try to make it work in vim

Note: The configuration is for C/C++, but with light modifications and right plugins it is possible to make them work for your desired language.

Code completion

Vim already has a built in code completion and all you have to do is type the starting letters and press crtl + n, and it will bring suggestions from your code. But that's not enough. All IDEs have smarter code completion, which will bring suggestions not only from the code you've already written, but from the libraries you use.

You can achieve such feature with a vim plugin called YouCompleteMe.

All you have to do is install the plugin and configure for your desired language and libraries.

Vim code completion

Error Detection

One of the things I like in Vim is when you use make command from it, in case of errors it brings the cursor on the line, where the first compile error occurred. However, the IDEs do a lot more than that. They detect the errors, right after you type
them.

For vim, the same functionality provides the YouCompleteMe plugin, which we've already discussed above. After typing, when you press the Esc key, in case of compile errors, it will highlight the code parts causing the errors.

Vim error

Debugging

When I was just starting to use Vim, for debugging my programs I had to open another terminal, run gdb, type ref and try to use not so user friendly interface, without syntax highlighting. When writing command I couldn't even use my arrow keys. Well, that sucked.

Then I discovered the Conque-GDB

Conque-GDB is a vim script that integrated GDB into your vim. Cool right? What's more cool, is that it shows the breakpoints or segmentation fault location right on your code in vim. You can even use your arrow keys moving your cursor!

I will be honest, I hated GDB even after using this plugin, until, one day, during a Programming Olympiad I had to use Visual Studio's debugger. Well I couldn't even find where my program threw a SegFault. So what I did (I don't even know if I had the right to do so) was to boot Linux from my USB and use Conque-GDB.

Vim gdb

Other plugins?

There is a very awesome website full of various vim plugins, called vimawesome.com. You can find many many more plugins there and make your vim much closer to an actual IDE.

You can comment about your vim configuration below. By the way this is my first blog post, so I am waiting for your positive criticism in the comment section.

source

Discussion (60)

Collapse
xowap profile image
Rémy 🤖

Well, I used to put a lot of plugins in my Vim and so on... But at some point I realized that I'd rather spend my time coding with PyCharm rather than tuning tools that aren't meant to be used in that way. But hey, the tool's just a tool anyway...

Collapse
aghost7 profile image
Jonathan Boudreau

I think vim is meant to be used this way, especially if you look at the new features in vim 8.

Collapse
xowap profile image
Rémy 🤖

I think it's a text editor from the early 90s, soooo... Not really. I'm not saying it's not capable of it, and actually I'm a heavy vim user but still, I'm not ready to spend time to match the feature level that PyCharm has out of the box.

Thread Thread
aghost7 profile image
Jonathan Boudreau

Linux is from the early 90's - does that mean it isn't meant to be utilized for modern purposes? I don't understand your reasoning.

Thread Thread
xowap profile image
Rémy 🤖

Oh it certainly is not. In fact, it's designed to be not portable at all. And from a OS design standpoint it's not even standing out since there's a lot of better ideas implemented out there.

But some people managed to make it reasonably user-friendly out of the box (many distros, Android, TVs and much more). Which means I'm not spending hours setting it up because it's already done.

In the case of vim, it's not already done and although there is pre-made plugin packs and so on there is just so many pages of documentation to learn that it sounds like it's not worth it.

So let me correct what I said, vim is not made for that and nobody managed to make it fit with a reasonable amount of effort. Or at least the amount I'm ready to put in it.

Thread Thread
aghost7 profile image
Jonathan Boudreau • Edited

Oh it certainly is not. In fact, it's designed to be not portable at all.

Not be portable? What do you mean?

And from a OS design standpoint it's not even standing out since there's a lot of better ideas implemented out there.

Why should that even matter in this case? An OS should be boring.

So let me correct what I said, vim is not made for that and nobody managed to make it fit with a reasonable amount of effort. Or at least the amount I'm ready to put in it.

If you're looking to get vim running quickly there are plenty of distros out there like spacevim, janus, and spf13 which are for the most part plugin bundles. I don't understand why you're still saying vim is not "made" to be used like and IDE when its pretty clear from the creator of VIM that it is a goal.

Thread Thread
bezirganyan profile image
Grigor Bezirganyan Author

Well, I like to compare Vim and IDE like Arch Linux and Ubuntu. Ubuntu works out of the box, and for Arch Linux you need to configure everything from almost scratch. But after the time you spend you get slim and fast machine configured for your needs.

As it is not possible to say which one is better, Ubuntu or Arch, since for everyone its different, the same way you can not tell what will be better for a particular person, vim or IDE.

Thread Thread
xowap profile image
Rémy 🤖

Regarding portability of Linux, I mean this.

Regarding Linux not standing out, I'm talking about containers, micro-kernel, next-gen file systems and so on. Look at Solaris or Plan 9 and you'll see that Linux is pretty late on many things.

My whole point is: if you love vim go for it, I don't care. But I personally think that it's not worth spending time learning this while there is muuuch simpler options out there and would certainly not recommend that to beginners.

Thread Thread
bezirganyan profile image
Grigor Bezirganyan Author • Edited

That's why I said, for every particular user it is different and you cannot say which one is better. If you like IDE, than use it, if you like vim/emacs, then use vim or emacs. They all are tools after all, what matters is the code you write with them.

This post wasn't to convince people to use vim instead of an IDE, but for people who like vim, but don't use it foe missing certain features :)

Thread Thread
pianocomposer321 profile image
pianocomposer321 • Edited

Regarding vim being an editor from the early 90's:

Windows is an OS from 1985. MacOS from 2001. Linux, as mentioned above, is from 1991. If none of that means anything to you, how about this - InteliJ IDEA is an IDE from 2001. Sounds pretty outdated to me ;-).

My point is, you can't judge how outdated something is by its initial release, but by its latest release. Vim's latest release was literally 6 hours ago. And the one before that, 8 hours. The one before that was less than an hour before the next one. Far from being outdated, vim is in very active development.

Thread Thread
xowap profile image
Rémy 🤖

True enough :)

Collapse
lietux profile image
Janne "Lietu" Enberg

You forgot project-wide refactoring, quick navigation (e.g. CTRL+click on a function call to jump to source), code extraction, automatic reformatting, version control integration (to e.g. highlight which bits you've changed since last commit), file history management (to see the different stages between now and your last commit), code structure views, and the crazy amounts of other features you find in modern IDEs that even I don't use (automatic deployments over SSH/FTP, DB clients, shells, etc.)

And better yet, all this comes in a relatively easy to understand package in an IDE, instead of one of those glorified text editors. Please stop comparing text editors with syntax highlighting and a few other simple features based mostly on external scripts with IDEs. IDEs used to be heavy, now you should have at least 16GB of RAM on any old laptop, as well as an SSD and a decent CPU, and suddenly these convenience features come with practically no latency penalty.

Sublime text is not an IDE. Vim is not an IDE. EMACS is not an IDE. They are text editors. Very good at their jobs, but not IDE replacements.

Collapse
gerardbm profile image
Gerard • Edited

You are talking from the ignorance. First of all, you put at the same level Vim and Emacs with Sublime Text. Sublime Text is just a text editor, and you are right with it. However, Vim and Emacs are much more. Actually, Vim and Emacs are better than any IDE, and I'm gonna demonstrate you that with arguments.

Vim and Emacs are just a core, and you need to extend their functionalities using plugins and, why not, functions written by yourself using VimL or eLisp.

Now I'm gonna talk about Vim (as a Vim user), with three years of experience, and more than 20 years programming using a lot of IDEs from Windows and GNU/Linux. Sorry for the 'ad hominem' fallacy, but I know what I'm talking about. :D

You say he forgot about...

'project-wide refactoring'. There are a lot of plugins that do it really good. However, it depends on the language, of course. It's possible that there is not a refactoring plugin for a specific language. And if you compare Vim to all the JetBrains IDEs, of course JetBrains wins. You are falsifying the debate! Can NetBeans refactor Python, C# or Perl? No! It's an IDE? So what?

By the way, IDEs refactor code in a very simple way, and if you have to do it recursively, you can do a specific function in VimL to do that. It's easy. If you have to do complex refactoring, you better do it by hand. An IDE will not program for you.

'Ctrl+click to navigate to a function'. It's so easy: just type 'gd' (go to local definition), or type 'gD' (go to global definitioin), or press Ctrl+] if you have a tags file. I don't need to get the mouse and press Ctrl+click, hahaha. Actually, I rarely use 'gd' because I programmed a GrepWrapper which tells me all the lines containing a text or a REGEX. Then I can jump to it. I can decide if it's for the current buffer, opened buffers or full project. It's not the same, I know, it requieres one more step, but it's better because I like to see more information. There are tens of plugins to go to a definition in any language, for example, for ctags, cscope...

'code extraction'. It's refactoring. As I said before, there are a lot of plugins do it very efficiently. Vim-refactor can extract Function, Variable, Type, Getter and Setter from C, C++, Java, Pascal and VimL. Just a plugin. There are more plugins.

'automatic reformatting'. This can be done as well with a lot of plugins and a lot of tools. For example, to reformat SQL sentences I use an external tool (Unix) called sqlparse. To reformat Python, JavaScript or C++ I use other plugins. I normally don't need it. You can reformat everything on Vim, though. I can minify and unminify every JavaScript code.

'control version integration'. Of course Vim has it. The plugin GitGutter will show the lines modified, the lines removed and the lines added. You can configure it with a lot of settings that your IDE don't let you change.

Then, vim-fugitive is a very nice tool to operate in git into Vim. Most of the times I prefer to use the terminal CLI, though. Using vim-fugitive I can compare the current version of the buffer with the staged version, and I can compare it with the last commit. I can compare it in a vertical or horitzontal way. Your IDE can't do that.

Also, I can jump between GitGutter hunks very easily and very fast with shortcuts. You IDE can't do that.

I also can preview the changes of a hunk between current buffer and staged area, with Ctrl+g (toggles the preview). You IDE can't do that.

With the plugin GV I even can navigate between old commits with all the benefits of Vim. It's so easy and comfortable! And your IDE does it in a ugly an unefficient way, using the mouse and don't having the Vim mechanisms to make your life easier (grep into it, for example; search using REGEX into it, for example, and so on).

'code structure views'. Of course, Tagbar does it very good. I open it with Ctrl+t and I close it with the same shortcut.

My Vim does everything your IDE does, 100 times better; but your IDE does an 1% of what my Vim does, honestly.

I'm using Vim with 65 plugins and 1500 lines of configuration. It loads in less than a second, and I don't need a 16 GB of RAM. Every second spent on it worth it. My productivity is really high. I have this configuration in github, so I can clone it into a new machine and I can edit my programs in an instant.

Navigation in Vim is so fast and so good.

  • Can your IDE search and replace text using REGEX?
  • Can your IDE search a REGEX into an open file, all opened files or all files of a directory, recursively?
  • Can your IDE search a REGEX to the history of old commits? :)
  • Can your IDE combine the powerful of tools like grep, sed and awk into the editor? :)
  • Can your IDE combine all Unix tools into the editor? For example, sort, to sort alfabetically a selected text :D
  • Can your IDE visualize all the changes you did in a document, even when changes are in a different branch, normally lost? Haha :)
  • Can your IDE comment a block of text in any language, in several formats and allowing you to configure every language?
  • Can your IDE run/execute a selection of code? :)
  • Can your IDE execute a script into a new tmux window? Of course not. Vim can use tens of windows and splits to show information about everything you need, through a multiplexer!
  • Can your IDE align hundreds of lines with a single command, indicating from what character do you want the alignment?
  • Can your IDE wrap and unwrap in several lines a list or a dict? Well, in this case, I think your IDE does it as well.
  • Can your IDE preview a markdown in real-time, as you type, in your browser?
  • Can your IDE preview LaTeX in real-time, as you type, and export it to PDF directly? :)
  • Can your IDE reselect the last selection?
  • Can your IDE go back to last cursor position? And the other last?
  • Can your IDE save cursor positions as marks and navigate between them easily?
  • Can your IDE show relative numbers?
  • Can your IDE navigate without having to move the scrollbar? :D
  • Can your IDE search the selected text?
  • Can your IDE correct your spelling in any language? Vim can do that without plugins.
  • Can your IDE switch lower-case to UPPER-CASE to Camel-Case any selection?

Since you have to use the mouse for every shit you do, then you are not productive at all, you are losing time.

Moreover:

  • Vim has a terminal and I even don't need it because I'm using tmux.
  • Vim can also debug using plugins: Conque-GDB, vimpdb, and so on.
  • Vim can also lint code in real time, using the plugin ALE.
  • Vim can also insert snippets of code, autocomplete any language, etc.
  • Vim can also navigate very fast between documents of a project, there are a lot of plugins for it, like FZF, CtrlP, etc.
  • Vim can also rename files, change file permissions, etc.

Actually Vim can do everything you would do in a Unix terminal, thanks to the pipeing. Only with that, Vim wins any comparison.

So please stop talking from the ignorance. Thanks.

IDEs are good, however, Vim and Emacs are better.

Have you ever heard of the art of Unix programming? :)

Collapse
lietux profile image
Janne "Lietu" Enberg

I'm too lazy to read past your first few lines as you're obviously ignorant on the subject. Sublime Text is not a text editor, it's exactly like Vim and Emacs with a rich ecosystem full of extensions, which is even better than those alternatives.

packagecontrol.io/

Also in the future you should refrain from trying to "raise hell" 8 months after everyone else stopped commenting on the whole subject.

Thread Thread
gerardbm profile image
Gerard

You say you are «too lazy» because you don't have arguments to answer me. That's good. Others will read you had the oportunity to answer me and you decided to use fallacies to avoid the subject. Nice :)

Sublime Text is not better than Vim and Emacs at all. I already know packagecontrol, and actually I published a plugin for Sublime Text 3 (11k installs). So I'm not so ignorant as you thought, my dear.

There are a lot code editors with a plugins ecosystem, and this does not mean they are similar to Vim an Emacs. Atom also has plugins. VSCode also has plugins. Even IDEs have plugins. The possibility of adding new features through plugins is really extended, and that does not convert all editors to an identical tool, right? That's Logical Thinking I.

I commented here since it's possible to comment here. It's not a forum, it's a post in a blog format. I'm not breaking any social convention; and of course you are nobody to say others what they have to do.

Lessons, not even one. ;)

PS: BTW, there's only one case I would use an IDE instead of Vim: Java. Then I would go for JetBrains IDE or I would use the combo Eclipse+eclim. Anyway, you are not interested on this subject, I'm explaining it to complement my old post.

Thread Thread
redsofaforeveryone profile image
RedSofaForEveryone • Edited

You crushed him, Gerard.

Registered just to say that. Thank you.

Thread Thread
lietux profile image
Janne "Lietu" Enberg

Hardly. There's simply a point where an argument becomes pointless.

Thread Thread
gerardbm profile image
Gerard

Good morning, Duke Lietu.

If you had an argument, you would explain it.

As I can see, you think that an IDE has some "magic" or secret algorithms, and you think these algorithms are not allowed to be implemented into any other program/plugin. It's ridiculous.

That said, if you need an IDE to do refactoring and extraction to fix «stupid shit that you just shouldn't be doing» (I'm quoting you, here), then you should get more experience into programming, because these actions are implemented to help new programmers without experience or to fix code written by programmers without experience. And if you need to change text recursively in the full project, with grep, sed, awk, ag (Unix tools) you should have enough, because they are better, and you can use them into the terminal, into Vim, into Emacs. But not into Sublime Text 3, not into Atom, not into any IDE.

In essence, Vim is a Unix tool and you can use all the Unix tools into Vim.

An IDE has tools to debug, tools to check syntax and tools to build software fast and quickly. Most of the times, these tools are subjective implementations by the IDE developers, so these tools are not the official ones.

For example, you can check the Perl syntax using the command "perl -c " from the terminal, using the official package, or into Vim using the command ":!perl -c %". Why would you use an IDE with its own Perl syntax implementation, just because it has unified tools organized into drop-down menus? It's ridiculous.

You can debug a project using the gdb package from any Unix terminal, or into Vim using the command ":!gdb", or using one of dozens of plugins that integrate gdb in Vim with added features, like conque-gdb, lldb, pygdb, clewn, pyclewn, vim-debug or vimgdb to step through the source code. There are dozens of tools to do one thing, you can choose the best to fits your needs or even you can modify them because they are open source. Try to do this in an IDE.

You can compile C/C++ using gcc from the terminal using the command "gcc ", or you can use it into Vim with the command ":!gcc %". Moreover, you build fast and quickly customizing a Makefile, then you would use the command ":make", or simply configure a shortcut to build faster, for example "nnoremap ii :make". Then you can compile faster after editing the code by pressing «,ii» (sic), without needing to get the mouse and point&click.

I can do things in Vim that you can not even imagine.

You said before, the following text:

«JetBrains alone makes IDEs for C/C++, C#, F#, Go, Groovy, Java, JavaScript, TypeScript, Kotlin, Objective-C, PHP, Python, Ruby, Scala, and Swift. They also support all the companion languages like HTML, CSS, SASS, SQL, JSX, BASH, YAML, JSON, etc. that you frequently use when developing your applications.»

You can use all of these languages in Vim (excepting proprietary languages, such C#), using the official tools to check syntax, compile, build, etc, from a Unix environment; it's better than using subjective implementations. To program in C#, use Visual Studio or VSCode. Of course.

Do you really think Vim does not support, for example, Ruby, JSON, Bash, Go, TypeScript or Swift? You are very funny.

With Vim and Unix tools ecosystem, you have the maximum control of a project. Of course I wouldn't recommend Vim on Windows, where Unix tools are missing. Since you can use all of them in Vim and pass the data into it, there's nothing better than Vim running on a Unix-like system, like GNU/Linux, FreeBSD, macOS, etc. Also, one can mix these tools to do new functions/tasks into the editor. As you can see, Vim is not only an editor with plugins, it's also the code editor of Unix. I can say the same for Emacs.

Have a good day.

PD: Thank you, RedSofaForEveryone for your kind words.

Thread Thread
lietux profile image
Janne "Lietu" Enberg

If you had an argument, you would explain it.

No, and that's a stupid expectation.

I've said everything that needs to be said on the subject of Vim, and nothing worth commenting on has been added to the conversation.

then you should get more experience into programming, because these actions are implemented to help new programmers without experience or to fix code written by programmers without experience

This really shows your ignorance. You sound like you've got a couple of years of experience behind your back and now feel like you know everything. Everyone makes mistakes, nobody's code is perfect, ever, as in the real world requirements change over time. Code needs frequent refactoring, and the better your tools are for that the better you will be at your job - making the best software you can in the amount of time you have.

And if you need to change text recursively in the full project, with grep, sed, awk, ag (Unix tools) you should have enough

Just, lol. Good luck with that.

I can do things in Vim that you can not even imagine.

That really states just how intentionally ignorant you are being. I know what Vim can do, and no me listing various IDEs JetBrains makes does not mean that I think you can't get some support for them on Vim.

... now goodbye.

Thread Thread
gerardbm profile image
Gerard

Definitely, your code needs to be refactored, so you are the ignorant here. I've been programming since 1999, when I started programming in C++ using an IDE (yes, an IDE). You clearly don't know Unix so you talk from the ignorance, mainly when you say you know Vim. You can't know Vim if you even don't know Unix tools. You are really funny. Heh.

I had to refactor when I was learning Java, too verbose language, having to modify a lot of files requiring a parser. Nowadays there's a parser for Vim, as well. However, I'm not interested on Java anymore because other languages fit better on my needs: C/C++, Perl and Python (my general purpose tools), Go (concurrency), Rust (interop), RoR (web-dev), JS (web interactivity), Bash (system config)... All the languages I mentioned are perfectly usable in Vim, and you would change your opinion if you were more open.

I think you are in the same point I was a lot of years ago, requiring an IDE because you think it's the best, as I did at some moment of my life until I discovered Vim.

Let me say you won't have benefits of using Vim if you don't configure it. Of course, Vim without plugins and without Unix tools is a simple code editor, just a bit better than nano. Vim with plugins can do the same as any other code editor, and Vim with Unix tools using the official syntax checkers, the official debuggers and the official compilers is better than any IDE using subjective implementations.

If you can't understand this, then there's nothing to do with you. Good luck :D

Thread Thread
lietux profile image
Janne "Lietu" Enberg

Dude, nobody cares how long you've been programming, or with what languages. Your random outbursts are just making your argument less interesting. Your random bashing of Java is also completely irrelevant to the discussion.

I think you are in the same point I was a lot of years ago, requiring an IDE because you think it's the best

Nice try with the combined strawman & ad hominem -fallacies.

Thread Thread
gerardbm profile image
Gerard

You say «nobody cares how long you've been programming» after I answered this because of allusions, when you said «you sound like you've got a couple of years of experience behind your back and now feel like you know everything», so when you then say «Nice try with the combined strawman & ad hominem -fallacies.», apply this to yourself, because I said this going down to your level. ;)

Thread Thread
johnpt profile image
john-pt

Thanks Gerard, I didn't know many of the things you listed could be done with Vim + Plugins.

PS. And yes, you crushed him.

Thread Thread
pianocomposer321 profile image
pianocomposer321

This was one of the most interesting things I've read in a long time. Thx Gerard.

P.S.
A little less harsh language and cursing would be better though. It really doesn't add anything to your argument.

Collapse
gcorrel profile image
gcorrel

Who!! and thanks for your amazing and deeply insightful contribution, response and commenting. Just reading your lines, above and below is quite educative. As a VIM lover/nerd, I was reading to get convinced by any means why I should switch to an IDE but haven't seen a point, convincing enough yet. And not even from "Duke Lietu" as you referred to him, having only grudges and not interested in contributing with mind-changing points. For me, if I do have knowledge of something and feel very confident about it, I'd surely defend it to the last, except i get to a point, I'm convinced beyond reason then, I'd feel NO shame, agreeing to the huger and greater points. Afterall, no one is above learning and improvements. That's what life is all about eventually.

Categorically stating though, YOU WON HIM HANDS DOWN!!! NO ARGUMENTS.

Thanks for contributing all the same.

Collapse
singalen profile image
Victor Sergienko • Edited

Coming from CLion -- here's a data point: "Yes" to all of your questions except for maybe "execute a script into a new tmux window" and "show relative numbers" (what relative numbers?.. what for?..)
What is more important, it does it more uniformly, not having to memorize a separate keyboard spell for each of these use cases.

What vim CANNOT do, for example, is to do a CORRECT navigation in C++. ctags/cscope are doing a very poor job indexing C++, especially modern C++.

CLion has an absolute killer feature that only one competitor (Eclipse CDT) possesses: ability top statically build a call hierarchy. This is so valuable when analyzing execution flow. AFAIK, no add-ons that can do it for other IDEs exist.

Collapse
fallast profile image
Brian

jesus christ gerard, you ate him up lmao,i literally registered to comment this and thank you a lot for all that information, i just started using vim since 2 months ago and i love it so far cheers

Thread Thread
lietux profile image
Janne "Lietu" Enberg

I wish you kids had better things to do in your life than to register to comment useless things like this 😄

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

As I've already mentioned in other comment, most of your issues can be fixed :) Again, vim is not an IDE, and it is not meant to be. What I like in vim, is that all I need to have is my .vim folder and .vimrc file, and I can have my vim configuration with all it's IDE like features in any computer or remote server. Good luck writing code on remote server with an IDE ;)

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

Version control integration

fugitive.vim
vim-gitgutter

Automatic deployment

gist.github.com/noelboss/3fe139270...

Collapse
lietux profile image
Janne "Lietu" Enberg

I don't think you follow. "I heard X can do some refactoring for Y" is not what I'm talking about, I'm talking about full project-wide refactoring for any language you're working with. That's an IDE.

If you're editing your code on a remote server, you're probably doing changes in production or some other incredibly stupid shit that you just shouldn't be doing.

Your tools seem to mostly work for C/C++ (very few sane people work with these anyway), and only a few other languages. JetBrains alone makes IDEs for C/C++, C#, F#, Go, Groovy, Java, JavaScript, TypeScript, Kotlin, Objective-C, PHP, Python, Ruby, Scala, and Swift. They also support all the companion languages like HTML, CSS, SASS, SQL, JSX, BASH, YAML, JSON, etc. that you frequently use when developing your applications.

If you want to feel like a kid in the playground you can mess around with your text editor and your plugins, if you want to maximize your productivity (and you should if you care about your work at all) you need an IDE.

I use text editors frequently, for managing large text files, big regex replaces and similar things that text editors are good at. When I want to get work done I use an IDE.

Thread Thread
lietux profile image
Janne "Lietu" Enberg

Oh and if you ever have a legitimate reason to edit your code remotely (which is incredibly unlikely), well, JetBrains IDEs come with SSH sync etc. features - you save a file it gets synced on the server. Whoah, mind = blown, right?

Thread Thread
bezirganyan profile image
Grigor Bezirganyan Author • Edited

Your tools seem to mostly work for C/C++ (very few sane people work with these anyway)

Really? Oh,then me and all the employees of the company I work in, as well as the developers of Linux, Adobe, Chrome, Firefox, Mac OS, Windows, etc., are insane people? Good to know :)

If you want to use an IDE, use it, no one forces you to go to vim. I didn't write this post to convince people to use vim, but for people who actually want to use it.

Collapse
stealthmusic profile image
Jan Wedel

I was working 1/2 year with vim and all plugins I could find on a C++ project and it was OKish. Currently I still use vim on servers a lot, but I develop Java with IntelliJ which just feels like the future to me. It just does so much more than auto-completion. There is ALT-ENTER which is bascally my brain to computer interface aka „do the right thing“. And this is just a tiny fraction, everything is just well-though and it gets better and better every release. And it’s fast compared to other IDEs, maybe not as fast as vim though but most importantly fast enough.

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

Yes, IntelliJ is really good, I use Android Studio for java and really like it. But one of the things I like in using vim (or other text editors), is that you really understand what's going on in your code. I tried to use clion for C++, but went back to vim, as I felt more comfortable in it :) Everyone has his preferences, after all the most important is to write a good code

Collapse
stealthmusic profile image
Jan Wedel

That’s absolutely right. Exactly because of that reason, I don’t force anyone my team to use any specific editor or IDE. Anyone could use vim, IntelliJ, eclipse or whatever. However, after some pair programming and coding dojos that demonstrated how power users use IntelliJ, everyone switched and now we only use IntelliJ.

Thread Thread
bezirganyan profile image
Grigor Bezirganyan Author

The contrary happened in the company where I work in. At first, when I was still in internship, I was using sublime text for writing the code, but since everyone from whom I asked help opened vim to review my code, I gradually switched to vim. :) I think it depends on person and the environment he/she works in.

Thread Thread
stealthmusic profile image
Jan Wedel

Absolutely! I also love Sublime, I use it as multi purpose editor on both Mac and Windows. So my personal toolset is IntelliJ,
sublime and vim and I choose them where they fit best.

Collapse
aleksikauppila profile image
Aleksi Kauppila

I tried to make Vim work as an IDE. I really thought it could work out for me. After i had installed my 20th plugin i thought maybe i should just go with a Jetbrains IDE. IdeaVim works decently enough and i also get the support of a really powerful IDE out of the box.

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

For what language did you tried to configure? I am using 6 plugins and consider disabling the YouCompleteMe. It works fine for C/C++ and Python. The only IDE I currently use is Android Studio. It would be a bit masochistic to write android programs in vim :)

Collapse
aleksikauppila profile image
Aleksi Kauppila

I work mostly with PHP. I need to be able to navigate the codebase efficiently, do usage searches, generate code on docblocks, resolve merge conflicts, check when a line has been edited by someone, browse the database, etc, etc. And PHP is an interpreted language so i don't even have to deal with compiling stuff.

The thing with VIM is, that the developer tries to make up the shortcomings by endless configuring to just get it to do the stuff that makes eg. PhpStorm so powerful.

Thread Thread
bezirganyan profile image
Grigor Bezirganyan Author

I haven't done any php, so I can't really recommend anything, but the most important thing in coding aren't the text editors or the IDEs, but the code you write with them, so if you feel comfortable with PHPStorm, you are right, it doesn't cost the time to configure vim for hours. My problem was that for C/C++ coding, no IDE felt me so comfortable to use as Vim, so I configured it over time :)

Thread Thread
vivoconunxino profile image
vivoconunxino

github.com/vivoconunxino/vimrc-php

Vim for Php with all the stuff you requested. Yep, it took me hours, but as Grigor said it was a joy configuring it over time.

Collapse
lambdude profile image
Ian Johnson

I've been using Vim and the command line together as an IDE for quite a while now. I started this after reading Unix as IDE.

Bonus: I got really good with tools like grep and find because I had to run them myself instead of clicking a button in an IDE.

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

Yes, by combining several unix commands like grep, find, awk, etc. you can achieve most of the functionalities of the IDE. The bad thing is they are a bit hard to learn, but over time when you master them, they seem too easy to use :)

Collapse
jvanbruegge profile image
Jan van Brügge

For me, Vim is the only editor I can use. I have problems with wrist and arm pain. Those problems originate from sudden movements in my wrists. So every time I use the mouse it hurts. The more I use it the more it hurts. Same for shortcuts that use a lot of ctrl, alt or similar modifiers.

Vim on thr other hand allows me to keep my hands in a natural position. With capslock remapped to escape, i rarely have problems.

I used IntelliJ for some personal Java development a few days ago and instantly it hurt again. I also cannot comprehend how people can like IdeaVim. I can't even switch tabs with standard vim commands! I cant open files like i do i vim. Everything just possible with some strg or alt key combinations.

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

I use java only for android, and I think it will be a bit masochistic to use vim for it :) but other than that, vim is the only way to go for me. Recently I tried to use vim plugin for atom, I though it would bring the best parts from two worlds, but it was the opposite. So I went back to natural vim.

I think that if configured properly, after vim you cannot go back to anything other. And yes, hand movement is minimal with vim, you don't even need the arrow keys :)

Collapse
jvanbruegge profile image
Jan van Brügge

I works quite well actually. I use LanguageClient-vim and the Java Language server. It can read my gradle build file and I get autocomplete, errors and similar. Here are my dotfiles if you are interested in the setup

Thread Thread
bezirganyan profile image
Grigor Bezirganyan Author

Really? Cool :) I will give it a try. And I think I will steal some of your dotfiles :)

Collapse
rranslam profile image
Rob Ranslam

Yes... Couple it with tmux and it's faster and better than any Eclipse-based/like IDE

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

Yes, although I don't currently use tmux, but I want to start using it :) I think I will spend some time during the holidays on learning it!

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 Author • 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 Dube

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

Collapse
codemycoffee profile image
CodeMyCoffee

Honestly I like to think that Vim is just a set of neat shortcuts that I can apply with one plugin to my favorite IDE or text editor(with various degrees of success of course). But trying to use Vim as a full IDE it seems like waste of time to me. With a decent modern laptop no IDE feels "slow" or "clunky", not to mention text editors are already pretty fast, and you get out of the box wonderful features with a wonderful GUI (don't be scared of using a mouse sometimes folks)
Either way, that's my opinion, and the article was actually nice if someone wants to use Vim that way, well done mate!

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

Thanks man :) What I like in vim is that you can build it yourself and configure for your needs. But yeah, sometimes an IDE can save a lot of time!

Collapse
aghost7 profile image
Jonathan Boudreau

Ever tried lldb.nvim? Been wondering if I should use it for a rust side project. I also recommend the ale plugin for automatic errors/warnings in your gutter.

Collapse
bezirganyan profile image
Grigor Bezirganyan Author

I am more a GDB user. I once tried to use lldb for debugging the C++ part of code in Android Studio, and I think it feels like using Emacs fr vim user :) But if you are comfortable with it, why not give it a try? Inform me about your experience.

I've never heard about ale, thankn you :) I was considering disabling YouCompleteMe since I wasn't using the completion much, and I mostly liked its error detection. So I think I will give it a try!

Collapse
aghost7 profile image
Jonathan Boudreau • Edited

There's always the goto definition that you could use with YouCompleteMe. Not sure how useful it would be in your case, but I've used it quite a bit with Python.

Thread Thread
bezirganyan profile image
Grigor Bezirganyan Author

Yes it's really helpful, it's one of the things I really like in YouCompleteME :)

Collapse
callpri profile image
callpri

I prefer to use Codelobster IDE - codelobster.com