DEV Community

Cover image for "Damn! Now I have to use Vim"

"Damn! Now I have to use Vim"

Richard Lenkovits on August 30, 2019

That awkward moment Let's say you arrive to some cloud console shell, or you ssh over to another host without the proper flags and end u...
Collapse
 
notsag profile image
Maxime Gaston

Hey Richard,

Nice beginners tutorial, I'm always glad when I see a Vim post 😉

Regarding recommending Vim with plugins as an IDE, I would say it depends.

I use Vim and a few plugins as an IDE, and would totally recommend it!
Although, I would not use it for everything.

The problem with vim mode/plugins/keymaps for any IDE is that it doesn't allow me to be completely free of using my mouse. And honestly, using hjkl to move and a few vim basic commands is mostly making it difficult for nothing IMO. If I have a graphical editor and ctl-F is available, why should I use / to search something?
So to me, it's the real Vim or nothing.

As a SRE (and not a dev), I spend most of my time in a terminal, runnning commands, writing scripts, ansible playbooks, kubernetes manifests...
Doing all that, I find it more productive for me to use Vim with plugins such as : YouCompleteMe, ansible-vim... and stay in my terminal.

But of course if I was working on a full website, desktop application... I would choose a full graphical IDE.

Collapse
 
pencillr profile image
Richard Lenkovits

Hi, thanks for the answer. Totally got your angle! I do both web development and DevOps, and I also spend a lot of time doing similar things, writing ansible playbooks bash/python/groovy scripts, configuring openstack, etc. If you spend much time in the terminal, vim is much more comfortable. It's fast and it's always around.

Collapse
 
lcoenen profile image
Loïc Coenen

I vim everyday in my 9-5, angular developer work and it's a nightmare. Not because of vim, because of Angular. You shouldn't need a gazplant-like IDE to develop, and I never have any issue with, say, React.

Collapse
 
intricatecloud profile image
Danny Perez

An former coworker of mine used to use the vim keyboard mapping in IntelliJ - I used to pair with him, but I would wind up accidentally locking myself out of edit mode when he would go to the restroom and I tried to use IntelliJ shortcuts when I forgot I was in vim mode. What a pain 😆

I also use a docker container called ubuntu-upstart in my local dev environment which I frequently SSH into. That container doesn't ship with vim, but it ships with vim.tiny which is good enough for doing 99% of things: i and :wq

Collapse
 
ssimontis profile image
Scott Simontis

My hidden gem is a seemingly obscure editor called Micro. I don't remember how I came across it, but it beats the crap out of Nano, has some pretty useful plugins, and is fairly powerful.

I'm making progress with Vim though...I no longer end up having to Google "how to save and quit vim" on a second computer when I finish my edits :P

Collapse
 
chaelgutierrez profile image
Michael Jyms Gutierrez

I really like vim. I'm also one of the developers who daily use vim on project. I use it on javascript development and etc. Using vim is a commitment 😅.

Collapse
 
tttfifo profile image
Todor Todorov

Hi Richard,

(disclaimer: vim lover here)

I agree with all said above, I even laughed at the HOW TO EXIT place :) I know these jokes very well, but I laugh every time :)

I use vim for IDE, also whenever ssh-ing somewhere I feel very comfortable with all machines having vim installed...

For me the ssh problem is: occasionally I ssh to some machine which has only vi (without the trailing m). Then I feel awkward :)

Collapse
 
strottos profile image
Steven Trotter

I personally use vim for practically everything I do and always have and the main reason is because it's simple and straightforward. I don't like IntelliJ or Eclipse because they make simple things easy and hard things hard for me at least, I find there's probably a way of doing it but it's hidden under layers of insanity. I understand vim really well and will always choose it over nearly anything else I suspect for that reason, with plugins it becomes every bit as good as an IDE.

Incidentally I did find debuggers were missing so I wrote my own. Admittedly I shouldnt have to but I now find I can literally do anything I might care about in an IDE.

Still, great post and I enjoyed reading it. Thanks.

Collapse
 
combinatorylogic profile image
combinatorylogic

Or just run emacs -nw if you don't have your X11 forwarding...

Collapse
 
jingxue profile image
Jing Xue

For people who have to use vim in a pinch, they can run "evim". It starts vim in an "easy mode" that works like a "normal editor".

Collapse
 
intricatecloud profile image
Danny Perez

I hadn't known about that - I just played with it on OSX using vim -y and couldn't figure out how to quit. Searching for "how to quit vim" is a lot easier than "how to quit evim".

I never knew I could turn vim into a point and click editor! 💥

Collapse
 
vlasales profile image
Vlastimil Pospichal

I use Vim for all projects, including compiling and running TDD tests. He's great.

Collapse
 
ffy00 profile image
Filipe Laíns

*matlab

Collapse
 
trylks profile image
💾 trylks

The best way to use vim is out of vim, e.g. VSCode with vim keymap

But is case of having to ssh, it's still great, especially with some extensions