change mark behavior for numbers
This commit is contained in:
+17
@@ -84,3 +84,20 @@ au BufWinLeave *.* silent! mkview
|
|||||||
au FileType * setlocal indentexpr=
|
au FileType * setlocal indentexpr=
|
||||||
au FileType lua setlocal noexpandtab
|
au FileType lua setlocal noexpandtab
|
||||||
au FileType c 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
|
||||||
|
|||||||
Reference in New Issue
Block a user