Expose startify#set_mark()

This function can be used to remap the functionality that is mapped to the
b/s/v/t keys by default.

References https://github.com/mhinz/vim-startify/issues/390
This commit is contained in:
Marco Hinz 2019-09-19 19:26:08 +02:00
parent ae10ca5152
commit 9814df57c1
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F

View file

@ -827,10 +827,10 @@ endfunction
function! s:set_mappings() abort function! s:set_mappings() abort
nnoremap <buffer><nowait><silent> i :enew <bar> startinsert<cr> nnoremap <buffer><nowait><silent> i :enew <bar> startinsert<cr>
nnoremap <buffer><nowait><silent> <insert> :enew <bar> startinsert<cr> nnoremap <buffer><nowait><silent> <insert> :enew <bar> startinsert<cr>
nnoremap <buffer><nowait><silent> b :call <sid>set_mark('B')<cr> nnoremap <buffer><nowait><silent> b :call startify#set_mark('B')<cr>
nnoremap <buffer><nowait><silent> s :call <sid>set_mark('S')<cr> nnoremap <buffer><nowait><silent> s :call startify#set_mark('S')<cr>
nnoremap <buffer><nowait><silent> t :call <sid>set_mark('T')<cr> nnoremap <buffer><nowait><silent> t :call startify#set_mark('T')<cr>
nnoremap <buffer><nowait><silent> v :call <sid>set_mark('V')<cr> nnoremap <buffer><nowait><silent> v :call startify#set_mark('V')<cr>
nnoremap <buffer><nowait><silent> B :call startify#set_batchmode('B')<cr> nnoremap <buffer><nowait><silent> B :call startify#set_batchmode('B')<cr>
nnoremap <buffer><nowait><silent> S :call startify#set_batchmode('S')<cr> nnoremap <buffer><nowait><silent> S :call startify#set_batchmode('S')<cr>
nnoremap <buffer><nowait><silent> T :call startify#set_batchmode('T')<cr> nnoremap <buffer><nowait><silent> T :call startify#set_batchmode('T')<cr>
@ -868,8 +868,8 @@ function! startify#set_batchmode(batchmode) abort
echo empty(s:batchmode) ? 'Batchmode off' : 'Batchmode: '. s:batchmode echo empty(s:batchmode) ? 'Batchmode off' : 'Batchmode: '. s:batchmode
endfunction endfunction
" Function: s:set_mark {{{1 " Function: #set_mark {{{1
function! s:set_mark(type, ...) abort function! startify#set_mark(type, ...) abort
if a:0 if a:0
let entryline = a:1 let entryline = a:1
else else