←back to thread

VIM Master

(github.com)
378 points Fluffyrnz | 2 comments | | HN request time: 0.42s | source
Show context
benjaminclauss ◴[] No.45042331[source]
These little tutorials and games are great. I played VIM Adventures.

However, one thing I really struggle with is learning when I can be doing something more efficiently. I rarely use markers, anything beyond default registers, commands, and so on.

I'm giving Neovim a try for my systems course trying to get better but I do wish these sorts of games pushed me to get better at these more advanced usage tricks.

replies(5): >>45042781 #>>45045030 #>>45045601 #>>45046143 #>>45047599 #
soperj ◴[] No.45042781[source]
Oh man, I use markers all the time. ma y'a

mark a spot, then yank or delete everything to that line. Way easier to do it accurately rather than 13yy or however many lines you're yanking.

replies(3): >>45043100 #>>45043375 #>>45050754 #
zeke ◴[] No.45043100[source]
You can use <shift>v then move to your start line and type y or d. This way you see the text marked before yanking or deleting. <control>v is similar. And gv will reselect the marked area.
replies(1): >>45043228 #
1. dwater ◴[] No.45043228[source]
And if you have line numbering on you can y123G. I learned enough Vim 25 years ago to be good enough and I'm happy I did. When I was writing code every day I picked up a little more but I've lost most of it, and what I'd want people to know who are considering it is you never need to be a Vim Master. You can learn enough Vim in 30 minutes to make it beneficial to you for the rest of your life.
replies(1): >>45045645 #
2. Izkata ◴[] No.45045645[source]
I turn on relative line numbering so that y123G might be y8j and vim will show me the 8.