Explorar el Código

Add highlighting for custom footer

Marco Hinz hace 12 años
padre
commit
85ce548261
Se han modificado 3 ficheros con 23 adiciones y 0 borrados
  1. 7 0
      autoload/startify.vim
  2. 10 0
      doc/startify.txt
  3. 6 0
      syntax/startify.vim

+ 7 - 0
autoload/startify.vim

@@ -31,6 +31,11 @@ endfunction
 
 let s:sep = startify#get_separator()
 
+" Function: #get_lastline {{{1
+function! startify#get_lastline() abort
+  return s:lastline
+endfunction
+
 " Function: #insane_in_the_membrane {{{1
 function! startify#insane_in_the_membrane() abort
   if !empty(v:servername) && exists('g:startify_skiplist_server')
@@ -107,6 +112,8 @@ function! startify#insane_in_the_membrane() abort
 
   1
   call cursor((s:show_special ? 4 : 2) + s:headoff, 5)
+
+  doautocmd <nomodeline> startify User
 endfunction
 
 " Function: #session_load {{{1

+ 10 - 0
doc/startify.txt

@@ -89,6 +89,7 @@ default values.
     |g:startify_change_to_dir|
     |g:startify_custom_indices|
     |g:startify_custom_header|
+    |g:startify_custom_footer|
     |g:startify_restore_position|
     |g:startify_empty_buffer_key|
     |g:startify_enable_special|
@@ -300,6 +301,13 @@ Example:
                 \ ]
 
 
+============-                                         *g:startify_custom_footer*
+
+    let g:startify_custom_footer = ''
+
+Same as the custom header, but shown at the bottom of the startify buffer.
+
+
 ==============================================================================
 4. Commands                                                  *startify-commands*
 
@@ -327,6 +335,7 @@ these groups:
 
     StartifyBracket         [,]
     StartifyFile            the actual file
+    StartifyFooter          the custom footer
     StartifyHeader          the custom header
     StartifyNumber          the numbers between []
     StartifyPath            the path to a file
@@ -336,6 +345,7 @@ these groups:
 Example: (my terminal emulator supports 256 colors)
 
     hi StartifyBracket ctermfg=240
+    hi StartifyFooter  ctermfg=111
     hi StartifyHeader  ctermfg=203
     hi StartifyNumber  ctermfg=215
     hi StartifyPath    ctermfg=245

+ 6 - 0
syntax/startify.vim

@@ -21,6 +21,12 @@ if exists('g:startify_custom_header')
   execute 'syntax region StartifyHeader start=/\%1l/ end=/\%'. (len(g:startify_custom_header) + 2) .'l/'
 endif
 
+if exists('g:startify_custom_footer')
+  autocmd startify User <buffer>
+        \ execute 'syntax region StartifyFooter start=/\%'. (startify#get_lastline() + 1) .'l/ end=/*/' |
+        \ autocmd! startify User <buffer>
+endif
+
 highlight default link StartifyHeader  Normal
 highlight default link StartifyBracket Delimiter
 highlight default link StartifyNumber  Number