vim motions, blazing fast editing. learn how to be productive and effecient with your IDE

July 15, 2024

Author : abderrahim amzaourou

5 min Read

vim motions image

as you see in the picture. vim motions are a set of modes. each mode has its own set of commands that allow you to move around your file, select text, copy, paste, delete, and more. it is the way for maximum productivity in your dev environment. not only that. vim motions has a more powerful features such macros! you can record your actions and replay them whenever you want. this is a game changer for me.

vim motions image

don't be busy to improve! vim motions is the thing that when you learn, you want to use everywhere. it's even included in my favorite note-taking software which is obsidian which might be another subject for another article. vim motions will increase your productivity simply because you minimize the travel to your mouse. in addition, what realize actions that you do frequently with the mouse in a fraction of a second.

take this scenario as an example.

"""
you have a list of items
that you get from a website and you want
to add "" to each item.
"""
list_of_items_before = [
item1,
item2,
item3,
item4,
item5
];
list_after = [
"item1",
"item2",
"item3",
"item4",
"item5"
];

doing this edit in vim motions using what's known as macros would raughly take 5 seconds whereas doing it with the mouse would take 15 seconds. and this is a simple example. imagine doing this with a 1000 items list. you will save a lot of time. what if you have 100 items or 1000. and this is just a simple example of what you can do with vim motions.

don't confuse the two. vim motions are the set of commands that allow you to move around your file, select text, copy, paste, delete, and more. while vim editors are the software that you use to write your code. the most popular one is neovim.

  • you should be able first to type without looking at the keyboard. otherwise, you learning vim motions will be useless.
  • patience. you will need to gradually adapt to it. i recommand using neovim for 10 to 30 minutes a day for a week. and then when you get okey with the tool, start using it inside your favorite editor. there is always a plugin for it.

  • ben award has an excellent 1-hour minutes YouTube video explaining the basics and beyond of vim motions. check it out here vim motions explained
  • the primegean has a playlist teaching vim motions and neovim configuration which is something you may want to play with. check it out here vim motions and neovim configuration
  • here one of my favorite channels i watch around vim editor and learning motions by typecraft. check it out here typcraft

go learn. what are you waiting for!