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

Trigger User autocmd for people to hook into

References #107.
Marco Hinz 11 лет назад
Родитель
Сommit
1a5586e0da
3 измененных файлов с 11 добавлено и 3 удалено
  1. 1 1
      autoload/startify.vim
  2. 9 0
      doc/startify.txt
  3. 1 2
      syntax/startify.vim

+ 1 - 1
autoload/startify.vim

@@ -155,7 +155,7 @@ function! startify#insane_in_the_membrane(callingbuffer) abort
 
 
   call cursor(s:firstline + (s:show_special ? 2 : 0), 5)
   call cursor(s:firstline + (s:show_special ? 2 : 0), 5)
 
 
-  silent! doautocmd <nomodeline> startify User Startified
+  silent! doautocmd <nomodeline> User Startified
 endfunction
 endfunction
 
 
 " Function: #session_load {{{1
 " Function: #session_load {{{1

+ 9 - 0
doc/startify.txt

@@ -30,6 +30,7 @@ CONTENTS                                                     *startify-contents*
     INTRO .......................................... |startify-intro|
     INTRO .......................................... |startify-intro|
     USAGE .......................................... |startify-usage|
     USAGE .......................................... |startify-usage|
     OPTIONS ........................................ |startify-options|
     OPTIONS ........................................ |startify-options|
+    AUTOCMD ........................................ |startify-autocmd|
     COMMANDS ....................................... |startify-commands|
     COMMANDS ....................................... |startify-commands|
     MAPPINGS ....................................... |startify-mappings|
     MAPPINGS ....................................... |startify-mappings|
     COLORS ......................................... |startify-colors|
     COLORS ......................................... |startify-colors|
@@ -429,6 +430,14 @@ Don't run Startify at Vim startup. You can still call it anytime via
 Show filenames relative to the current working directory instead of as
 Show filenames relative to the current working directory instead of as
 absolute paths.
 absolute paths.
 
 
+==============================================================================
+AUTOCMD                                                       *startify-autocmd*
+
+In case you want to alter the startify buffer to cause all kinds of mayhem, an
+user autocmd is issued. You can hook into it like this:
+>
+    autocmd User Startified let &l:stl = ' This statusline rocks!'
+<
 ==============================================================================
 ==============================================================================
 COMMANDS                                                     *startify-commands*
 COMMANDS                                                     *startify-commands*
 >
 >

+ 1 - 2
syntax/startify.vim

@@ -33,8 +33,7 @@ endif
 
 
 if exists('g:startify_custom_footer')
 if exists('g:startify_custom_footer')
   autocmd startify User Startified
   autocmd startify User Startified
-        \ execute 'syntax region StartifyFooter start=/\%'. (startify#get_lastline() + 1) .'l/ end=/*/' |
-        \ autocmd! startify User
+        \ execute 'syntax region StartifyFooter start=/\%'. (startify#get_lastline() + 1) .'l/ end=/*/'
 endif
 endif
 
 
 highlight default link StartifyBracket Delimiter
 highlight default link StartifyBracket Delimiter