loading...
Cover image for Will Vim give me more productivity!?

Will Vim give me more productivity!?

meenachinmay profile image Chinmay Anand ・1 min read

I am very much tired using arrow keys again and again for moving my cursor back and forth, so finally i decided to learn VIM. As i heard that you are not a developer at all if you can't use vim. Or its key bindings at least.

So my question is that Should i or Should i not?
Or there is some other alternatives are available for my problem?

Will love to hear from here.😅🙌

Thanks

Discussion

markdown guide
 

For me personally it's not about vim itself, but rather it's modal editing model. So I always recommend people to at least try a vim plugin in their editor of choice. From my experience they work good enough.

The benefit of using vim instead of another editor, is that it's pretty fast. So if I don't need a lot of tooling or a proper IDE I just launch vim and make the edit before any other editor even launched haha.

Will vim alone make you a better developer? Not really. If someone uses vim but does not really know their way around, then it will not really sky rocket their productivity. But I think everyone should always try to learn something new and at least try out things, if you don't like it, you can still go back.

 

I am really looking forward for OniVim2 to improve. It's essentially what you get when you combine the fastness of Sublime Text, modal editing of Vim and the extension ecosystem of VSCode.

 

I think behind the scene i am agree with you.
Well thanks for sharing your thoughts.

 

I used Vim for years, then went back to a GUI editor and my productivity skyrocketed. Most of my time in Vim was spent googling how to do things faster. And while I think I got to a productive phase, there was still a lot to learn before my productivity with Vim outweighed that of a GUI. One of the biggest issues for me was file management. I always had one vim editor open for each file, which became a nightmare on large projects.

If you wanted the best of both worlds, you can install packages that emulate vim for GUI editors like VSCode.

And to address this comment:

As i heard that you are not a developer at all if you can't use vim.

If you SSH onto a server you're not going to have access to a GUI editor. This is when Vim keybindings are handy to know. However, the basics is all you need here. If a developer is looking down on you because you don't know Vim, then they're either highly misinformed. Or someone you wouldn't want to work with anyway.

 

When people get used to some stuff each change is slow and they tend to dislike or get frustrated by next thing. Reson I don't even try to use Vim is that I'm used to other editors and I don't intend to change it. Why would I? I can do rename function/method parameter, select next occurrence, and all that stuff in my preffered editors. Why would I want to change? So I guess same goes for you, you got so used to other editors that vim provides no improvements in productivity.

 

My life philosophy is that you have to force your brain to be open and train it with completely opposite solutions than you're used to, non mainstream, experimental, different. We are so trained to be efficient, to pick mainstream, not to question what we have learn, not to change standards much. Yes, we get efficiency fast, in the short term. In the long term, being open and putting challanges to your brain and constantly challanging\questioning "mainstream standards" you will get so much more benefits not directly related to editing and vim. Questioning those habbits constantly makes us move forward and be better. Lazy following the crawd will just make you efficient, but in a very narrow field. Anything out of ordinary will trrow you off. Those that go wide instead of narrow will adapt faster, learn faster, be much more creative and inovative to solve real life problems.

As you sad not related to Vim. I switch languages on weekly basis but they are all similar. If time servse me right I'll focus more on Go, Scala, and Elixir to have some fun but I will never pick them in near future to develop in as I get the job done in others. Same as for Vim and any other thing, I might play with it but I'm getting paid to make things work not learn. There's no great benefit for your brain when under pressure looking for the right way to switch variable names and so on. Same reason I use IntelliJ-s compare for git. I merge faster and make waaay less mistakes. My life philosophy is be usefull not "smart". I have no use for web developer that knows in depth how CPU works yet can't make a simple features like CRUD in a manner that fufills clients needs and that is common problem in IT that people do not understand what feature has to do but they make it fast and scalable and secure although useless for end user

I managed like 30 people in IT outosurcing company, about a hundred passed through during my career. We had the exact same discussion many times. As a CEO/owner in that time, I completely understand your point and it's far from incorrect. But we also gladly spent money and time on educating people in different ways. NOT during a payed/deadlined project of course. But there are always opportunities! Do it then. It's hard to see the benefit of this fast. You have to spent years on the job to distinguish "wide" from "focused" and what each brings you. In simple and straightforward projects "wide" guys were always slower but would catch up fast if you gave them a few similar projects and usually outperform later. But as a manager, you wouldn't waste a resource like that on it. You would give him unusual, problematic client/project because there, "focused" ones would get lost, frustrate themselves and the client and end up being slower. Over years, "focused" ones end up being "senior developers" and sometimes "architects" in one or two fields. A point of frustration in the company for every stack change. "Wide" ones reach "architects" level sooner and more often, and more than occasionally they become heads of development or teams. Don't get me wrong, as the owner, I love and need both. But as a friend or even father, I insist on going "wide". It will always pay off in the long run.

So, don't just switch between React and Nextjs, between VSCode and Itellij. Switch between Vim and VSCode, between Linux and Windows, desktop and web, Rust and Javascript. Let's go even more extreme... use your left hand for a day to cut food, teach your left leg to use the break in the car (this one NOT IN THE TRAFFIC!!!!), try writing a small program on paper... goal is not to be good or better in any of this. The goal is to try, have fun, and learn different perspectives.

And yes, search for "5 monkeys and a shower" story online and read it if you haven't already (EDit: uh, forgot a very important note: as said, this is a "story" and not a real "experiment" and is most probably completely a fiction! However, it is interesting and I refer to it as I have witnessed similar behaviour with people (groups of), not monekys :)

Daily work includes:
Kotlin, Java, Groovy, Python, JavaScript. (Did some C#,PHP,Ruby before)
Spring and Micronaut, some Vue just to check some stuff up and MapBox.
Neo4j, PostgreSQL, MongoDB. (Decided to drop Azure Cosmos DB)
VSCode, Sublime, IntelliJ and a dozen of DB UIs be it web or custom desktop UI.
Linux and Windows and different tools on it.
Messaging systems like Apache Pulsar.

I think that's quite enough for daily work. Playing with Go, Scala, and Elixir would introduce some new stuff but not much. Also following NAND-to-Tetris is quite fun to catch up on some stuff missing from the past BUT.

The only thing here to actually introduce some changes would be to learn how to program quantum computers and how they work. There's a free playground provided by IBM I think.

So no I don't agree that Vim would introduce any benefit to anyone. Different shortcuts, different way to use it, same goal to achieve, write code. Same goes for rest. Once you pass certain line there's no true benefit. You have some but is it really worth time ?

Great stuff! So what do you say when some young programmer tells you that he is focused on Javscript/React and that he is twice faster than you becuase of that? :)
Vim? It's not about Vim, it's about trying modal editors, and about focusing on keyboard and less on the mouse. Just another small thing on the list. But time and list is different for everybody. Nobody can get the list done, ever. But certainly wouldn't call it useless.

 

A very strange comment. For someone using vim for years, is just hard to believe you were using one editor for each open file, that you haven't used Windows, tabs and buffers.

I'm using it for two weeks and use those already

 

😂 TIL that I was using Vim wrong. I'll have to try it again! There's definitely the mindset of you don't know what you don't know. But can't say I can use that excuse when I was a vim user for years!

 

😅😅finally somebody have guts enough.
But ya i agree with you.

 

I mean if you had one editor for each file you simply weren't using Vim correctly.

 

Thanks for sharing your thoughts.

 

I used Vim for a few years and still do whenever I need to do something quick.

I love it but I would spend too much time simply tinkering with it. It was fun and honestly things are much easier now than they used to but still I don't want to spend hours making my setup perfect for no reason. Specially now that I have to use Windows... Some things are harder to do / they don't work properly / feel sluggish.

My personal recommendation is that you try one of the Vim emulators. I think that Vim keybindings themselves are great and I even use them to browse the web. Sometimes it's not enough and I will open Vim because some feature is missing in the emulator but for regular use it's enough.

The keybindings themselves save me time when working but at the end of the day I spent months learning them so if I was to do the math it would probably not be worth it. That said, Vim has given me a lot more than "saving time" and I personally enjoy writing code more using it.

Nowadays I need an IDE and I don't want to spend too much time configuring my editor so I use IdeaVim and VsCodeVim. IV is flawless and VCV is good enough. Give them a try.

I am just rambling I think...

  • If you like to tinker and learn random things then go for Vim
  • If you are just curious try an emulator (and don't give up in 2 days)
  • If you think Vim will instantly make you a better/faster programmer then just don't. It will never do that, even after years
 

Thanks for sharing your experience.

 

First, somebody who claims only real programmers use Vim is probably not much of a programmer, but surely not somebody you should follow.

That said, I switched to Vim few weeks ago. I didn't have problems with arrow keys, but the mouse was what I was trying to avoid. So I also switched to tiling window manager.

My first impression: loads of fun if you like fiddling with settings. Benefits are already visible, but issues too. First advice is not to start with it too fast and on a commercial project with deadlines. You will have a slow start, you will edit .vimrc more than your code and you will be frustrated. Start slow, with sideprojects and wait till some of the regular IDE functionalities start to bother you and you start missing Vim.
Best advice I got: run vimtutor program (comes with Vim) and go through it 3,4 days in a row.
Second advice: read about plugins and search for articles about setting Vim with plugins for the stack you're working in. Vim can be a "notepad" or a VisualStudio Code, it depends on your config and plugins

 

It might possible that you are correct but with your experience side.
For me moving to arrows key again and again is deal breaker.

 

My experiance from first 2 weeks with Vim and arrow keys is that its going to be hard to not to use them. Some suggest to disable them to force yourself get a hang on hjkl keys. But I have 2 issues with those: 1) not all software has Vim key bindings so inevitably, similar functionality in other software makes it difficult to completely adapt.
2) moving cursor in insert mode: i use hjkl in normal mode, i quickly escape - move with hjkl - i. .... But sometimes, I need to do several changes of single characters very close to each other, a word to the right, a line below... And all that 3 to 5 times. Escaping, moving, then hitting i to go to insert, insert single character, escape again... It is slow. I tend to do fast moves in insert mode using arrows, as hjkl doesnt work there.

P.s. and yes, I already started trying to exit Chromium with :q. ;)

Your point is valid here.
I am getting so much productive information from this community.

 

I've done some research and found out that VIM keybindings are supported in most of the tools I use. It was reasonable to learn them but they are hard. I couldn't make the switch because of the steep learning curve and lack of real motivation. What triggered my switch to VIM bindings in the end was a strong emotion, frustration over "delete current line" shortcut :)

On one project in 2014 I was jumping between Notepad++, Eclipse and Intellij IDEA + I was sometimes editing files on the server with VIM. Delete line shortcut was different in all of these environments. One day I was really frustrated by a fact that I cannot remember a delete line shortcut in Eclipse and decided to jump head on into VIM keybindings.

Today I'm happy VIM user plus additionally I use VIM keybindings in:

  • browser (vimium),
  • local and server text file editing (VIM obviously),
  • IDE (IdeaVim),
  • terminal multiplexer (tmux - for searching and copying text),
  • bash - for long command editing + inline editing (set -o vi),
  • less - for searching and text file navigation,
  • clipboard editor (CopyQ)

Another very nice feature of VIM is editing/search/navigation of seriously huge files. You can open, search and navigate 20GB log file without a hiccup. After six years of active day to day usage I conclude that it was a really great choice. Of course you'll need to do some setup to support convenient features like quick fuzzy file lookup with a preview or file tree navigation or ripgreping within the git repo but it'll come. The most pain I had was when I've tried to make IDE from VIM. Language plugins slow VIM down so I've settled on very simple language support like syntax highlighting and sophisticated navigation support. Here is my setup if you wish to try up some of it: github.com/ktor/vimfiles

Some people claim that configuring VIM is a hustle. In retrospective when I look at my vimfiles repo it is 67 commits in 6 years. Mind that every commit was incremental improvement to my setup. I can bear with 11isch configuration increments in a year. I think I was changing more things in Intellij IDEA setup during this time :)

Proven learning resources:

 

Another suggestion... But after you spend some weeks tweaking vim and terminal to fit your needs... Invest time in learning some dotfile management workflows/tools. It's not just .vimrc that you're going to change. Pretty fast its going to be terminal too, tmux maybe, themes, plugins. You don't want to loose those. Everything you learn and implement in configs is going to be so personal, like family photos. You don't want to loose those. But also dotfiles this way are easily movable/synced to other computers or to new installs of the same computer. Usually it's justa a matter of cloning a repo, and environment you feel like Home is there.

 

Vim can be a big productivity boost but it has an upfront cost. At first it's tricky to get the hang of modal editing and moving around, editing, going back to the mode where you move around etc.
Second, VIM doesn't have a lot of the "crutches" that IDEs have, and if you want certain features, you need to research and implement plug-ins, sometimes transforming VIM into something very different.

My experience has been that VIM is excellent for small projects, works okay on larger ones if it's well organised or has a logical structure. I have no auto-suggestions and a very basic autocomplete only (just previously used variable names), so I find that I have a better memory and knowledge of things I coded in VIM. However when I'm trying to unravel spaghetti code, I might pop over to something more IDE-like.

 

If you are only conscious about auto complete in vim then its okay. On youtube i saw many people showing there vim working like charm for every single need to write code even for large projects.

youtu.be/Iid1Ms14Om4
Watch this guy here.

 

This guy is great :) Citing: "you will be more productive, you'll just be covered in coconut oil for the rest of you life" youtube.com/watch?v=-I1b8BINyEw :D

However after 6 years of using VIM as a main text editor (not IDE) I'm roughly at 30% of his speed. It's a thing to consider. Once you'll not be able to use VIM though a whole day of coding like I can't with Java- the productivity benefit will not be that clear.

 

For an entire project, I prefer either sublime text or vs-code. I don't like full fledged IDE because I have lower end laptop and they get very slow.

I have a full setup of vim, But these days I use it only for quick editing.

In the end, The IDE that gives you most productivity is the IDE you spend most time with.
Linus Torvalds uses his version of Emacs, Brian Kernighan uses SAM editor. Jeffery Way prefer VIM even when he is using vscode or sublime.

 

In short, you should know vim ( or any other terminal based editor for quick edits ) and also know a modern text editor ( like sublime or vscode ) for larger project. Pick up your poison and spend time with it, Customize it, explore it and master it.

 

As a web dev, the time required to switch over from VS Code and all of the juicy settings and extensions...no thanks!
I'll leave the VIM stuff to Sys Admins and/or cybersecurity script writers, etc.