From 229d6787f0270f644b9340ad7941460f3eccd7ea Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Sat, 29 Aug 2026 22:26:49 +0200 Subject: [PATCH] change mark behavior for numbers --- vim/.vimrc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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