Skip to content

Commit

Permalink
Skiplist: filter a few files by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mhinz committed Oct 6, 2020
1 parent 593388d commit 04ad724
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
12 changes: 6 additions & 6 deletions autoload/startify.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1113,14 +1113,14 @@ let s:relative_path = get(g:, 'startify_relative_path') ? ':~:.' : ':p:~'
let s:tf = exists('g:startify_transformations')
let s:session_dir = startify#get_session_path()

let s:skiplist = get(g:, 'startify_skiplist', [
\ 'runtime/doc/.*\.txt',
\ 'bundle/.*/doc/.*\.txt',
\ 'plugged/.*/doc/.*\.txt',
let s:skiplist = extend(get(g:, 'startify_skiplist', []), [
\ 'runtime/doc/.*\.txt$',
\ 'bundle/.*/doc/.*\.txt$',
\ 'plugged/.*/doc/.*\.txt$',
\ '/.git/',
\ 'fugitiveblame$',
\ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc/.*\.txt',
\ ])
\ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc/.*\.txt$',
\ ], 'keep')

let s:padding_left = repeat(' ', get(g:, 'startify_padding_left', 3))
let s:fixed_column = len(s:padding_left) + 2
Expand Down
23 changes: 15 additions & 8 deletions doc/startify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -381,20 +381,27 @@ At the moment only git, hg, bzr and svn are supported.
------------------------------------------------------------------------------
*g:startify_skiplist*
>
let g:startify_skiplist = [
\ 'COMMIT_EDITMSG',
\ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc',
\ 'bundle/.*/doc',
\ ]
let g:startify_skiplist = []
<
A list of Vim regular expressions that is used to filter recently used files.
See |pattern.txt| for what patterns can be used.

The following patterns are filtered by default:

'runtime/doc/.*\.txt$'
'bundle/.*/doc/.*\.txt$'
'plugged/.*/doc/.*\.txt$'
'/.git/'
'fugitiveblame$'
escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc/.*\.txt$'

NOTE: Due to the nature of patterns, you can't just use "~/mysecret" but have
to use "$HOME .'/mysecret.txt'". The former would do something entirely
different: |/\~|. When using backslashes as path separators, escape them.
Otherwise using "C:\this\vim\path\is\problematic" would not match what you
expect, since |/\v| is a pattern, too.
different: |/\~|.

NOTE: When using backslashes as path separators, escape them. Otherwise using
"C:\this\vim\path\is\problematic" would not match what you would expect, since
|/\v| is a pattern, too.

Example:
>
Expand Down

0 comments on commit 04ad724

Please sign in to comment.