Marco Hinz 12 лет назад
Родитель
Сommit
2fb9fa91c1
1 измененных файлов с 7 добавлено и 9 удалено
  1. 7 9
      plugin/startify.vim

+ 7 - 9
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]  <empty buffer>'])
+  call append('$', ['   startify>', '', '   [e]  <empty buffer>'])
 
   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 <buffer> '. cnt .' :edit '. fname .'<cr>'
       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 <buffer> '. idx .' :source '. sfiles[i] .'<cr>'
     endfor
   endif
 
-  call append('$', ['', pad .'[q]  quit'])
+  call append('$', ['', '   [q]  quit'])
 
   setlocal nomodifiable
 
@@ -71,7 +69,7 @@ function! s:start() abort
   nnoremap <buffer><silent> <cr> :execute 'normal '. <c-r><c-w><cr>
 
   autocmd! startify *
-  autocmd startify CursorMoved <buffer> call cursor(line('.') < 4 ? 4 : 0, s:padlen+2)
+  autocmd startify CursorMoved <buffer> call cursor(line('.') < 4 ? 4 : 0, 5)
   autocmd startify BufLeave <buffer> autocmd! startify *
 endfunction