add command argument completion
This commit is contained in:
parent
5c064488b3
commit
6cfbbbd6a1
|
@ -109,6 +109,9 @@ There are only two commands for handling sessions:
|
||||||
These take either 0 or 1 argument. If you don't specify the session name as an
|
These take either 0 or 1 argument. If you don't specify the session name as an
|
||||||
argument, they will just ask for it.
|
argument, they will just ask for it.
|
||||||
|
|
||||||
|
You can use <c-u> and <tab> for argument completion. Providing only a part of
|
||||||
|
the session name works, too.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
5. About the author *startify-author*
|
5. About the author *startify-author*
|
||||||
|
|
|
@ -11,9 +11,6 @@ let g:loaded_startify = 1
|
||||||
" Init {{{1
|
" Init {{{1
|
||||||
let g:startify_session_dir = resolve(expand(get(g:, 'startify_session_dir', '~/.vim/session')))
|
let g:startify_session_dir = resolve(expand(get(g:, 'startify_session_dir', '~/.vim/session')))
|
||||||
|
|
||||||
command! -nargs=? -bar SSave call startify#save_session(<f-args>)
|
|
||||||
command! -nargs=? -bar SLoad call startify#load_session(<f-args>)
|
|
||||||
|
|
||||||
augroup startify
|
augroup startify
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd VimEnter *
|
autocmd VimEnter *
|
||||||
|
@ -23,6 +20,14 @@ augroup startify
|
||||||
\endif
|
\endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
command! -nargs=? -bar -complete=customlist,s:get_session_names SSave call startify#save_session(<f-args>)
|
||||||
|
command! -nargs=? -bar -complete=customlist,s:get_session_names SLoad call startify#load_session(<f-args>)
|
||||||
|
|
||||||
|
" Function: s:get_session_names {{{1
|
||||||
|
function! s:get_session_names(lead, ...) abort
|
||||||
|
return map(split(globpath(g:startify_session_dir, '*'.a:lead.'*', '\n')), 'fnamemodify(v:val, ":t")')
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Function: s:start {{{1
|
" Function: s:start {{{1
|
||||||
function! s:start() abort
|
function! s:start() abort
|
||||||
setfiletype startify
|
setfiletype startify
|
||||||
|
|
Loading…
Reference in a new issue