Tip 58: Snap Between Files Using Global Marks
Return to the top: <<Practical Vim>>
-
m{letter}
: create a mark at the current cursor position.- Lowercase letter: create marks that are local to a buffer
- Uppercase letter: create global marks
References
# If you open the file in vim, # then you can \"ayy@a the next line to execute the vim command: :h m
- `{letter}: snap the cursor back to the mark
Set a Global Mark Before Going Code Diving
Suggestion:
set a global mark before using any commands that interact with the quickfix list (e.g. :grep
/:vimgrep
/make
), the buffer and argument lists (e.g. :args {arglist}
/:argdo
)