vim - How do you save line numbers so you can easily jump to them whenever you want?
vim
Solution
You want to use marks. They allow you to save your current position in the file to a variable.
Problem
Suppose I am working on three functions and I will be jumping back and forth between them. Suppose functions A,B, and C are on lines a, b and c. Is there a way to bind the following (which jump to the line position) ``` :a :b :c ``` to keys during runtime so I can easily jump to these positions. If you play Starcraft this is kind of like binding a selected group of units to your number keys, and then using the number keys to quickly change your selected group (or jump to the designated line, in this case). Or is there another way of getting a similar result that I am unaware of? I just recently discovered that =% autoformats your tabs within the highlighted brace, so I am pretty new to vim. Thanks.