New option: show relative paths

Closes #72.
This commit is contained in:
Øystein Walle 2013-12-04 12:48:14 +01:00 committed by Marco Hinz
parent 110af7a38a
commit 5370a743f2
2 changed files with 14 additions and 2 deletions

View file

@ -15,6 +15,7 @@ let s:numfiles = get(g:, 'startify_files_number', 10)
let s:show_special = get(g:, 'startify_enable_special', 1)
let s:restore_position = get(g:, 'startify_restore_position')
let s:delete_buffers = get(g:, 'startify_session_delete_buffers')
let s:relative_path = get(g:, 'startify_relative_path')
let s:session_dir = resolve(expand(get(g:, 'startify_session_dir',
\ has('win32') ? '$HOME\vimfiles\session' : '~/.vim/session')))
@ -291,8 +292,9 @@ function! s:show_dir(cnt) abort
let entries[fullpath] = 1
let index = s:get_index_as_string(cnt)
let display_fname = s:relative_path ? fnamemodify(fname, ':.') : fname
call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . fname)
call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . display_fname)
execute 'nnoremap <buffer>' index ':edit' fnameescape(fname) '<bar> call <sid>check_user_options()<cr>'
let cnt += 1
@ -336,8 +338,9 @@ function! s:show_files(cnt) abort
let entries[fullpath] = 1
let index = s:get_index_as_string(cnt)
let display_fname = s:relative_path ? fnamemodify(fname, ':.') : fname
call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . fname)
call append('$', ' ['. index .']'. repeat(' ', (3 - strlen(index))) . display_fname)
execute 'nnoremap <buffer>' index ':edit' fnameescape(fname) '<bar> call <sid>check_user_options()<cr>'
let cnt += 1

View file

@ -105,6 +105,7 @@ default values.
|g:startify_session_savevars|
|g:startify_session_savecmds|
|g:startify_disable_at_vimenter|
|g:startify_relative_path|
------------------------------------------------------------------------------
*g:startify_session_dir*
@ -405,6 +406,14 @@ Same as the custom header, but shown at the bottom of the startify buffer.
Don't run Startify at Vim startup. You can still call it anytime via
:Startify.
-----------------------------------------------------------------------------
*g:startify_relative_path*
>
let g:startify_relative_path = 0
<
Show filenames relative to the current working directory instead of as
absolute paths.
==============================================================================
COMMANDS *startify-commands*
>