Просмотр исходного кода

new option: g:startify_enable_special

If you set this variable to 0, [i] and [q] won't be shown.
Marco Hinz 12 лет назад
Родитель
Сommit
afea247ac7
2 измененных файлов с 19 добавлено и 5 удалено
  1. 6 0
      doc/startify.txt
  2. 13 5
      plugin/startify.vim

+ 6 - 0
doc/startify.txt

@@ -149,6 +149,12 @@ People can set this variable to 0, to work around that. As a consequence the
 start screen buffer won't be removed, even after triggering an action from the
 start screen buffer won't be removed, even after triggering an action from the
 start screen.
 start screen.
 
 
+============-
+
+    let g:startify_enable_special = 1
+
+Don't show [i] and [q].
+
 
 
 ==============================================================================
 ==============================================================================
 4. Commands                                                  *startify-commands*
 4. Commands                                                  *startify-commands*

+ 13 - 5
plugin/startify.vim

@@ -42,13 +42,19 @@ function! s:insane_in_the_membrane() abort
   endif
   endif
   setfiletype startify
   setfiletype startify
 
 
-  call append('$', '   [i]  <empty buffer>')
-  let cnt = 0
+  let special = get(g:, 'startify_enable_special', 1)
   let sep = startify#get_sep()
   let sep = startify#get_sep()
+  let cnt = 0
+
+  if special
+    call append('$', '   [i]  <empty buffer>')
+  endif
 
 
   if get(g:, 'startify_show_files', 1) && !empty(v:oldfiles)
   if get(g:, 'startify_show_files', 1) && !empty(v:oldfiles)
     let numfiles = get(g:, 'startify_show_files_number', 10)
     let numfiles = get(g:, 'startify_show_files_number', 10)
-    call append('$', '')
+    if special
+      call append('$', '')
+    endif
     for fname in v:oldfiles
     for fname in v:oldfiles
       let expfname = expand(fname)
       let expfname = expand(fname)
       if !filereadable(expfname) || (exists('g:startify_skiplist') && startify#process_skiplist(expfname))
       if !filereadable(expfname) || (exists('g:startify_skiplist') && startify#process_skiplist(expfname))
@@ -87,7 +93,9 @@ function! s:insane_in_the_membrane() abort
     endfor
     endfor
   endif
   endif
 
 
-  call append('$', ['', '   [q]  <quit>'])
+  if special
+    call append('$', ['', '   [q]  <quit>'])
+  endif
 
 
   setlocal nomodifiable nomodified
   setlocal nomodifiable nomodified
 
 
@@ -109,7 +117,7 @@ function! s:insane_in_the_membrane() abort
   autocmd startify CursorMoved <buffer> call s:set_cursor()
   autocmd startify CursorMoved <buffer> call s:set_cursor()
   autocmd startify BufWipeout <buffer> autocmd! startify *
   autocmd startify BufWipeout <buffer> autocmd! startify *
 
 
-  call cursor(4, 5)
+  call cursor(special ? 4 : 2, 5)
 endfunction
 endfunction
 
 
 " Function: s:set_cursor {{{1
 " Function: s:set_cursor {{{1