Is there a way to display column numbers so that I could navigate similarly within a line?
Not really. If you are looking for column precision, there is the
50| will jump to the 50th column (one column being a character). I don't see this being that helpful unless you're writing a script or dealing with a well known text format.
Are there any other good techniques for quickly and accurately navigating within a line?
Yes! You can find them in
Within the current line:
b - You're already familiar with these and their friends.
^ - Move to the first character on the line.
0 - Move to the first column on the line.
$ - Move to the last column of the line.
g_ - Move to the last character on the line.
F - Forward and backward, respectively. Press one of these, then the character you want to jump to. e.g.
fb will jump to the next
b in the line. If you press
;, you'll jump to the next one. Pressing
, will go in the opposite direction.
T - The same as above, but the cursor will land just before the character.
It might not seem ideal at first, but if you know you need to get to the last
b in the line, you can press
$Fb to get to it instead of pressing
fb and mashing
; a few times.
Move by searching:
You are looking at where you need to move your cursor, so searching is a valid way to get there.
/abc will jump to the first occurrence of
N will move your cursor between all the matches.
gN will move the cursor and select the match in visual mode.
But, searching will move beyond the current line, which is not within the current line like you mentioned. To stay within the line, you can select it with shift-v and search with
\%V causes the search to only happen within the visual selection.
- easymotion - This gives you shortcuts based on the kind of text jump you want.
- vim-sneak - Similar to easymotion, but is more like
F mentioned above combined with searching.