What is the difference between backtick and apostrophe when jumping to marks?
Answer
`a vs 'a
Explanation
Vim has two ways to jump to marks: backtick (`) jumps to the exact line AND column, while apostrophe (') jumps to the line only, positioning the cursor at the first non-blank character. This distinction matters for precise cursor positioning.
How it works
`a— jump to markaat the exact line and column where it was set'a— jump to the line of marka, cursor at first non-blank character- This applies to all marks: named (a-z, A-Z), special (
.,<,>), etc. `0jumps to exact position of last exit;'0jumps to that line
Example
hello world
^-- mark 'a' set here (line 1, col 12)
`a → cursor lands at col 12 (exact position)
'a → cursor lands at col 4 (first non-blank: 'h')
Tips
`.jumps to the exact position of the last change — very useful`"jumps to the position when the file was last exited- Use
`for code editing (exact position matters);'for prose (line is enough) `[and`]mark the start and end of the last changed/yanked text