X Marks The Spot
Vim marks for pirates. Arr!
Easy mappings for creating and navigating through lower-case marks.
<leader>x: Add mark
yin the current cursor location, where
yis the next available mark.
<leader>X: Delete all marks at the current line.
<BS>: Go to the previous closest mark (mode 1) or the previously assigned mark (mode 2).
<S-BS>: Go to next closest mark (mode 1) or the next assigned mark (mode 2).
To override them, add the following to your vimrc:
nmap <unique> <leader>x <Plug>XmarksthespotAddmark nmap <unique> <leader>X <Plug>XmarksthespotRemovemarks nmap <unique> <S-BS> <Plug>XmarksthespotNextmark nmap <unique> <BS> <Plug>XmarksthespotPreviousmark
Just place in your
.vim/plugins directory. Pathogen ready.
To set options, set their values in your vimrc.
Choose between two mark navigation modes.
let g:X_MARKS_NAVIGATION_MODE = 1- (default) Move through marks based on position. Basically just calls
]'for moving backward and forward, respectively.
let g:X_MARKS_NAVIGATION_MODE = 2- Move through marks based on the order of their assignment (i.e. in alphabetical order), regardless of their positions.
let g:X_MARKS_RESET_MARKS_ON_BUF_READ = 0- (default) Don't clear all buffer marks when initializing X Marks The Spot for the current buffer.
let g:X_MARKS_RESET_MARKS_ON_BUF_READ = 1- Clear all buffer marks when initializing X Marks The Spot for the current buffer.
let g:X_MARKS_SHOW_SIGNS = 0- Don't show signs for mark location
let g:X_MARKS_SHOW_SIGNS = 1- (default) Show signs for mark location
:call ResetXMarksOnBuffer()- Use this when X Marks the Spot messes up (e.g. when you add a mark via
:call ClearXMarks()- Clear all marks and signs (
:delmarksdoesn't work yet :()
To Do List
- Allow mode 1 to "cycle" to the first/last mark when at the last/first mark. (DONE)
- Add an option to limit one mark per line. (DONE, but not an option)
- Don't store marks in a dict anymore.
- Show signs for marks. (DONE)
- Make it work with normal mark creation (e.g.
Copyright (c) John Louis Del Rosario. Distributed under the same terms as Vim