mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 12:50:04 +08:00
perf(bundle): update bundle startify
This commit is contained in:
parent
81e5579af3
commit
5b75fb7b6a
@ -1325,6 +1325,7 @@ let g:spacevim_autocomplete_parens = 1
|
|||||||
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
|
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
|
||||||
let g:spacevim_smartcloseignoreft = [
|
let g:spacevim_smartcloseignoreft = [
|
||||||
\ 'tagbar',
|
\ 'tagbar',
|
||||||
|
\ 'neo-tree',
|
||||||
\ 'vimfiler',
|
\ 'vimfiler',
|
||||||
\ 'defx',
|
\ 'defx',
|
||||||
\ 'NvimTree',
|
\ 'NvimTree',
|
||||||
|
144
bundle/vim-startify/autoload/startify.vim
vendored
144
bundle/vim-startify/autoload/startify.vim
vendored
@ -67,11 +67,13 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
|
|||||||
\ colorcolumn=
|
\ colorcolumn=
|
||||||
\ foldcolumn=0
|
\ foldcolumn=0
|
||||||
\ matchpairs=
|
\ matchpairs=
|
||||||
|
\ modifiable
|
||||||
\ nobuflisted
|
\ nobuflisted
|
||||||
\ nocursorcolumn
|
\ nocursorcolumn
|
||||||
\ nocursorline
|
\ nocursorline
|
||||||
\ nolist
|
\ nolist
|
||||||
\ nonumber
|
\ nonumber
|
||||||
|
\ noreadonly
|
||||||
\ norelativenumber
|
\ norelativenumber
|
||||||
\ nospell
|
\ nospell
|
||||||
\ noswapfile
|
\ noswapfile
|
||||||
@ -97,14 +99,14 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
|
|||||||
\ 'tick': 0,
|
\ 'tick': 0,
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
if s:show_special
|
if g:startify_enable_special
|
||||||
call append('$', [s:padding_left .'[e] <empty buffer>', ''])
|
call append('$', [s:leftpad .'[e] <empty buffer>', ''])
|
||||||
endif
|
endif
|
||||||
call s:register(line('$')-1, 'e', 'special', 'enew', '')
|
call s:register(line('$')-1, 'e', 'special', 'enew', '')
|
||||||
|
|
||||||
let b:startify.entry_number = 0
|
let b:startify.entry_number = 0
|
||||||
if filereadable('Session.vim')
|
if filereadable('Session.vim')
|
||||||
call append('$', [s:padding_left .'[0] '. getcwd() . s:sep .'Session.vim', ''])
|
call append('$', [s:leftpad .'[0] '. getcwd() . s:sep .'Session.vim', ''])
|
||||||
call s:register(line('$')-1, '0', 'session',
|
call s:register(line('$')-1, '0', 'session',
|
||||||
\ 'call startify#session_delete_buffers() | source', 'Session.vim')
|
\ 'call startify#session_delete_buffers() | source', 'Session.vim')
|
||||||
let b:startify.entry_number = 1
|
let b:startify.entry_number = 1
|
||||||
@ -122,8 +124,8 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
|
|||||||
|
|
||||||
silent $delete _
|
silent $delete _
|
||||||
|
|
||||||
if s:show_special
|
if g:startify_enable_special
|
||||||
call append('$', ['', s:padding_left .'[q] <quit>'])
|
call append('$', ['', s:leftpad .'[q] <quit>'])
|
||||||
call s:register(line('$'), 'q', 'special', 'call s:close()', '')
|
call s:register(line('$'), 'q', 'special', 'call s:close()', '')
|
||||||
else
|
else
|
||||||
" Don't overwrite the last regular entry, thus +1
|
" Don't overwrite the last regular entry, thus +1
|
||||||
@ -134,7 +136,7 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
|
|||||||
let b:startify.firstline = 2
|
let b:startify.firstline = 2
|
||||||
let b:startify.firstline += len(g:startify_header)
|
let b:startify.firstline += len(g:startify_header)
|
||||||
" no special, no local Session.vim, but a section header
|
" no special, no local Session.vim, but a section header
|
||||||
if !s:show_special && !exists('l:show_session') && has_key(lists[0], 'header')
|
if !g:startify_enable_special && !exists('l:show_session') && has_key(lists[0], 'header')
|
||||||
let b:startify.firstline += len(lists[0].header) + 1
|
let b:startify.firstline += len(lists[0].header) + 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -150,6 +152,8 @@ function! startify#insane_in_the_membrane(on_vimenter) abort
|
|||||||
|
|
||||||
setlocal nomodifiable nomodified
|
setlocal nomodifiable nomodified
|
||||||
|
|
||||||
|
call s:hide_endofbuffer_markers()
|
||||||
|
|
||||||
call s:set_mappings()
|
call s:set_mappings()
|
||||||
call cursor(b:startify.firstline, 5)
|
call cursor(b:startify.firstline, 5)
|
||||||
autocmd startify CursorMoved <buffer> call s:set_cursor()
|
autocmd startify CursorMoved <buffer> call s:set_cursor()
|
||||||
@ -431,14 +435,14 @@ endfunction
|
|||||||
|
|
||||||
" Function: #pad {{{1
|
" Function: #pad {{{1
|
||||||
function! startify#pad(lines) abort
|
function! startify#pad(lines) abort
|
||||||
return map(copy(a:lines), 's:padding_left . v:val')
|
return map(copy(a:lines), 's:leftpad . v:val')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #center {{{1
|
" Function: #center {{{1
|
||||||
function! startify#center(lines) abort
|
function! startify#center(lines) abort
|
||||||
let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
|
let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
|
||||||
return map(copy(a:lines),
|
return map(copy(a:lines),
|
||||||
\ 'repeat(" ", (&columns / 2) - (longest_line / 2) - 1) . v:val')
|
\ 'repeat(" ", (winwidth(0) / 2) - (longest_line / 2) - 1) . v:val')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:get_lists {{{1
|
" Function: s:get_lists {{{1
|
||||||
@ -464,11 +468,11 @@ function! s:get_lists() abort
|
|||||||
return lists
|
return lists
|
||||||
else
|
else
|
||||||
return [
|
return [
|
||||||
\ { 'header': [s:padding_left .'MRU'], 'type': 'files' },
|
\ { 'header': [s:leftpad .'MRU'], 'type': 'files' },
|
||||||
\ { 'header': [s:padding_left .'MRU '. getcwd()], 'type': 'dir' },
|
\ { 'header': [s:leftpad .'MRU '. getcwd()], 'type': 'dir' },
|
||||||
\ { 'header': [s:padding_left .'Sessions'], 'type': 'sessions' },
|
\ { 'header': [s:leftpad .'Sessions'], 'type': 'sessions' },
|
||||||
\ { 'header': [s:padding_left .'Bookmarks'], 'type': 'bookmarks' },
|
\ { 'header': [s:leftpad .'Bookmarks'], 'type': 'bookmarks' },
|
||||||
\ { 'header': [s:padding_left .'Commands'], 'type': 'commands' },
|
\ { 'header': [s:leftpad .'Commands'], 'type': 'commands' },
|
||||||
\ ]
|
\ ]
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
@ -509,7 +513,7 @@ function! s:show_lists(lists) abort
|
|||||||
let path = get(entry, 'path', '')
|
let path = get(entry, 'path', '')
|
||||||
let type = get(entry, 'type', empty(path) ? 'special' : 'file')
|
let type = get(entry, 'type', empty(path) ? 'special' : 'file')
|
||||||
let index = s:get_index_as_string()
|
let index = s:get_index_as_string()
|
||||||
call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . entry.line)
|
call append('$', s:leftpad .'['. index .']'. repeat(' ', (3 - strlen(index))) . entry.line)
|
||||||
call s:register(line('$'), index, type, cmd, path)
|
call s:register(line('$'), index, type, cmd, path)
|
||||||
endfor
|
endfor
|
||||||
call append('$', '')
|
call append('$', '')
|
||||||
@ -556,12 +560,8 @@ function! s:display_by_path(path_prefix, path_format, use_env) abort
|
|||||||
let oldfiles = call(get(g:, 'startify_enable_unsafe') ? 's:filter_oldfiles_unsafe' : 's:filter_oldfiles',
|
let oldfiles = call(get(g:, 'startify_enable_unsafe') ? 's:filter_oldfiles_unsafe' : 's:filter_oldfiles',
|
||||||
\ [a:path_prefix, a:path_format, a:use_env])
|
\ [a:path_prefix, a:path_format, a:use_env])
|
||||||
|
|
||||||
let entry_format = "s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) ."
|
let entry_format = "s:leftpad .'['. index .']'. repeat(' ', (3 - strlen(index))) ."
|
||||||
if exists('*StartifyEntryFormat')
|
let entry_format .= exists('*StartifyEntryFormat') ? StartifyEntryFormat() : 'entry_path'
|
||||||
let entry_format .= StartifyEntryFormat()
|
|
||||||
else
|
|
||||||
let entry_format .= 'entry_path'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !empty(oldfiles)
|
if !empty(oldfiles)
|
||||||
if exists('s:last_message')
|
if exists('s:last_message')
|
||||||
@ -584,7 +584,7 @@ endfunction
|
|||||||
" Function: s:filter_oldfiles {{{1
|
" Function: s:filter_oldfiles {{{1
|
||||||
function! s:filter_oldfiles(path_prefix, path_format, use_env) abort
|
function! s:filter_oldfiles(path_prefix, path_format, use_env) abort
|
||||||
let path_prefix = '\V'. escape(a:path_prefix, '\')
|
let path_prefix = '\V'. escape(a:path_prefix, '\')
|
||||||
let counter = s:numfiles
|
let counter = g:startify_files_number
|
||||||
let entries = {}
|
let entries = {}
|
||||||
let oldfiles = []
|
let oldfiles = []
|
||||||
|
|
||||||
@ -598,7 +598,12 @@ function! s:filter_oldfiles(path_prefix, path_format, use_env) abort
|
|||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let absolute_path = fnamemodify(resolve(fname), ":p")
|
try
|
||||||
|
let absolute_path = fnamemodify(resolve(fname), ":p")
|
||||||
|
catch /E655/ " Too many symbolic links (cycle?)
|
||||||
|
call s:warn('Symlink loop detected! Skipping: '. fname)
|
||||||
|
continue
|
||||||
|
endtry
|
||||||
" filter duplicates, bookmarks and entries from the skiplist
|
" filter duplicates, bookmarks and entries from the skiplist
|
||||||
if has_key(entries, absolute_path)
|
if has_key(entries, absolute_path)
|
||||||
\ || !filereadable(absolute_path)
|
\ || !filereadable(absolute_path)
|
||||||
@ -608,7 +613,7 @@ function! s:filter_oldfiles(path_prefix, path_format, use_env) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let entry_path = ''
|
let entry_path = ''
|
||||||
if s:tf
|
if !empty(g:startify_transformations)
|
||||||
let entry_path = s:transform(absolute_path)
|
let entry_path = s:transform(absolute_path)
|
||||||
endif
|
endif
|
||||||
if empty(entry_path)
|
if empty(entry_path)
|
||||||
@ -639,7 +644,7 @@ endfunction
|
|||||||
" Function: s:filter_oldfiles_unsafe {{{1
|
" Function: s:filter_oldfiles_unsafe {{{1
|
||||||
function! s:filter_oldfiles_unsafe(path_prefix, path_format, use_env) abort
|
function! s:filter_oldfiles_unsafe(path_prefix, path_format, use_env) abort
|
||||||
let path_prefix = '\V'. escape(a:path_prefix, '\')
|
let path_prefix = '\V'. escape(a:path_prefix, '\')
|
||||||
let counter = s:numfiles
|
let counter = g:startify_files_number
|
||||||
let entries = {}
|
let entries = {}
|
||||||
let oldfiles = []
|
let oldfiles = []
|
||||||
let is_dir = escape(s:sep, '\') . '$'
|
let is_dir = escape(s:sep, '\') . '$'
|
||||||
@ -679,7 +684,7 @@ endfunction
|
|||||||
|
|
||||||
" Function: s:show_files {{{1
|
" Function: s:show_files {{{1
|
||||||
function! s:show_files() abort
|
function! s:show_files() abort
|
||||||
return s:display_by_path('', s:relative_path, get(g:, 'startify_use_env'))
|
return s:display_by_path('', g:startify_relative_path, get(g:, 'startify_use_env'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: s:show_sessions {{{1
|
" Function: s:show_sessions {{{1
|
||||||
@ -717,7 +722,7 @@ function! s:show_sessions() abort
|
|||||||
let index = s:get_index_as_string()
|
let index = s:get_index_as_string()
|
||||||
let fname = fnamemodify(sfiles[i], ':t')
|
let fname = fnamemodify(sfiles[i], ':t')
|
||||||
let dname = sfiles[i] ==# v:this_session ? fname.' (*)' : fname
|
let dname = sfiles[i] ==# v:this_session ? fname.' (*)' : fname
|
||||||
call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . dname)
|
call append('$', s:leftpad .'['. index .']'. repeat(' ', (3 - strlen(index))) . dname)
|
||||||
if has('win32')
|
if has('win32')
|
||||||
let fname = substitute(fname, '\[', '\[[]', 'g')
|
let fname = substitute(fname, '\[', '\[[]', 'g')
|
||||||
endif
|
endif
|
||||||
@ -740,6 +745,9 @@ function! s:show_bookmarks() abort
|
|||||||
call s:print_section_header()
|
call s:print_section_header()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let entry_format = "s:leftpad .'['. index .']'. repeat(' ', (3 - strlen(index))) ."
|
||||||
|
let entry_format .= exists('*StartifyEntryFormat') ? StartifyEntryFormat() : 'entry_path'
|
||||||
|
|
||||||
for bookmark in g:startify_bookmarks
|
for bookmark in g:startify_bookmarks
|
||||||
if type(bookmark) == type({})
|
if type(bookmark) == type({})
|
||||||
let [index, path] = items(bookmark)[0]
|
let [index, path] = items(bookmark)[0]
|
||||||
@ -747,14 +755,17 @@ function! s:show_bookmarks() abort
|
|||||||
let [index, path] = [s:get_index_as_string(), bookmark]
|
let [index, path] = [s:get_index_as_string(), bookmark]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let absolute_path = path
|
||||||
|
|
||||||
let entry_path = ''
|
let entry_path = ''
|
||||||
if s:tf
|
if !empty(g:startify_transformations)
|
||||||
let entry_path = s:transform(fnamemodify(resolve(expand(path)), ':p'))
|
let entry_path = s:transform(fnamemodify(resolve(expand(path)), ':p'))
|
||||||
endif
|
endif
|
||||||
if empty(entry_path)
|
if empty(entry_path)
|
||||||
let entry_path = path
|
let entry_path = path
|
||||||
endif
|
endif
|
||||||
call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . entry_path)
|
|
||||||
|
call append('$', eval(entry_format))
|
||||||
|
|
||||||
if has('win32')
|
if has('win32')
|
||||||
let path = substitute(path, '\[', '\[[]', 'g')
|
let path = substitute(path, '\[', '\[[]', 'g')
|
||||||
@ -787,7 +798,7 @@ function! s:show_commands() abort
|
|||||||
" If no list is given, the description is the command itself.
|
" If no list is given, the description is the command itself.
|
||||||
let [desc, cmd] = type(command) == type([]) ? command : [command, command]
|
let [desc, cmd] = type(command) == type([]) ? command : [command, command]
|
||||||
|
|
||||||
call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . desc)
|
call append('$', s:leftpad .'['. index .']'. repeat(' ', (3 - strlen(index))) . desc)
|
||||||
call s:register(line('$'), index, 'special', cmd, '')
|
call s:register(line('$'), index, 'special', cmd, '')
|
||||||
|
|
||||||
unlet entry command
|
unlet entry command
|
||||||
@ -798,7 +809,7 @@ endfunction
|
|||||||
|
|
||||||
" Function: s:is_in_skiplist {{{1
|
" Function: s:is_in_skiplist {{{1
|
||||||
function! s:is_in_skiplist(arg) abort
|
function! s:is_in_skiplist(arg) abort
|
||||||
for regexp in s:skiplist
|
for regexp in g:startify_skiplist
|
||||||
try
|
try
|
||||||
if a:arg =~# regexp
|
if a:arg =~# regexp
|
||||||
return 1
|
return 1
|
||||||
@ -811,7 +822,7 @@ endfunction
|
|||||||
|
|
||||||
" Function: s:set_cursor {{{1
|
" Function: s:set_cursor {{{1
|
||||||
function! s:set_cursor() abort
|
function! s:set_cursor() abort
|
||||||
let b:startify.oldline = exists('b:startify.newline') ? b:startify.newline : 2 + len(s:padding_left)
|
let b:startify.oldline = exists('b:startify.newline') ? b:startify.newline : s:fixed_column
|
||||||
let b:startify.newline = line('.')
|
let b:startify.newline = line('.')
|
||||||
|
|
||||||
" going up (-1) or down (1)
|
" going up (-1) or down (1)
|
||||||
@ -912,18 +923,24 @@ function! startify#set_mark(type, ...) abort
|
|||||||
let index = expand('<cword>')
|
let index = expand('<cword>')
|
||||||
setlocal modifiable
|
setlocal modifiable
|
||||||
|
|
||||||
|
" https://github.com/vim/vim/issues/8053
|
||||||
|
let showmatch = &showmatch
|
||||||
|
let &showmatch = 0
|
||||||
|
|
||||||
if entry.marked && index[0] == a:type
|
if entry.marked && index[0] == a:type
|
||||||
let entry.cmd = 'edit'
|
let entry.cmd = 'edit'
|
||||||
let entry.marked = 0
|
let entry.marked = 0
|
||||||
execute 'normal! ci]'. entry.index
|
execute 'normal! "_ci]'. entry.index
|
||||||
else
|
else
|
||||||
let entry.cmd = default_cmds[a:type]
|
let entry.cmd = default_cmds[a:type]
|
||||||
let entry.marked = 1
|
let entry.marked = 1
|
||||||
let entry.tick = b:startify.tick
|
let entry.tick = b:startify.tick
|
||||||
let b:startify.tick += 1
|
let b:startify.tick += 1
|
||||||
execute 'normal! ci]'. repeat(a:type, len(index))
|
execute 'normal! "_ci]'. repeat(a:type, len(index))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let &showmatch = showmatch
|
||||||
|
|
||||||
setlocal nomodifiable nomodified
|
setlocal nomodifiable nomodified
|
||||||
" Reset cursor to fixed column, which is important for s:set_cursor().
|
" Reset cursor to fixed column, which is important for s:set_cursor().
|
||||||
call cursor(origline, s:fixed_column)
|
call cursor(origline, s:fixed_column)
|
||||||
@ -951,11 +968,11 @@ function! s:check_user_options(path) abort
|
|||||||
|
|
||||||
if get(g:, 'startify_change_to_dir', 1)
|
if get(g:, 'startify_change_to_dir', 1)
|
||||||
if isdirectory(a:path)
|
if isdirectory(a:path)
|
||||||
execute 'lcd' a:path
|
execute s:cd_cmd() a:path
|
||||||
else
|
else
|
||||||
let dir = fnamemodify(a:path, ':h')
|
let dir = fnamemodify(a:path, ':h')
|
||||||
if isdirectory(dir)
|
if isdirectory(dir)
|
||||||
execute 'lcd' dir
|
execute s:cd_cmd() dir
|
||||||
else
|
else
|
||||||
" Do nothing. E.g. a:path == `scp://foo/bar`
|
" Do nothing. E.g. a:path == `scp://foo/bar`
|
||||||
endif
|
endif
|
||||||
@ -969,13 +986,23 @@ function! s:cd_to_vcs_root(path) abort
|
|||||||
for vcs in [ '.git', '.hg', '.bzr', '.svn' ]
|
for vcs in [ '.git', '.hg', '.bzr', '.svn' ]
|
||||||
let root = finddir(vcs, dir .';')
|
let root = finddir(vcs, dir .';')
|
||||||
if !empty(root)
|
if !empty(root)
|
||||||
execute 'lcd' fnameescape(fnamemodify(root, ':h'))
|
execute s:cd_cmd() fnameescape(fnamemodify(root, ':h'))
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
return 0
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Function: s:cd_cmd {{{1
|
||||||
|
function! s:cd_cmd() abort
|
||||||
|
let g:startify_change_cmd = get(g:, 'startify_change_cmd', 'lcd')
|
||||||
|
if g:startify_change_cmd !~# '^[lt]\?cd$'
|
||||||
|
call s:warn('Invalid value for g:startify_change_cmd. Defaulting to :lcd')
|
||||||
|
let g:startify_change_cmd = 'lcd'
|
||||||
|
endif
|
||||||
|
return g:startify_change_cmd
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Function: s:close {{{1
|
" Function: s:close {{{1
|
||||||
function! s:close() abort
|
function! s:close() abort
|
||||||
if len(filter(range(0, bufnr('$')), 'buflisted(v:val)')) - &buflisted
|
if len(filter(range(0, bufnr('$')), 'buflisted(v:val)')) - &buflisted
|
||||||
@ -1040,7 +1067,7 @@ function! s:create_last_session_link(session_path)
|
|||||||
let cmd = printf('ln -sf %s %s',
|
let cmd = printf('ln -sf %s %s',
|
||||||
\ shellescape(fnamemodify(a:session_path, ':t')),
|
\ shellescape(fnamemodify(a:session_path, ':t')),
|
||||||
\ shellescape(s:session_dir .'/__LAST__'))
|
\ shellescape(s:session_dir .'/__LAST__'))
|
||||||
call system(cmd)
|
silent call system(cmd)
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
call s:warn("Can't create 'last used session' symlink.")
|
call s:warn("Can't create 'last used session' symlink.")
|
||||||
endif
|
endif
|
||||||
@ -1097,6 +1124,24 @@ function s:transform(absolute_path)
|
|||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Function: s:hide_endofbuffer_markers {{{1
|
||||||
|
" Use the bg color of Normal to set the fg color of EndOfBuffer, effectively
|
||||||
|
" hiding it.
|
||||||
|
function! s:hide_endofbuffer_markers()
|
||||||
|
if !exists('+winhl')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let val = synIDattr(hlID('Normal'), 'bg')
|
||||||
|
if empty(val)
|
||||||
|
return
|
||||||
|
elseif val =~ '^\d*$'
|
||||||
|
execute 'highlight StartifyEndOfBuffer ctermfg='. val
|
||||||
|
else
|
||||||
|
execute 'highlight StartifyEndOfBuffer guifg='. val
|
||||||
|
endif
|
||||||
|
setlocal winhighlight=EndOfBuffer:StartifyEndOfBuffer
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Function: s:warn {{{1
|
" Function: s:warn {{{1
|
||||||
function! s:warn(msg) abort
|
function! s:warn(msg) abort
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
@ -1107,21 +1152,22 @@ endfunction
|
|||||||
" Init: values {{{1
|
" Init: values {{{1
|
||||||
let s:sep = startify#get_separator()
|
let s:sep = startify#get_separator()
|
||||||
|
|
||||||
let s:numfiles = get(g:, 'startify_files_number', 10)
|
let g:startify_files_number = get(g:, 'startify_files_number', 10)
|
||||||
let s:show_special = get(g:, 'startify_enable_special', 1)
|
let g:startify_enable_special = get(g:, 'startify_enable_special', 1)
|
||||||
let s:relative_path = get(g:, 'startify_relative_path') ? ':~:.' : ':p:~'
|
let g:startify_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:session_dir = startify#get_session_path()
|
||||||
|
let g:startify_transformations = get(g:, 'startify_transformations', [])
|
||||||
|
|
||||||
let s:skiplist = get(g:, 'startify_skiplist', [
|
let g:startify_skiplist = extend(get(g:, 'startify_skiplist', []), [
|
||||||
\ 'runtime/doc/.*\.txt',
|
\ 'runtime/doc/.*\.txt$',
|
||||||
\ 'bundle/.*/doc/.*\.txt',
|
\ 'bundle/.*/doc/.*\.txt$',
|
||||||
\ 'plugged/.*/doc/.*\.txt',
|
\ 'plugged/.*/doc/.*\.txt$',
|
||||||
\ '/.git/',
|
\ '/.git/',
|
||||||
\ 'fugitiveblame$',
|
\ '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 g:startify_padding_left = get(g:, 'startify_padding_left', 3)
|
||||||
let s:fixed_column = len(s:padding_left) + 2
|
let s:leftpad = repeat(' ', g:startify_padding_left)
|
||||||
|
let s:fixed_column = g:startify_padding_left + 2
|
||||||
let s:batchmode = ''
|
let s:batchmode = ''
|
||||||
|
@ -22,7 +22,7 @@ endfunction
|
|||||||
|
|
||||||
" Function: #quote {{{1
|
" Function: #quote {{{1
|
||||||
function! startify#fortune#quote() abort
|
function! startify#fortune#quote() abort
|
||||||
return s:quotes[s:get_random_offset(len(s:quotes))]
|
return g:startify_custom_header_quotes[s:get_random_offset(len(g:startify_custom_header_quotes))]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Function: #boxed {{{1
|
" Function: #boxed {{{1
|
||||||
@ -73,14 +73,14 @@ let s:cow = [
|
|||||||
\ ' || ||',
|
\ ' || ||',
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
let s:unicode = &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode')
|
let g:startify_fortune_use_unicode = &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode')
|
||||||
|
|
||||||
let s:char_top_bottom = ['-', '─'][s:unicode]
|
let s:char_top_bottom = ['-', '─'][g:startify_fortune_use_unicode]
|
||||||
let s:char_sides = ['|', '│'][s:unicode]
|
let s:char_sides = ['|', '│'][g:startify_fortune_use_unicode]
|
||||||
let s:char_top_left = ['*', '╭'][s:unicode]
|
let s:char_top_left = ['*', '╭'][g:startify_fortune_use_unicode]
|
||||||
let s:char_top_right = ['*', '╮'][s:unicode]
|
let s:char_top_right = ['*', '╮'][g:startify_fortune_use_unicode]
|
||||||
let s:char_bottom_right = ['*', '╯'][s:unicode]
|
let s:char_bottom_right = ['*', '╯'][g:startify_fortune_use_unicode]
|
||||||
let s:char_bottom_left = ['*', '╰'][s:unicode]
|
let s:char_bottom_left = ['*', '╰'][g:startify_fortune_use_unicode]
|
||||||
|
|
||||||
let s:predefined_quotes = [
|
let s:predefined_quotes = [
|
||||||
\ ["Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.", '', '- Brian Kernighan'],
|
\ ["Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.", '', '- Brian Kernighan'],
|
||||||
@ -238,6 +238,6 @@ let s:predefined_quotes = [
|
|||||||
\ ['What one programmer can do in one month, two programmers can do in two months.', '', '- Frederick P. Brooks'],
|
\ ['What one programmer can do in one month, two programmers can do in two months.', '', '- Frederick P. Brooks'],
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
let s:quotes = exists('g:startify_custom_header_quotes')
|
let g:startify_custom_header_quotes = exists('g:startify_custom_header_quotes')
|
||||||
\ ? g:startify_custom_header_quotes
|
\ ? g:startify_custom_header_quotes
|
||||||
\ : startify#fortune#predefined_quotes()
|
\ : startify#fortune#predefined_quotes()
|
||||||
|
47
bundle/vim-startify/doc/startify.txt
vendored
47
bundle/vim-startify/doc/startify.txt
vendored
@ -101,6 +101,7 @@ default values.
|
|||||||
|g:startify_bookmarks|
|
|g:startify_bookmarks|
|
||||||
|g:startify_change_to_dir|
|
|g:startify_change_to_dir|
|
||||||
|g:startify_change_to_vcs_root|
|
|g:startify_change_to_vcs_root|
|
||||||
|
|g:startify_change_cmd|
|
||||||
|g:startify_custom_header|
|
|g:startify_custom_header|
|
||||||
|g:startify_enable_special|
|
|g:startify_enable_special|
|
||||||
|g:startify_list_order|
|
|g:startify_list_order|
|
||||||
@ -328,10 +329,7 @@ This is a list of commands to be executed before saving a session.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
>
|
>
|
||||||
let g:startify_session_before_save = [
|
let g:startify_session_before_save = [ 'silent! tabdo NERDTreeClose' ]
|
||||||
\ 'echo "Cleaning up before saving.."',
|
|
||||||
\ 'silent! NERDTreeTabsClose'
|
|
||||||
\ ]
|
|
||||||
<
|
<
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:startify_session_persistence*
|
*g:startify_session_persistence*
|
||||||
@ -368,6 +366,11 @@ NOTE: Buffers with unsaved changes are silently ignored.
|
|||||||
<
|
<
|
||||||
When opening a file or bookmark, change to its directory.
|
When opening a file or bookmark, change to its directory.
|
||||||
|
|
||||||
|
You want to disable this, if you're using |'autochdir'| as well.
|
||||||
|
|
||||||
|
NOTE: It defaults to 1, because that was already the behaviour at the time
|
||||||
|
this option was introduced.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:startify_change_to_vcs_root*
|
*g:startify_change_to_vcs_root*
|
||||||
>
|
>
|
||||||
@ -378,23 +381,43 @@ VCS (if there is one).
|
|||||||
|
|
||||||
At the moment only git, hg, bzr and svn are supported.
|
At the moment only git, hg, bzr and svn are supported.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*g:startify_change_cmd*
|
||||||
|
>
|
||||||
|
let g:startify_change_cmd = 'lcd'
|
||||||
|
<
|
||||||
|
The default command for switching directories. Valid values:
|
||||||
|
|
||||||
|
'cd' (|:cd|)
|
||||||
|
'lcd' (|:lcd|)
|
||||||
|
'tcd' (|:tcd|)
|
||||||
|
|
||||||
|
Affects |g:startify_change_to_dir| and |g:startify_change_to_vcs_root|.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*g:startify_skiplist*
|
*g:startify_skiplist*
|
||||||
>
|
>
|
||||||
let g:startify_skiplist = [
|
let g:startify_skiplist = []
|
||||||
\ 'COMMIT_EDITMSG',
|
|
||||||
\ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc',
|
|
||||||
\ 'bundle/.*/doc',
|
|
||||||
\ ]
|
|
||||||
<
|
<
|
||||||
A list of Vim regular expressions that is used to filter recently used files.
|
A list of Vim regular expressions that is used to filter recently used files.
|
||||||
See |pattern.txt| for what patterns can be used.
|
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
|
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
|
to use "$HOME .'/mysecret.txt'". The former would do something entirely
|
||||||
different: |/\~|. When using backslashes as path separators, escape them.
|
different: |/\~|.
|
||||||
Otherwise using "C:\this\vim\path\is\problematic" would not match what you
|
|
||||||
expect, since |/\v| is a pattern, too.
|
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:
|
Example:
|
||||||
>
|
>
|
||||||
|
BIN
bundle/vim-startify/images/startify-logo.png
vendored
Normal file
BIN
bundle/vim-startify/images/startify-logo.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
bundle/vim-startify/images/startify-menu.png
vendored
Normal file
BIN
bundle/vim-startify/images/startify-menu.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 143 KiB |
@ -15,6 +15,7 @@ In `bundle/` directory, there are two kinds of plugins: forked plugins without c
|
|||||||
- [`lang#liquid` layer](#langliquid-layer)
|
- [`lang#liquid` layer](#langliquid-layer)
|
||||||
- [`lang#go` layer](#langgo-layer)
|
- [`lang#go` layer](#langgo-layer)
|
||||||
- [`tmux` layer](#tmux-layer)
|
- [`tmux` layer](#tmux-layer)
|
||||||
|
- [`ui` layer](#ui-layer)
|
||||||
- [`incsearch` layer](#incsearch-layer)
|
- [`incsearch` layer](#incsearch-layer)
|
||||||
- [`lang#java` layer](#langjava-layer)
|
- [`lang#java` layer](#langjava-layer)
|
||||||
- [`lang#plantuml` layer](#langplantuml-layer)
|
- [`lang#plantuml` layer](#langplantuml-layer)
|
||||||
@ -46,6 +47,7 @@ These plugins are changed based on a specific version of origin plugin.
|
|||||||
|
|
||||||
- `vim-grammarous`: based on [`rhysd/vim-grammarous@db46357`](https://github.com/rhysd/vim-grammarous/tree/db46357465ce587d5325e816235b5e92415f8c05)
|
- `vim-grammarous`: based on [`rhysd/vim-grammarous@db46357`](https://github.com/rhysd/vim-grammarous/tree/db46357465ce587d5325e816235b5e92415f8c05)
|
||||||
|
|
||||||
|
|
||||||
### No changed plugins
|
### No changed plugins
|
||||||
|
|
||||||
- [defx.nvim](https://github.com/Shougo/defx.nvim/tree/df5e6ea6734dc002919ea41786668069fa0b497d)
|
- [defx.nvim](https://github.com/Shougo/defx.nvim/tree/df5e6ea6734dc002919ea41786668069fa0b497d)
|
||||||
@ -99,6 +101,10 @@ These plugins are changed based on a specific version of origin plugin.
|
|||||||
|
|
||||||
- [christoomey/vim-tmux-navigator@9ca5bfe5b](https://github.com/christoomey/vim-tmux-navigator/tree/9ca5bfe5bd274051b5dd796cc150348afc993b80)
|
- [christoomey/vim-tmux-navigator@9ca5bfe5b](https://github.com/christoomey/vim-tmux-navigator/tree/9ca5bfe5bd274051b5dd796cc150348afc993b80)
|
||||||
|
|
||||||
|
#### `ui` layer
|
||||||
|
|
||||||
|
- [`mhinz/vim-startify@81e36c35`](https://github.com/mhinz/vim-startify/tree/81e36c352a8deea54df5ec1e2f4348685569bed2)
|
||||||
|
|
||||||
#### `incsearch` layer
|
#### `incsearch` layer
|
||||||
|
|
||||||
- [incsearch.vim@c83de6d1](https://github.com/haya14busa/incsearch.vim/tree/c83de6d1ac31d173d7c3ffee0ad61dc643ee4f08)
|
- [incsearch.vim@c83de6d1](https://github.com/haya14busa/incsearch.vim/tree/c83de6d1ac31d173d7c3ffee0ad61dc643ee4f08)
|
||||||
|
Loading…
Reference in New Issue
Block a user