Vim Text Editor for Beginners Part 7 - Additional Tips

Originally published at: Vim Text Editor for Beginners Part 7 – Additional Tips – LearnLinuxTV

In my newly refreshed Vim series, you’ll learn all the things you’ll need to know in order to use this text editor in your daily workflow. In the final video, I’ll leave you with additional tips that will help you become more productive with Vim.

A have a question about using vim
Is there a way to mark a vertical block to either delete the contents or add to the lines. Let me explain: I’m writing code for an application. I want to create an in-line section of code and there are two different ways to do this, like if-elseif-elseif else or a case statement. So, I write both ways and comment out one of the two to try it out. I then want to remove the comment characters at the beginning of the lines of one section and add a comment character to the beginning of the lines of the other. I used to have an editor that would do that but can’t find one that still does. Can vim do this? if so, how?

There’s this:


1 Like

Well, that was quick! And just what I was looking for! Thanks!

Seems I need to learn a better way of searching the web. :slight_smile:

1 Like

You’re very welcome! :smile_cat:

1 Like

Beware that on some systems (Windoze, I’m lookin’ at you), vim uses ctrl-q for visual mode, as ctrl-v is mapped to “Windows-normal” paste (at least in gvim, which is all I ever use).