startify.txt 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. *startify.txt* Showing recently used stuff like a boss.
  2. *startify*
  3. __ __ ___
  4. /\ \__ /\ \__ __ /'___\
  5. ____\ \ ,_\ __ _ __\ \ ,_\/\_\/\ \__/ __ __
  6. /',__\\ \ \/ /'__`\ /\`'__\ \ \/\/\ \ \ ,__\/\ \/\ \
  7. /\__, `\\ \ \_/\ \L\.\_\ \ \/ \ \ \_\ \ \ \ \_/\ \ \_\ \
  8. \/\____/ \ \__\ \__/.\_\\ \_\ \ \__\\ \_\ \_\ \/`____ \
  9. \/___/ \/__/\/__/\/_/ \/_/ \/__/ \/_/\/_/ `/___/> \
  10. /\___/
  11. \/__/
  12. ==============================================================================
  13. CONTENTS *startify-contents*
  14. 1.Intro..........................................|startify-intro|
  15. 2.Usage..........................................|startify-usage|
  16. 3.Options........................................|startify-options|
  17. 4.Commands.......................................|startify-commands|
  18. 5.Colors.........................................|startify-colors|
  19. 6.FAQ............................................|startify-faq|
  20. 7.Author.........................................|startify-author|
  21. 8.License........................................|startify-license|
  22. ==============================================================================
  23. 1. Intro *startify-intro*
  24. Startify is a plugin that shows recently used files, bookmarks and
  25. sessions that were saved to a certain directory.
  26. ==============================================================================
  27. 2. Usage *startify-usage*
  28. Startify basically provides two things:
  29. 1) If you start Vim without giving any filenames to it (or pipe stuff to it so
  30. it reads from STDIN), startify will show a small but pretty start screen
  31. that shows recently used files (using viminfo) and sessions by default.
  32. Additionally, you can define bookmarks, thus entries for files that always
  33. should be available on the start screen.
  34. You can either navigate to a certain menu entry and hit enter or you just
  35. key in whatever is written between the square brackets on that line. You
  36. can even double-click anywhere on the line now.
  37. In addition, 'e' creates an empty buffer, 'i' creates an empty buffer and
  38. jumps into insert mode, 'q' quits.
  39. Moreover, you can open several files at one go. Navigate to an entry and
  40. hit either 'b' (open in same window), 's' (open in split), 'v' (open in
  41. vertical split) or 't' (open in tab). You can do that for multiple entries.
  42. You can also mix them. The order of the selections will be remembered.
  43. Afterwards execute these actions via <cr>.
  44. When the selection is finished, Startify will close automatically. You can
  45. reopen the screen via :Startify.
  46. And you can define your own custom ascii art header now!
  47. 2) It eases handling of loading and saving sessions by only working with a
  48. certain directory. These commands are used for convenience:
  49. :SLoad load a session
  50. :SSave save a session
  51. :SDelete delete a session
  52. ==============================================================================
  53. 3. Options *startify-options*
  54. Put these variables into your vimrc. The shown assignments are also the
  55. default values.
  56. |g:startify_session_dir|
  57. |g:startify_list_order|
  58. |g:startify_bookmarks|
  59. |g:startify_files_number|
  60. |g:startify_session_detection|
  61. |g:startify_session_autoload|
  62. |g:startify_session_persistence|
  63. |g:startify_skiplist|
  64. |g:startify_skiplist_server|
  65. |g:startify_change_to_dir|
  66. |g:startify_custom_indices|
  67. |g:startify_custom_header|
  68. |g:startify_custom_footer|
  69. |g:startify_restore_position|
  70. |g:startify_empty_buffer_key|
  71. |g:startify_enable_special|
  72. |g:startify_session_savevars|
  73. |g:startify_session_savecmds|
  74. |g:startify_disable_at_vimenter|
  75. ============- *g:startify_session_dir*
  76. let g:startify_session_dir = '~/.vim/session'
  77. The directory to save/load sessions to/from.
  78. The default for Windows systems is '$HOME\vimfiles\session'.
  79. ============- *g:startify_list_order*
  80. let g:startify_list_order = ['files', 'sessions', 'bookmarks']
  81. At the moment startify can show these kind of lists:
  82. 1) Most recently used files.
  83. This lists the most recently used files using viminfo. The number of files
  84. is limited by g:startify_files_number.
  85. 2) Most recently changed files in the current directory.
  86. This lists the files from the current directory sorted by modification
  87. time. The number of files is limited by g:startify_files_number.
  88. 3) Bookmarks.
  89. This lists bookmarks, thus hardcoded files that will always be shown.
  90. Have a look at g:startify_bookmarks.
  91. 4) Sessions.
  92. This lists all the sessions saved in the directory
  93. g:startify_session_dir.
  94. Therefore, to show all of them in the above order:
  95. let g:startify_list_order = ['files', 'dir', 'bookmarks', 'sessions']
  96. ============- *g:startify_bookmarks*
  97. let g:startify_bookmarks = []
  98. A list of files to bookmark. Those files will always be shown at the bottom of
  99. the start screen.
  100. Example: let g:startify_bookmarks = [ '~/.vimrc' ]
  101. ============- *g:startify_files_number*
  102. let g:startify_files_number = 10
  103. The number of files to list.
  104. ============- *g:startify_session_detection*
  105. let g:startify_session_detection = 1
  106. When the file Session.vim is found in the current directory, it will be shown at
  107. the top of all lists as entry [0].
  108. ============- *g:startify_session_autoload*
  109. let g:startify_session_autoload = 0
  110. If you bookmark a directory that contains a Session.vim and this option is
  111. enabled, that session will be loaded automatically when you open the
  112. directory.
  113. Great way to create a portable project folder.
  114. ============- *g:startify_session_persistence*
  115. let g:startify_session_persistence = 0
  116. Automatically update sessions before exiting Vim.
  117. ============- *g:startify_change_to_dir*
  118. let g:startify_change_to_dir = 1
  119. When opening a file or bookmark, change to its directory.
  120. ============- *g:startify_change_to_vcs_root*
  121. let g:startify_change_to_vcs_root = 0
  122. When opening a file or bookmark, seek and change to the root directory of the
  123. VCS (if there is one).
  124. At the moment only git, hg, bzr and svn are supported.
  125. ============- *g:startify_skiplist*
  126. let g:startify_skiplist = []
  127. A list of Vim regular expressions to filter recently used files and files in
  128. the current directory.
  129. Example: let g:startify_skiplist = [
  130. \ '.vimgolf',
  131. \ '^/tmp'
  132. \ '/project/.*/documentation'
  133. \ ]
  134. ============- *g:startify_skiplist_server*
  135. let g:startify_skiplist_server = []
  136. Do not create the startify buffer, if this is a Vim server instance with a
  137. name contained in this list.
  138. Example: let g:startify_skiplist_server = [ 'GVIM' ]
  139. ============- *g:startify_empty_buffer_key*
  140. let g:startify_empty_buffer_key = 'o'
  141. This creates an additional, hidden mapping for the empty buffer.
  142. Default: does not exist
  143. ============- *g:startify_enable_special*
  144. let g:startify_enable_special = 1
  145. Show <empty buffer> and <quit>.
  146. ============- *g:startify_session_savevars*
  147. let g:startify_session_savevars = []
  148. Include a list of variables in here which you would like Startify to save into
  149. the session file in addition to what Vim normally saves into the session file.
  150. For example, Vim will not normally save all-lowercase global variables, which
  151. are common for plugin settings. It may be advisable to include
  152. |g:startify_session_savevars| and |g:startify_session_savecmds| into this list
  153. so they are saved every time the session saves.
  154. Example: let g:startify_session_savevars = [
  155. \ 'g:startify_session_savevars',
  156. \ 'g:startify_session_savecmds',
  157. \ 'g:random_plugin_use_feature'
  158. \ ]
  159. ============- *g:startify_session_savecmds*
  160. let g:startify_session_savecmds = []
  161. Include a list of cmdline commands which Vim will run upon loading the
  162. session. This can be useful to set various things (other than variables,
  163. |g:startify_session_savevars| above) which Vim may not normally save into the
  164. session file, as well as run external commands upon loading a session.
  165. Example: let g:startify_session_savecmds = [
  166. \ 'silent !pdfreader ~/latexproject/main.pdf &'
  167. \ ]
  168. ============- *g:startify_restore_position*
  169. let g:startify_restore_position = 0
  170. Jump to the last cursor position when opening a file. You don't need this, if
  171. you already have this in your vimrc: |last-position-jump|.
  172. ============- *g:startify_custom_indices*
  173. let g:startify_custom_indices = []
  174. Use any list of strings as indices instead of increasing numbers. If there are
  175. more startify entries than actual items in the custom list, the remaining
  176. entries will be filled using the default numbering scheme starting from 0.
  177. Thus you can create your own indexing scheme that fits your keyboard layout.
  178. You don't want to leave the home row, do you?!
  179. Example: let g:startify_custom_indices = ['f', 'g', 'h']
  180. This would result in:
  181. [f] /last/recently/used/file1
  182. [g] /last/recently/used/file2
  183. [h] /last/recently/used/file3
  184. [0] /last/recently/used/file4
  185. [1] /last/recently/used/file5
  186. [2] /last/recently/used/file6
  187. etc.
  188. NOTE: There is no sanitizing going on, so you should know what you're doing!
  189. Best practices:
  190. - do not use 'e', 'i' or 'q' (they will be overwritten anyway)
  191. - do not use 'b', 's', 't', 'v' (used for opening several files at once)
  192. - do not use duplicates (previous mappings will be overwritten)
  193. - do not uses empty strings (creates unreachable entries)
  194. - you might want to keep 'j' and 'k' (for navigation)
  195. ============- *g:startify_custom_header*
  196. let g:startify_custom_header = ''
  197. This is a list of single-quoted strings to be shown before everything else.
  198. Every string will be written on its own line.
  199. NOTE: If a string contains ', you have to quote it with another '.
  200. A programmatic example:
  201. let g:startify_custom_header =
  202. \ map(split(system('fortune | cowsay'), '\n'), '" ". v:val') + ['','']
  203. A hardcoded example:
  204. let g:startify_custom_header = [
  205. \ ' __ ___ ______ ____ ',
  206. \ ' \ \ / (_) |____ |___ \ ',
  207. \ ' \ \ / / _ _ __ ___ / / __) |',
  208. \ ' \ \/ / | | ''_ ` _ \ / / |__ <',
  209. \ ' \ / | | | | | | | / / ___) |',
  210. \ ' \/ |_|_| |_| |_| /_(_) |____/ ',
  211. \ '',
  212. \ '',
  213. \ ]
  214. ============- *g:startify_custom_footer*
  215. let g:startify_custom_footer = ''
  216. Same as the custom header, but shown at the bottom of the startify buffer.
  217. ============- *g:startify_disable_at_vimenter*
  218. let g:startify_disable_at_vimenter = 0
  219. Don't run Startify at Vim startup. You can still call it anytime via
  220. :Startify.
  221. ==============================================================================
  222. 4. Commands *startify-commands*
  223. :SLoad load a session
  224. :SSave save a session
  225. :SDelete delete a session
  226. These take either 0 or 1 argument. If you don't specify the session name as an
  227. argument, they will just ask for it.
  228. Providing only a part of the session name works too, if you complete the
  229. argument with either <c-d> or <tab> afterwards.
  230. :Startify
  231. Open the startify buffer.
  232. ==============================================================================
  233. 5. Colors *startify-colors*
  234. You can overwrite the highlight groups used by startify. The plugin defines
  235. these groups:
  236. StartifyBracket [,]
  237. StartifyFile the actual file
  238. StartifyFooter the custom footer
  239. StartifyHeader the custom header
  240. StartifyNumber the numbers between []
  241. StartifyPath the path to a file
  242. StartifySlash slashes in paths
  243. StartifySpecial <empty buffer>,<quit>
  244. Example: (my terminal emulator supports 256 colors)
  245. hi StartifyBracket ctermfg=240
  246. hi StartifyFooter ctermfg=111
  247. hi StartifyHeader ctermfg=203
  248. hi StartifyNumber ctermfg=215
  249. hi StartifyPath ctermfg=245
  250. hi StartifySlash ctermfg=240
  251. ==============================================================================
  252. 6. FAQ (Or: Typical rants) *startify-faq*
  253. ------------------------------------------------------------------------------
  254. ==> CtrlP opens a split in Startify!
  255. Solution 1)
  256. let g:ctrlp_reuse_window = 'startify'
  257. Solution 2)
  258. autocmd FileType startify setlocal buftype=
  259. ------------------------------------------------------------------------------
  260. ==> How do I get both NERDTree and Startify working at startup?
  261. Put this in your vimrc:
  262. autocmd VimEnter *
  263. \ if !argc() |
  264. \ Startify |
  265. \ NERDTree |
  266. \ execute "normal \<c-w>w" |
  267. \ endif
  268. ------------------------------------------------------------------------------
  269. ==> The session autoload feature is not working!
  270. Do you have NERDTree installed by any chance? If so, try this:
  271. let NERDTreeHijackNetrw = 0
  272. ------------------------------------------------------------------------------
  273. ==> I don't want the start screen to use cursorline!
  274. Startify sets its own filetype "startify". Thus one could set buffer-local
  275. options like this:
  276. autocmd FileType startify setlocal nocursorline
  277. ------------------------------------------------------------------------------
  278. ==> Last recently used files don't seem to get updated at :Startify!
  279. It's because Vim loads the list from viminfo only once, at startup.
  280. ------------------------------------------------------------------------------
  281. ==> I use iTerm2 and have broken colors when using sessions!
  282. Nothing this plugin could do about. Try playing around with 'sessionoptions'.
  283. Some people swear it works for them with these settings:
  284. set sessionoptions=blank,curdir,folds,help,tabpages,winpos
  285. ------------------------------------------------------------------------------
  286. ==> How to disable common but unimportant files?
  287. Use the skiplist. Personally I use:
  288. Example: let g:startify_skiplist = [
  289. \ 'COMMIT_EDITMSG',
  290. \ $VIMRUNTIME .'/doc',
  291. \ 'bundle/.*/doc',
  292. \ '\.DS_Store'
  293. \ ]
  294. ==============================================================================
  295. 7. About the author *startify-author*
  296. My nick on Freenode IRC is mhi^.
  297. For latest developments: https://github.com/mhinz
  298. If you use any of my plugins, star it on github. This is a great way of
  299. getting feedback! Same for issues or feature requests.
  300. Thank you for flying mhi airlines. Get the Vim on!
  301. You can also follow me on Twitter: @_mhinz_
  302. ==============================================================================
  303. 8. License *startify-license*
  304. MIT license. Copyright (c) 2013 Marco Hinz.
  305. vim: tw=78