diff --git a/vim/.vimrc b/vim/.vimrc index 246f2e0..192b329 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -84,3 +84,20 @@ au BufWinLeave *.* silent! mkview au FileType * setlocal indentexpr= au FileType lua setlocal noexpandtab au FileType c setlocal noexpandtab + +function! s:SetFileMark(n) abort + let g:file_marks[a:n] = expand('%:p') +endfunction + +function! s:JumpFileMark(n) abort + if has_key(g:file_marks, a:n) + execute 'edit ' . fnameescape(g:file_marks[a:n]) + endif +endfunction + +let g:file_marks = {} + +for s:n in range(0, 9) + execute 'nnoremap m' . s:n . ' :call SetFileMark(' . s:n . ')' + execute 'nnoremap ''' . s:n . ' :call JumpFileMark(' . s:n . ')' +endfor