Vim: The Gateway Text Editor

Greetings and salutations to all fellow Vim lovers and potential recruits/victims.

The goal of this post is to encourage anyone who is curious about learning to use Vim to make the effort to do so. I’m not trying to take away your favorite GUI text editor. If you are happy using Kate or Mousepad or Gedit that’s fine with me. Since there are plenty of online videos to teach you how to use Vim, I’m going to concentrate on the why and not the how. Vim’s built-in learning module, vimtutor, is probably the best place to start for most people and that is well documented. So please allow me to share my enthusiasm about why Vim is a great gateway or maybe even a gateway to greatness.

I cannot think of anything that is better than Vim to have in your Linux toolbox. Knowing how to use the Vim key bindings sets you up for a natural progression to really useful things like Ranger and Vifm. I’m completely blown away by these two terminal file managers and I would never have bothered with either one if I hadn’t learned Vim first. And the nice thing about Linux is that you can have your cake and eat it too so I don’t have to settle for just one. That’s a practical and useful benefit that I got almost immediately. I’m looking at other terminal based programs now like Calcurse but I’ll cut this list off here so this post doesn’t get too long.

A little bit of background: My original notion in learning Vim was to use it as a stepping stone to also learn LaTeX. I think that the combination of Vim and LaTeX is probably the ultimate word processor. I’m just a regular (whatever that means) user, not a coder or programmer but I do write a lot of long documents.

The pandemic gave me a lot more time at home and I used this to start learning Vim. I’m glad I did and I wish I had made the time to learn this awesome editor years ago.

A couple of caveats about the learning process; mainly the timeline. Don’t plan on learning Vim on a Friday night when you have a project or homework due on Monday morning. They say it takes 3 weeks to learn a habit and I think that’s an accurate number. It took me a full 30 days to be comfortable in Vim but I’ve always been a slow learner. Hey, if I can learn how to do this, anyone can. It’s not that complicated. It just takes a little practice.

My practice went like this. I committed to spending at least 15 minutes a day, every day, for 30 days to learn Vim. I did it without skipping a day. A couple of those days were only 15 minutes and a few were as long as 2 hours but I would say my average practice per day was around 30 minutes. It worked. The first several days of using vimtutor, the built-in learning tool, were extremely rough and I think I invented a boatload of new curse words. The second week was still clumsy but I was encouragd. By week 3 I was high fiving myself in the mirror. The fourth week I’m sure I had a huge smile on my face because I could honestly say, “I’ve got this and it’s great.”

After a month of Vim practice, I was thoroughly corrupted, er, that is, converted to Vim. Not only was I comfortable using it but I enjoyed the speed and efficiency and now the thought of using Mousepad makes me cringe.

About the modal thing. Yes, Vim has modes, like insert mode, normal mode, command mode, and a couple of other niche cases that I don’t really use very much. Do not let this scare you and do not listen to the online nay-sayers who say that this is “just stupid.” Once you get used to Vim’s modal-way of doing things, it’s fantastic. The title of a popular Vim book is something like “Edit text at the speed of thought” and it turns out to be true.

I’ve tried a lot of so called Note-Taking programs over the years and have never been thrilled with any of them. Yes, syncing notes between devices is useful, but the programs themselves are clunky and boring. Enter Vim. I don’t think I’ll ever try another Note-Taking application now because I don’t need them anymore. They don’t offer the speed and power of Vim and since I pretty much always have my notebook with me I don’t miss the syncing aspect. Text files composed with Vim are good enough for my notes, especially when I can write them at warp speed.

To recap about Vifm and Ranger, learning the Vim key bindings has literally streamlined my entire way of using my computer. I guess that’s what people mean when they talk about their work flow. I feel like I actually have a work flow now. A much better, extremely fast, more efficient work flow.

I’m a few months into my Vim journey at this point. I have by no means achieved Vim-Mastery but I am very satisfied with the results so far. I’m still using vanilla Vim but I’m at a point where I have a good enough understanding to start using some plug-ins to do some productive things as well as adding some eye candy to make vanilla Vim a little nicer to look at. There’s even a Vim game plug-in that lets you hunt sheep. I kid you not.

So, if you are actually still reading this too long thread, what are you waiting for?

Open a terminal, type “vimtutor” and begin your Vim journey. I guarantee it will be, as Mr. Spock would say, long and prosperous. A journey you will enjoy.

Now if you will excuse me, I have to start learning LaTeX. If that goes as well as Vim, I will write another post later. Wish me luck.

Best regards to all.

8 Likes

Thanks! Gonna send it to some friends.

I like this blog about LaTeX/Vim. It has only 3 posts, but they are useful. Castel also has a YouTube channel with some videos.

Vim + LaTeX is indeed the most ultimate note taking setup. Caveat : I failed to set up LaTeX language features in Vim. I use vim usually only to edit single files (like dotfiles, or configs) or to write short single file programs.

For LaTeX, I use Sublime Text with LaTeX Plugin and Vim emulation. I use Vim emulation while coding in other text editors too.

An exception : While I’m doing Flutter/Dart, I disable Vim emulation.

OT

Make them FLY!!! :rofl:

For Latex I use Texstudio. I use it a lot to write tutorials.

Curious if vim is really better or more productive. Texstudio has templates, highlighting and compiles tex documents on the fly to pdf to see the output. It i also has tabbed tex documents and can display tables of content with sections/chapters. Not too bloated. Else there is also the more minimal texworks.

I am curious about vim but might be too minimal for me.

Appreciate that info. I’ll probably eventually settle into something that compiles in LaTeX on the fly but to start with I’m going to try to do everything the most basic way from the command line so I learn from the ground up.

I hate to be the GUI defender here, as I spend 99% of the time in the terminal (when I’m not using a web browser).

I am relatively comfortable using Vim. It’s not really that difficult. It is very far from being a habit for me, but I can do the basic stuff with it without pulling my hair out, things like navigate inside the text file, and type. I also know how to exit Vim, which is always useful… :rofl: When I am limited to a terminal, I have no issues using Vim.

However, I still prefer Kate over Vim, after giving Vim more than a fair chance.

While it cannot be denied that Vim is a really powerful text editor, I have a feeling its power is greatly overstated, usually by people who discover its advanced features and don’t know that pretty much anything that can be done in Vim can be done in Kate, just as quickly (and please, do consider this a challenge, and give me examples of things that are easier to do in Vim than in Kate), and without the steep learning curve.

Regarding LATEX, as a physicist, I’ve been using that on an almost daily basis for several decades now, and I can confirm that it is better than any word processor, not really because of the workflow (although having plain text files instead of some complicated format makes them very portable and easy to search and edit), but because of the consistency and the quality of output. If you are going to need to typeset a lot of mathematical expressions, there is really no alternative to it – almost all mathematical and scientific journals require that you submit your papers in LATEX. Though, there are a few things that are very difficult to do in LATEX: my biggest issue with it is the lack of baseline grid functionality, which is standard in desktop publishing. For that reason, I really like ConTEXT, but the problem with it is that its syntax is not compatible with LATEX, so you have to learn everything from scratch (and then you tend to confuse the two).

I compile all LATEX files from the terminal.

As far as terminal file managers are concerned, I really see no point to them. To me, they are even less useful than GUI file managers, and I don’t really use a GUI file manager (I may use Dolphin once or twice a month). I find the good old cd, mkdir, cp, mv and rm far more useful to me than any file manager, and Konsole gives me previews of images and other files, so I really have no use for a file manager. However, I suspect that is just a matter of habit. :man_shrugging:t3:

I think most of this comes down to habit. What you are used to is, typically, that with which you’re the most comfortable. Sometimes, one’s old habits are less efficient, and it’s worth the effort to change them, but I don’t think this is the case with Kate vs. Vim. Now, if you were only using Nano or Gedit, then sure, switching to a more advanced text editor is very beneficial (but in this case, moving on to Kate will be effortless, while Vim will require some painful adjustment).

4 Likes

Well, I have learned some new habits that are more productive for me and I wanted to share that in case anyone else might want to learn some new habits. I’m happy that you’re happy with Kate. I did state right up front that I wasn’t trying to take a GUI text editor away from anyone.

What I like about Vim is not Vim. Its the editing style using Modes that I like. And I believe many people who started Vim after editors like Code-OSS debuted, are after the Modal editing, not Vim itself.

Same :wink:

Perfect!

1 Like

By the way, not many people know that Kate has a Vim-mode, so you can use the keybindings and modal-editing inside Kate, as well :wink:

I used to experiment with it for some time, but I got back to the normal way of doing things, as I find it to be just as efficient, while less confusing.

3 Likes

I love VI (including VIM) because I have been using it since 1990 or so. It is/was the editor that was always there on all Unixes. I prefer it for quick fixes, because of the rapid start-up time.
I however, would probably prefer not to write my next novel in it. GUI’s are there for a reason.
That’s my thoughts.

3 Likes

Okay, I’ve had a chance to check out Kate now. This is cool. Thanks because I did not know about this. I’m not changing yet but it’s definitely an alternative.

Also, I found a Vim plug-in for LibreOffice but I haven’t tried it yet. Does anyone use LibreOffice Writer like this?

Vim is alright, vimscript is a mess. Spacemacs/DoomEmacs do vim better than vim.

image

3 Likes