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

Doc: add StartifyEntryFormat()

Marco Hinz 7 лет назад
Родитель
Сommit
d5a549a7b9
1 измененных файлов с 21 добавлено и 0 удалено
  1. 21 0
      doc/startify.txt

+ 21 - 0
doc/startify.txt

@@ -30,6 +30,7 @@ CONTENTS                                                     *startify-contents*
     COMMANDS ....................................... |startify-commands|
     MAPPINGS ....................................... |startify-mappings|
     COLORS ......................................... |startify-colors|
+    MISC ........................................... |startify-misc|
     FAQ ............................................ |startify-faq|
     EXAMPLE ........................................ |startify-example|
 
@@ -768,6 +769,26 @@ Example: (my terminal emulator supports 256 colors)
     highlight StartifySpecial ctermfg=240
 <
 ==============================================================================
+MISC                                                             *startify-misc*
+
+Changing the entry format:~
+
+You can create a function `StartifyEntryFormat()` which returns a string that
+gets evaluated in Startify. In that string, `entry_path` and `absolute_path`
+will be replaced by their respective values.
+
+`absolute_path` is self-explaining and `entry_path` is the same path but
+potentially shortened, depending on options like |g:startify_relative_path|.
+
+So, let us assume there is a function `GetLogo(path)` that returns a unicode
+logo depending on the filetype of a given file. Then you could prepend the
+logo to each Startify entry by putting this in your vimrc:
+>
+    function! StartifyEntryFormat()
+        return 'GetLogo(absolute_path) ." ". entry_path'
+    endfunction
+<
+==============================================================================
 FAQ                                                               *startify-faq*
 
     |startify-faq-01|  I don't want the start screen to use cursorline!