I think we can all agree that Vim is pretty intimidating and not super intuitive - especially because you need to memorize so many keyboard shortcuts just to move around.
In this blog, I’m going to show you how I became a Vim PRO without having to memorize anything. Let’s get started!
Here are a few reasons:
1) Vim is the default editor on any operating system in the world.
2) Vim is super fast and responsive.
3) Lastly, I think there are some developers that just enjoy the challenge of mastering Vim.
I’m using my Warp terminal on my MacOS. You’re going to need the Warp terminal to follow along. To install it, run
brew install warp
in your CLI or download here.
For the purposes of this demo, I’ve created this .txt file that you can think of as a little game loosely inspired by British TV-show Taskmaster.
Each line has a task that I need to follow, and we’re going to complete all these tasks using Vim keyboard shortcuts in the MOST EFFICIENT WAY POSSIBLE.
To open up Warp AI, press
^ + Space
and then as you try to complete these tasks, ask Warp AI the bullet point questions to learn the corresponding Vim keyboard shortcuts.
1) Remove the period from the end of this line.
I could technically just press right to get to the end of the line, but that’s not efficient!
- “How do I navigate to the end of the line in vim”
- “How do I edit in vim”
2) Go to the last line and fill in the blank, then come back up to this line.
I could technically just press down to get to the end of the file, but that’s not efficient!
- “How do I navigate 3 lines down”
- “How do I navigate by word”
- “How do I delete a word”
- “How do I navigate 3 lines up”
3) Delete this entire line.
I could navigate to the end of the line and just press backspace, but that’s not efficient!
- “How do I delete an entire line”
4) Find and replace all instances of the word “line” with “COOKIE”
I could do this manually, but that’s not efficient!
- “How do I find and replace all instances of a word”
5) Please like and _____ to this channel for more tech and terminal tips!
And that’s it! Hopefully this helped.