#TIL : Using mark to bookmark checkpoints in files


30 Jan 2018 / by KhanhIceTea

Bookmarking a checkpoint will help you get back to it intermidately. Ex: your have to find some text to replace something but want to return back current position.

Set a mark

  • [NORMAL MODE] , type m then follow by a letter from a-z (lowercase is filescope, uppercase for global scope - vim scope)

Go to a mark

  • [NORMAL MODE] , type backstick ` then follow by the letter your marked above.

List all current marks

  • [NORMAL MODE], :marks
  • It shows all marks included special ones :
CommandDescription
`.jump to position where last change occurred in current buffer
`"jump to position where last exited current buffer
`0jump to position in last file edited (when exited Vim)
''jump back (to line in current buffer where jumped from)
``jump back (to position in current buffer where jumped from)

TIPS : Can use it as a motion with change, delete or yank


Sound good ?