add bookmarks
This commit is contained in:
parent
ee344d3be3
commit
05cc44f7f9
|
@ -7,6 +7,9 @@ _1)_ If you start Vim without giving any filenames to it (or pipe stuff to it so
|
|||
it reads from STDIN), startify will show a small but pretty start screen
|
||||
which shows recently used files and sessions by default.
|
||||
|
||||
Additionally, you can define bookmarks, thus entries for files that always
|
||||
should be available in the start screen.
|
||||
|
||||
You can either navigate to a certain menu entry or you just key in whatever
|
||||
is written between the square brackets on that line.
|
||||
|
||||
|
|
|
@ -40,6 +40,9 @@ Startify basically provides two things:
|
|||
it reads from STDIN), startify will show a small but pretty start screen
|
||||
which shows recently used files and sessions by default.
|
||||
|
||||
Additionally, you can define bookmarks, thus entries for files that always
|
||||
should be available in the start screen.
|
||||
|
||||
You can either navigate to a certain menu entry or you just key in whatever
|
||||
is written between the square brackets on that line.
|
||||
|
||||
|
@ -87,6 +90,14 @@ List recently used files using viminfo.
|
|||
The amount of files to list.
|
||||
|
||||
|
||||
============-
|
||||
|
||||
let g:startify_bookmarks = [ '~/.vimrc' ]
|
||||
|
||||
A list of files to bookmark. Those files will always be shown at the bottom of
|
||||
the start screen.
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. Commands *startify-commands*
|
||||
|
||||
|
|
|
@ -58,6 +58,19 @@ function! s:start() abort
|
|||
call append('$', ' ['. idx .']'. repeat(' ', 3 - strlen(string(idx))) . fnamemodify(sfiles[i], ':t:r'))
|
||||
execute 'nnoremap <buffer> '. idx .' :source '. sfiles[i] .'<cr>'
|
||||
endfor
|
||||
let cnt = idx
|
||||
endif
|
||||
|
||||
if exists('g:startify_bookmarks')
|
||||
call append('$', '')
|
||||
for fname in g:startify_bookmarks
|
||||
if !filereadable(expand(fname))
|
||||
continue
|
||||
endif
|
||||
let cnt += 1
|
||||
call append('$', ' ['. cnt .']'. repeat(' ', 3 - strlen(string(cnt))) . fname)
|
||||
execute 'nnoremap <buffer> '. cnt .' :edit '. fname .'<cr>'
|
||||
endfor
|
||||
endif
|
||||
|
||||
call append('$', ['', ' [q] quit'])
|
||||
|
|
Loading…
Reference in a new issue