change mark behavior for numbers

This commit is contained in:
2026-08-29 22:26:49 +02:00
parent 3f682063a6
commit 229d6787f0
+17
View File
@@ -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 . ' :<C-U>call <SID>SetFileMark(' . s:n . ')<CR>'
execute 'nnoremap ''' . s:n . ' :<C-U>call <SID>JumpFileMark(' . s:n . ')<CR>'
endfor