Skip to content

Instantly share code, notes, and snippets.

@saihoooooooo
Created February 9, 2012 04:40
Show Gist options
  • Save saihoooooooo/1777363 to your computer and use it in GitHub Desktop.
Save saihoooooooo/1777363 to your computer and use it in GitHub Desktop.
auto mark
nnoremap <silent>[Mark]m :<C-u>call <SID>AutoMark()<CR>
if !exists('g:marks_pos')
let g:marks_char = [
\ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
\ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
\ ]
endif
function! s:AutoMark()
if !exists('b:marks_current_pos') || (b:marks_current_pos == len(g:marks_char) - 1)
let b:marks_current_pos = 0
else
let b:marks_current_pos = b:marks_current_pos + 1
endif
execute 'mark' g:marks_char[b:marks_current_pos]
echo 'marked' g:marks_char[b:marks_current_pos]
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment