Browse Source

Trigger User autocmd for people to hook into

References #107.
Marco Hinz 11 years ago
parent
commit
1a5586e0da
3 changed files with 11 additions and 3 deletions
  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)
 
-  silent! doautocmd <nomodeline> startify User Startified
+  silent! doautocmd <nomodeline> User Startified
 endfunction
 
 " Function: #session_load {{{1

+ 9 - 0
doc/startify.txt

@@ -30,6 +30,7 @@ CONTENTS                                                     *startify-contents*
     INTRO .......................................... |startify-intro|
     USAGE .......................................... |startify-usage|
     OPTIONS ........................................ |startify-options|
+    AUTOCMD ........................................ |startify-autocmd|
     COMMANDS ....................................... |startify-commands|
     MAPPINGS ....................................... |startify-mappings|
     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
 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*
 >

+ 1 - 2
syntax/startify.vim

@@ -33,8 +33,7 @@ endif
 
 if exists('g:startify_custom_footer')
   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
 
 highlight default link StartifyBracket Delimiter