parent
50d4c51607
commit
620b040b5e
111
doc/startify.txt
111
doc/startify.txt
|
@ -96,6 +96,7 @@ default values.
|
||||||
|g:startify_custom_header|
|
|g:startify_custom_header|
|
||||||
|g:startify_enable_special|
|
|g:startify_enable_special|
|
||||||
|g:startify_list_order|
|
|g:startify_list_order|
|
||||||
|
|g:startify_lists|
|
||||||
|g:startify_skiplist|
|
|g:startify_skiplist|
|
||||||
|g:startify_update_oldfiles|
|
|g:startify_update_oldfiles|
|
||||||
|
|
||||||
|
@ -136,63 +137,97 @@ The default for Windows systems is '$HOME\vimfiles\session'.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:startify_list_order*
|
*g:startify_list_order*
|
||||||
|
|
||||||
|
This option is DEPRECATED in favor of |g:startify_lists|.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*g:startify_lists*
|
||||||
>
|
>
|
||||||
let g:startify_list_order = ['files', 'dir', 'bookmarks', 'sessions',
|
let g:startify_lists = [
|
||||||
\ 'commands']
|
\ { 'type': 'files', 'header': [ 'MRU'] },
|
||||||
|
\ { 'type': 'dir', 'header': [ 'MRU '. getcwd()] },
|
||||||
|
\ { 'type': 'sessions', 'header': [ 'Sessions'] },
|
||||||
|
\ { 'type': 'bookmarks', 'header': [ 'Bookmarks'] },
|
||||||
|
\ { 'type': 'commands', 'header': [ 'Commands'] },
|
||||||
|
\ ]
|
||||||
<
|
<
|
||||||
At the moment startify supports these lists:~
|
Startify displays lists. Each list consists of a type and an optional header.
|
||||||
|
|
||||||
1) "files"
|
The 'type' is either a string of a built-in type or a |Funcref|.
|
||||||
|
|
||||||
This lists the most recently used files using viminfo. The number of files
|
The 'header' is a list of strings, whereas each string will be put on its own
|
||||||
is limited by |g:startify_files_number|.
|
line in the header.
|
||||||
|
|
||||||
2) "dir"
|
Built-in types:~
|
||||||
|
|
||||||
This lists the files from the current directory sorted by modification
|
'files'
|
||||||
time. The number of files is limited by |g:startify_files_number|.
|
|
||||||
|
|
||||||
3) "bookmarks"
|
This lists the most recently used files using viminfo. The number of files
|
||||||
|
is limited by |g:startify_files_number|.
|
||||||
|
|
||||||
This lists bookmarks, thus hardcoded files or directories that will always
|
'dir'
|
||||||
be shown. Have a look at |g:startify_bookmarks|.
|
|
||||||
|
|
||||||
4) "sessions"
|
This lists the files from the current directory sorted by modification
|
||||||
|
time. The number of files is limited by |g:startify_files_number|.
|
||||||
|
|
||||||
This lists all the sessions saved in the directory |g:startify_session_dir|.
|
'bookmarks'
|
||||||
|
|
||||||
5) "commands"
|
This lists bookmarks, thus hardcoded files or directories that will always
|
||||||
|
be shown. Have a look at |g:startify_bookmarks|.
|
||||||
|
|
||||||
|
'sessions'
|
||||||
|
|
||||||
|
This lists all the sessions saved in the directory |g:startify_session_dir|.
|
||||||
|
|
||||||
|
'commands'
|
||||||
|
|
||||||
This lists commands defined in |g:startify_commands|.
|
This lists commands defined in |g:startify_commands|.
|
||||||
|
|
||||||
Section headers:~
|
Funcref type:~
|
||||||
|
|
||||||
Additionally you can add lists of strings to that list. These will be shown
|
The referenced function must return a list of dictionaries. Each dictionary
|
||||||
above the following item in |g:startify_list_order|.
|
is an entry and consists of two keys: 'line' and 'cmd'.
|
||||||
|
|
||||||
NOTE: Section headers are context-senstive. This means that if the following
|
'line' is the actual entry to display and 'cmd' is a Vim command to execute
|
||||||
item is a startify list ("dir", "bookmarks", ...) and empty (no files in the
|
when this entry gets chosen.
|
||||||
current directory, no bookmarks defined, ...), the section header won't be
|
|
||||||
shown as well.
|
|
||||||
|
|
||||||
NOTE: The section header use the StartifySection highlight group.
|
Example #1:~
|
||||||
|
|
||||||
Section headers example:~
|
|
||||||
>
|
>
|
||||||
let g:startify_list_order = [
|
function s:foobar()
|
||||||
\ [' My most recently', ' used files'],
|
return [
|
||||||
\ 'files',
|
\ { 'line': 'foo', 'cmd': 'echo "FOO!"' },
|
||||||
\ [' My most recently used files in the current directory:'],
|
\ { 'line': 'bar', 'cmd': 'echo "BAR!"' },
|
||||||
\ 'dir',
|
\ ]
|
||||||
\ [' These are my sessions:'],
|
endfunction
|
||||||
\ 'sessions',
|
|
||||||
\ [' These are my bookmarks:'],
|
let g:startify_lists = [
|
||||||
\ 'bookmarks',
|
\ { 'type': 'files', 'header': [' MRU:'] },
|
||||||
\ [' These are my commands:'],
|
\ { 'type': function('s:foobar'), 'header': ['foo', ' and', ' bar'] },
|
||||||
\ 'commands',
|
\ ]
|
||||||
\ ]
|
|
||||||
<
|
<
|
||||||
Feel free to add some cool ASCII action!
|
Example #2:~
|
||||||
|
|
||||||
|
This more practical example assumes a git repo at ~/repo and vim-fugitive
|
||||||
|
installed (for `:Git`).
|
||||||
|
>
|
||||||
|
function! s:list_commits()
|
||||||
|
let git = 'git -C ~/repo'
|
||||||
|
let commits = systemlist(git .' log --oneline | head -n10')
|
||||||
|
let git = 'G'. git[1:]
|
||||||
|
return map(commits, '{"line": matchstr(v:val, "\\s\\zs.*"), "cmd": "'. git .' show ". matchstr(v:val, "^\\x\\+") }')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
let g:startify_lists = [
|
||||||
|
\ { 'header': [' MRU'], 'type': 'files' },
|
||||||
|
\ { 'header': [' MRU '. getcwd()], 'type': 'dir' },
|
||||||
|
\ { 'header': [' Sessions'], 'type': 'sessions' },
|
||||||
|
\ { 'header': [' Commits'], 'type': function('s:list_commits') },
|
||||||
|
\ ]
|
||||||
|
<
|
||||||
|
NOTE: Headers are context-senstive: If the list for a type is empty, the
|
||||||
|
header won't be shown.
|
||||||
|
|
||||||
|
NOTE: Headers use the StartifySection highlight group. See |startify-colors|.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:startify_bookmarks*
|
*g:startify_bookmarks*
|
||||||
|
|
Loading…
Reference in a new issue