new option: g:startify_skiplist
This list is supposed to contain Vim regular expressions to filter the list of recently used files. An example is given in the doc. Closes #5.
This commit is contained in:
parent
b7a2e0aac0
commit
9a743ac0be
|
@ -24,6 +24,14 @@ function! startify#get_sep() abort
|
||||||
return !exists('+shellslash') || &shellslash ? '/' : '\'
|
return !exists('+shellslash') || &shellslash ? '/' : '\'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! startify#process_skiplist(arg) abort
|
||||||
|
for regexp in g:startify_skiplist
|
||||||
|
if a:arg =~# regexp
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! startify#save_session(...) abort
|
function! startify#save_session(...) abort
|
||||||
if !isdirectory(g:startify_session_dir)
|
if !isdirectory(g:startify_session_dir)
|
||||||
echo 'The session directory does not exist: '. g:startify_session_dir
|
echo 'The session directory does not exist: '. g:startify_session_dir
|
||||||
|
|
|
@ -74,6 +74,8 @@ default values.
|
||||||
|
|
||||||
The directory to save/load sessions to/from.
|
The directory to save/load sessions to/from.
|
||||||
|
|
||||||
|
The default for Windows systems is '$HOME\vimfiles\session'.
|
||||||
|
|
||||||
|
|
||||||
============-
|
============-
|
||||||
|
|
||||||
|
@ -103,6 +105,18 @@ The amount of files to list.
|
||||||
A list of files to bookmark. Those files will always be shown at the bottom of
|
A list of files to bookmark. Those files will always be shown at the bottom of
|
||||||
the start screen.
|
the start screen.
|
||||||
|
|
||||||
|
============-
|
||||||
|
|
||||||
|
let g:startify_skiplist = []
|
||||||
|
|
||||||
|
A list of Vim regular expressions to filter recently used files.
|
||||||
|
|
||||||
|
Example: let g:startify_skiplist = [
|
||||||
|
\ 'COMMIT_EDITMSG',
|
||||||
|
\ $VIMRUNTIME .'/doc',
|
||||||
|
\ 'bundle/.*/doc'
|
||||||
|
\ ]
|
||||||
|
|
||||||
|
|
||||||
============-
|
============-
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,8 @@ function! s:start() abort
|
||||||
let numfiles = get(g:, 'startify_show_files_number', 10)
|
let numfiles = get(g:, 'startify_show_files_number', 10)
|
||||||
call append('$', '')
|
call append('$', '')
|
||||||
for fname in v:oldfiles
|
for fname in v:oldfiles
|
||||||
if !filereadable(expand(fname))
|
let expfname = expand(fname)
|
||||||
\ || (expand(fname) =~# $VIMRUNTIME . sep .'doc')
|
if !filereadable(expfname) || (exists('g:startify_skiplist') && startify#process_skiplist(expfname))
|
||||||
\ || (fname =~# 'bundle'. sep .'.*'. sep .'doc')
|
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
call append('$', ' ['. cnt .']'. repeat(' ', 3 - strlen(string(cnt))) . fname)
|
call append('$', ' ['. cnt .']'. repeat(' ', 3 - strlen(string(cnt))) . fname)
|
||||||
|
|
Loading…
Reference in a new issue