From 2fb9fa91c1b37bd23145fefbad9c47d6af26b2ab Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 23 Apr 2013 17:03:38 +0200 Subject: [PATCH] remove pad and padlen --- plugin/startify.vim | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/plugin/startify.vim b/plugin/startify.vim index 64b8e3a..82c0c88 100644 --- a/plugin/startify.vim +++ b/plugin/startify.vim @@ -10,7 +10,6 @@ let g:loaded_startify = 1 " Init {{{1 let g:startify_session_dir = resolve(expand(get(g:, 'startify_session_dir', '~/.vim/session'))) -let s:padlen = 3 command! -nargs=0 -bar Lsave call startify#save_session() command! -nargs=0 -bar Lload call startify#load_session() @@ -20,7 +19,7 @@ augroup startify autocmd VimEnter * \ if !argc() && (line2byte('$') == -1) | \ call s:start() | - \ call cursor(6, s:padlen+2) | + \ call cursor(6, 5) | \endif augroup END @@ -31,10 +30,9 @@ function! s:start() abort setlocal nonumber norelativenumber nobuflisted buftype=nofile let numfiles = get(g:, 'startify_show_files_number', 10) - let pad = repeat(' ', s:padlen) - let cnt = 0 + let cnt = 0 - call append('$', [pad . 'startify>', '', pad . '[e] ']) + call append('$', [' startify>', '', ' [e] ']) if get(g:, 'startify_show_files', 1) && !empty(v:oldfiles) call append('$', '') @@ -42,7 +40,7 @@ function! s:start() abort if !filereadable(expand(fname)) || (fname =~# $VIMRUNTIME .'/doc') || (fname =~# 'bundle/.*/doc') continue endif - call append('$', pad .'['. cnt .']'. repeat(' ', s:padlen - strlen(string(cnt))) . fname) + call append('$', ' ['. cnt .']'. repeat(' ', 3 - strlen(string(cnt))) . fname) execute 'nnoremap '. cnt .' :edit '. fname .'' let cnt += 1 if cnt == numfiles @@ -57,12 +55,12 @@ function! s:start() abort call append('$', '') for i in range(len(sfiles)) let idx = i + cnt - call append('$', pad .'['. idx .']'. repeat(' ', s:padlen - strlen(string(idx))) . fnamemodify(sfiles[i], ':t:r')) + call append('$', ' ['. idx .']'. repeat(' ', 3 - strlen(string(idx))) . fnamemodify(sfiles[i], ':t:r')) execute 'nnoremap '. idx .' :source '. sfiles[i] .'' endfor endif - call append('$', ['', pad .'[q] quit']) + call append('$', ['', ' [q] quit']) setlocal nomodifiable @@ -71,7 +69,7 @@ function! s:start() abort nnoremap :execute 'normal '. autocmd! startify * - autocmd startify CursorMoved call cursor(line('.') < 4 ? 4 : 0, s:padlen+2) + autocmd startify CursorMoved call cursor(line('.') < 4 ? 4 : 0, 5) autocmd startify BufLeave autocmd! startify * endfunction