startify.txt 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119
  1. *startify.txt* The fancy start screen.
  2. *startify*
  3. __ __ ___
  4. /\ \__ /\ \__ __ /'___\
  5. ____\ \ ,_\ __ _ __\ \ ,_\/\_\/\ \__/ __ __
  6. /',__\\ \ \/ /'__`\ /\`'__\ \ \/\/\ \ \ ,__\/\ \/\ \
  7. /\__, `\\ \ \_/\ \L\.\_\ \ \/ \ \ \_\ \ \ \ \_/\ \ \_\ \
  8. \/\____/ \ \__\ \__/.\_\\ \_\ \ \__\\ \_\ \_\ \/`____ \
  9. \/___/ \/__/\/__/\/_/ \/_/ \/__/ \/_/\/_/ `/___/> \
  10. /\___/
  11. \/__/
  12. by Marco Hinz~
  13. >
  14. If you use any of my plugins, please star them on github. It's a great way
  15. of getting feedback and gives me the kick to put more time into their
  16. development.
  17. If you encounter any bugs or have feature requests, just open an issue
  18. report on Github.
  19. Thank you for flying mhi^ airlines. Get the Vim on!
  20. <
  21. ==============================================================================
  22. CONTENTS *startify-contents*
  23. INTRO .......................................... |startify-intro|
  24. USAGE .......................................... |startify-usage|
  25. OPTIONS ........................................ |startify-options|
  26. AUTOCMD ........................................ |startify-autocmd|
  27. COMMANDS ....................................... |startify-commands|
  28. MAPPINGS ....................................... |startify-mappings|
  29. COLORS ......................................... |startify-colors|
  30. MISC ........................................... |startify-misc|
  31. FAQ ............................................ |startify-faq|
  32. EXAMPLE ........................................ |startify-example|
  33. ==============================================================================
  34. INTRO *startify-intro*
  35. Startify is a plugin that shows recently used files, bookmarks, commands and
  36. sessions that were saved to a certain directory.
  37. ==============================================================================
  38. USAGE *startify-usage*
  39. Startify basically provides two things:
  40. 1) If you start Vim without giving any filenames to it (or pipe stuff to it so
  41. it reads from STDIN), startify will show a small but pretty start screen
  42. that shows recently used files (using viminfo) and sessions by default.
  43. Additionally, you can define bookmarks (thus entries for files) and
  44. commands that always should be available on the start screen.
  45. You can either navigate to a certain menu entry and hit enter or you just
  46. key in whatever is written between the square brackets on that line. You
  47. can even double-click anywhere on the line now.
  48. In addition, 'e' creates an empty buffer, 'i' creates an empty buffer and
  49. jumps into insert mode, 'q' quits.
  50. Moreover, you can open several files at one go. Navigate to an entry and
  51. hit either 'b' (open in same window), 's' (open in split), 'v' (open in
  52. vertical split) or 't' (open in tab). You can do that for multiple entries.
  53. You can also mix them. The order of the selections will be remembered.
  54. Afterwards execute these actions via <cr>.
  55. When the selection is finished, Startify will close automatically. You can
  56. reopen the screen via :Startify.
  57. And you can define your own custom ascii art header now!
  58. 2) The plugin eases the handling of loading and saving sessions by putting
  59. sessions in a central directory.
  60. :SLoad load a session |startify-:SLoad|
  61. :SSave[!] save a session |startify-:SSave|
  62. :SDelete[!] delete a session |startify-:SDelete|
  63. :SClose close a session |startify-:SClose|
  64. If ! is given, you won't get prompted.
  65. It also supports session persistence, so once a session is loaded, it gets
  66. saved automatically when Vim is quit: |g:startify_session_persistence|
  67. ==============================================================================
  68. OPTIONS *startify-options*
  69. Put these variables into your vimrc. The shown assignments are also the
  70. default values.
  71. Most used options:~
  72. |g:startify_bookmarks|
  73. |g:startify_change_to_dir|
  74. |g:startify_change_to_vcs_root|
  75. |g:startify_custom_header|
  76. |g:startify_enable_special|
  77. |g:startify_list_order|
  78. |g:startify_lists|
  79. |g:startify_skiplist|
  80. |g:startify_update_oldfiles|
  81. Misc options:~
  82. |g:startify_commands|
  83. |g:startify_custom_footer|
  84. |g:startify_custom_header_quotes|
  85. |g:startify_custom_indices|
  86. |g:startify_disable_at_vimenter|
  87. |g:startify_enable_unsafe|
  88. |g:startify_files_number|
  89. |g:startify_fortune_use_unicode|
  90. |g:startify_padding_left|
  91. |g:startify_relative_path|
  92. |g:startify_skiplist_server|
  93. |g:startify_use_env|
  94. Sessions:~
  95. |g:startify_session_autoload|
  96. |g:startify_session_before_save|
  97. |g:startify_session_delete_buffers|
  98. |g:startify_session_dir|
  99. |g:startify_session_number|
  100. |g:startify_session_persistence|
  101. |g:startify_session_remove_lines|
  102. |g:startify_session_savecmds|
  103. |g:startify_session_savevars|
  104. |g:startify_session_sort|
  105. ------------------------------------------------------------------------------
  106. *g:startify_session_dir*
  107. >
  108. let g:startify_session_dir = '~/.vim/session'
  109. <
  110. The directory to save/load sessions to/from.
  111. The default for Windows systems is '$HOME\vimfiles\session'.
  112. ------------------------------------------------------------------------------
  113. *g:startify_list_order*
  114. This option is DEPRECATED in favor of |g:startify_lists|.
  115. ------------------------------------------------------------------------------
  116. *g:startify_lists*
  117. >
  118. let g:startify_lists = [
  119. \ { 'type': 'files', 'header': [ 'MRU'] },
  120. \ { 'type': 'dir', 'header': [ 'MRU '. getcwd()] },
  121. \ { 'type': 'sessions', 'header': [ 'Sessions'] },
  122. \ { 'type': 'bookmarks', 'header': [ 'Bookmarks'] },
  123. \ { 'type': 'commands', 'header': [ 'Commands'] },
  124. \ ]
  125. <
  126. Startify displays lists. Each list consists of a type and an optional header.
  127. The 'type' is either a string of a built-in type or a |Funcref|.
  128. The 'header' is a list of strings, whereas each string will be put on its own
  129. line in the header.
  130. Built-in types:~
  131. 'files'
  132. This lists the most recently used files using viminfo. The number of files
  133. is limited by |g:startify_files_number|.
  134. 'dir'
  135. This lists the files from the current directory sorted by modification
  136. time. The number of files is limited by |g:startify_files_number|.
  137. 'bookmarks'
  138. This lists bookmarks, thus hardcoded files or directories that will always
  139. be shown. Have a look at |g:startify_bookmarks|.
  140. 'sessions'
  141. This lists all the sessions saved in the directory |g:startify_session_dir|.
  142. 'commands'
  143. This lists commands defined in |g:startify_commands|.
  144. Funcref type:~
  145. The referenced function must return a list of dictionaries. Each dictionary
  146. is an entry and consists of two keys: 'line' and 'cmd'.
  147. 'line' is the actual entry to display and 'cmd' is a Vim command to execute
  148. when this entry gets chosen.
  149. Example #1:~
  150. >
  151. function s:foobar()
  152. return [
  153. \ { 'line': 'foo', 'cmd': 'echo "FOO!"' },
  154. \ { 'line': 'bar', 'cmd': 'echo "BAR!"' },
  155. \ ]
  156. endfunction
  157. let g:startify_lists = [
  158. \ { 'type': 'files', 'header': [' MRU:'] },
  159. \ { 'type': function('s:foobar'), 'header': ['foo', ' and', ' bar'] },
  160. \ ]
  161. <
  162. Example #2:~
  163. This more practical example assumes a git repo at ~/repo and vim-fugitive
  164. installed (for `:Git`).
  165. >
  166. function! s:list_commits()
  167. let git = 'git -C ~/repo'
  168. let commits = systemlist(git .' log --oneline | head -n10')
  169. let git = 'G'. git[1:]
  170. return map(commits, '{"line": matchstr(v:val, "\\s\\zs.*"), "cmd": "'. git .' show ". matchstr(v:val, "^\\x\\+") }')
  171. endfunction
  172. let g:startify_lists = [
  173. \ { 'header': [' MRU'], 'type': 'files' },
  174. \ { 'header': [' MRU '. getcwd()], 'type': 'dir' },
  175. \ { 'header': [' Sessions'], 'type': 'sessions' },
  176. \ { 'header': [' Commits'], 'type': function('s:list_commits') },
  177. \ ]
  178. <
  179. NOTE: Headers are context-senstive: If the list for a type is empty, the
  180. header won't be shown.
  181. NOTE: Headers use the StartifySection highlight group. See |startify-colors|.
  182. ------------------------------------------------------------------------------
  183. *g:startify_bookmarks*
  184. >
  185. let g:startify_bookmarks = []
  186. <
  187. A list of files or directories to bookmark. The list can contain two kinds of
  188. types. Either a path or a dictionary whereas the key is the custom index and
  189. the value the path.
  190. Example:
  191. >
  192. let g:startify_bookmarks = [ {'c': '~/.vimrc'}, '~/.zshrc' ]
  193. <
  194. NOTE: Avoid using keys from |startify-mappings| if providing custom indices.
  195. ------------------------------------------------------------------------------
  196. *g:startify_commands*
  197. >
  198. let g:startify_commands = []
  199. <
  200. A list of commands to execute on selection. Leading colons are optional. It
  201. supports optional custom indices and/or command descriptions.
  202. Example:
  203. >
  204. let g:startify_commands = [
  205. \ ':help reference',
  206. \ ['Vim Reference', 'h ref'],
  207. \ {'h': 'h ref'},
  208. \ {'m': ['My magical function', 'call Magic()']},
  209. \ ]
  210. <
  211. NOTE: Avoid using keys from |startify-mappings| if providing custom indices.
  212. ------------------------------------------------------------------------------
  213. *g:startify_files_number*
  214. >
  215. let g:startify_files_number = 10
  216. <
  217. The number of files to list.
  218. ------------------------------------------------------------------------------
  219. *g:startify_update_oldfiles*
  220. >
  221. let g:startify_update_oldfiles = 0
  222. <
  223. Usually |v:oldfiles| only gets updated when Vim exits. Using this option updates
  224. it on-the-fly, so that :Startify is always up-to-date.
  225. ------------------------------------------------------------------------------
  226. *g:startify_session_autoload*
  227. >
  228. let g:startify_session_autoload = 0
  229. <
  230. If this option is enabled and you start Vim in a directory that contains a
  231. `Session.vim`, that session will be loaded automatically. Otherwise it will be
  232. shown as the top entry in the Startify buffer.
  233. The same happens when you |:cd| to a directory that contains a `Session.vim`
  234. and execute |:Startify|.
  235. It also works if you open a bookmarked directory. See |g:startify_bookmarks|.
  236. This is great way to create a portable project folder!
  237. NOTE: This option is affected by |g:startify_session_delete_buffers|.
  238. ------------------------------------------------------------------------------
  239. *g:startify_session_before_save*
  240. >
  241. let g:startify_session_before_save = []
  242. <
  243. This is a list of commands to be executed before saving a session.
  244. Example:
  245. >
  246. let g:startify_session_before_save = [
  247. \ 'echo "Cleaning up before saving.."',
  248. \ 'silent! NERDTreeTabsClose'
  249. \ ]
  250. <
  251. ------------------------------------------------------------------------------
  252. *g:startify_session_persistence*
  253. >
  254. let g:startify_session_persistence = 0
  255. <
  256. Automatically update sessions in two cases:
  257. 1) Before leaving Vim
  258. 2) Before loading a new session via :SLoad
  259. This also works for sessions started with:
  260. >
  261. vim -S mysession.vim
  262. <
  263. ------------------------------------------------------------------------------
  264. *g:startify_session_delete_buffers*
  265. >
  266. let g:startify_session_delete_buffers = 1
  267. <
  268. Delete all listed buffers when loading or closing a session.
  269. 1. When using |startify-:SLoad|.
  270. 2. When using |startify-:SClose|.
  271. 3. When using |g:startify_session_autoload|.
  272. 4. When choosing a session from the Startify buffer.
  273. ------------------------------------------------------------------------------
  274. *g:startify_change_to_dir*
  275. >
  276. let g:startify_change_to_dir = 1
  277. <
  278. When opening a file or bookmark, change to its directory.
  279. ------------------------------------------------------------------------------
  280. *g:startify_change_to_vcs_root*
  281. >
  282. let g:startify_change_to_vcs_root = 0
  283. <
  284. When opening a file or bookmark, seek and change to the root directory of the
  285. VCS (if there is one).
  286. At the moment only git, hg, bzr and svn are supported.
  287. ------------------------------------------------------------------------------
  288. *g:startify_skiplist*
  289. >
  290. let g:startify_skiplist = [
  291. \ 'COMMIT_EDITMSG',
  292. \ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc',
  293. \ 'bundle/.*/doc',
  294. \ ]
  295. <
  296. A list of Vim regular expressions that is used to filter recently used files.
  297. See |pattern.txt| for what patterns can be used.
  298. NOTE: Due to the nature of patterns, you can't just use "~/mysecret" but have
  299. to use "$HOME .'/mysecret.txt'". The former would do something entirely
  300. different: |/\~|. When using backslashes as path separators, escape them.
  301. Otherwise using "C:\this\vim\path\is\problematic" would not match what you
  302. expect, since |/\v| is a pattern, too.
  303. Example:
  304. >
  305. let g:startify_skiplist = [
  306. \ '\.vimgolf',
  307. \ '^/tmp',
  308. \ '/project/.*/documentation',
  309. \ escape(fnamemodify($HOME, ':p'), '\') .'mysecret.txt',
  310. \ ]
  311. <
  312. ------------------------------------------------------------------------------
  313. *g:startify_fortune_use_unicode*
  314. >
  315. let g:startify_fortune_use_unicode = 0
  316. <
  317. By default, the fortune header uses ASCII characters, because they work for
  318. everyone. If you set this option to 1 and your 'encoding' is "utf-8", Unicode
  319. box-drawing characters will be used instead.
  320. This is not the default, because users of East Asian languages often set
  321. 'ambiwidth' to "double" or make their terminal emulator treat characters of
  322. ambiguous width as double width. Both would make the drawed box look funny.
  323. For more information: http://unicode.org/reports/tr11
  324. ------------------------------------------------------------------------------
  325. *g:startify_padding_left*
  326. >
  327. let g:startify_padding_left = 3
  328. <
  329. The number of spaces used for left padding.
  330. ------------------------------------------------------------------------------
  331. *g:startify_skiplist_server*
  332. >
  333. let g:startify_skiplist_server = []
  334. <
  335. Do not create the startify buffer, if this is a Vim server instance with a
  336. name contained in this list.
  337. Example:
  338. >
  339. let g:startify_skiplist_server = [ 'GVIM' ]
  340. <
  341. ------------------------------------------------------------------------------
  342. *g:startify_enable_special*
  343. >
  344. let g:startify_enable_special = 1
  345. <
  346. Show <empty buffer> and <quit>.
  347. ------------------------------------------------------------------------------
  348. *g:startify_enable_unsafe*
  349. >
  350. let g:startify_enable_unsafe = 0
  351. <
  352. Enable the option only in case you think Vim starts too slowly (because of
  353. :Startify) or if you often edit files on remote filesystems.
  354. It's called unsafe because it improves the time :Startify needs to execute by
  355. reducing the amount of syscalls to the underlying operating system, but
  356. sacrifices the precision of shown entries.
  357. This could lead to inconsistences in the shown :Startify entries (e.g. the
  358. same file could be shown twice, because one time file was opened via absolute
  359. path and another time via symlink).
  360. Currently this option does this:
  361. - don't resolves symlinks (readlink(2))
  362. - don't check every file if it's readable (stat(2))
  363. - don't filter through the bookmark list
  364. ------------------------------------------------------------------------------
  365. *g:startify_session_remove_lines*
  366. >
  367. let g:startify_session_remove_lines = []
  368. <
  369. Lines matching any of the patterns in this list, will be removed from the
  370. session file.
  371. Example:
  372. >
  373. let g:startify_session_remove_lines = ['setlocal', 'winheight']
  374. <
  375. Internally this simply does:
  376. >
  377. :global/setlocal/delete
  378. :global/winheight/delete
  379. <
  380. So you can use any |pattern|.
  381. NOTE: Take care not to mess up any expressions within the session file,
  382. otherwise you'll probably get problems when trying to load it.
  383. ------------------------------------------------------------------------------
  384. *g:startify_session_savevars*
  385. >
  386. let g:startify_session_savevars = []
  387. <
  388. Include a list of variables in here which you would like Startify to save into
  389. the session file in addition to what Vim normally saves into the session file.
  390. For example, Vim will not normally save all-lowercase global variables, which
  391. are common for plugin settings. It may be advisable to include
  392. |g:startify_session_savevars| and |g:startify_session_savecmds| into this list
  393. so they are saved every time the session saves.
  394. Example:
  395. >
  396. let g:startify_session_savevars = [
  397. \ 'g:startify_session_savevars',
  398. \ 'g:startify_session_savecmds',
  399. \ 'g:random_plugin_use_feature'
  400. \ ]
  401. <
  402. ------------------------------------------------------------------------------
  403. *g:startify_session_savecmds*
  404. >
  405. let g:startify_session_savecmds = []
  406. <
  407. Include a list of cmdline commands which Vim will run upon loading the
  408. session. This can be useful to set various things (other than variables,
  409. |g:startify_session_savevars| above) which Vim may not normally save into the
  410. session file, as well as run external commands upon loading a session.
  411. Example:
  412. >
  413. let g:startify_session_savecmds = [
  414. \ 'silent !pdfreader ~/latexproject/main.pdf &'
  415. \ ]
  416. <
  417. ------------------------------------------------------------------------------
  418. *g:startify_session_number*
  419. >
  420. let g:startify_session_number = 999
  421. <
  422. The maximum number of sessions to display. Makes the most sense together with
  423. |g:startify_session_sort|.
  424. ------------------------------------------------------------------------------
  425. *g:startify_session_sort*
  426. >
  427. let g:startify_session_sort = 0
  428. <
  429. Sort sessions by modification time (when the session files were written)
  430. rather than alphabetically.
  431. ------------------------------------------------------------------------------
  432. *g:startify_custom_indices*
  433. >
  434. let g:startify_custom_indices = []
  435. <
  436. Use any list of strings as indices instead of increasing numbers. If there are
  437. more startify entries than actual items in the custom list, the remaining
  438. entries will be filled using the default numbering scheme starting from 0.
  439. Thus you can create your own indexing scheme that fits your keyboard layout.
  440. You don't want to leave the home row, do you?!
  441. Example:
  442. >
  443. let g:startify_custom_indices = ['f', 'g', 'h']
  444. <
  445. This would result in:
  446. [f] /most/recently/used/file1
  447. [g] /most/recently/used/file2
  448. [h] /most/recently/used/file3
  449. [0] /most/recently/used/file4
  450. [1] /most/recently/used/file5
  451. [2] /most/recently/used/file6
  452. etc.
  453. If you want numbers to start at 1 instead of 0, you could use this:
  454. >
  455. let g:startify_custom_indices = map(range(1,100), 'string(v:val)')
  456. <
  457. NOTE: There is no sanitizing going on, so you should know what you're doing!
  458. Avoid using keys from |startify-mappings|.
  459. ------------------------------------------------------------------------------
  460. *g:startify_custom_header*
  461. >
  462. let g:startify_custom_header = 'startify#fortune#cowsay()'
  463. <
  464. Define your own header.
  465. This option takes a `list of strings`, whereas each string will be put on its
  466. own line. If it is a simple `string`, it should evaluate to a list of strings.
  467. Helper functions:~
  468. startify#fortune#quote() random quote
  469. startify#fortune#boxed(...) random quote in a box
  470. startify#fortune#cowsay(...) random quote in a box + cow
  471. The last two functions optionally take a quote in the list of strings format.
  472. They also return a list of strings, suitable for this option.
  473. Example #1:~
  474. >
  475. let g:startify_custom_header = [
  476. \ ' ________ __ __ ',
  477. \ ' __ /\_____ \/\ \\ \ ',
  478. \ ' __ __ /\_\ ___ ___ \/___//''/''\ \ \\ \ ',
  479. \ ' /\ \/\ \\/\ \ /'' __` __`\ /'' /'' \ \ \\ \_ ',
  480. \ ' \ \ \_/ |\ \ \/\ \/\ \/\ \ /'' /''__ \ \__ ,__\',
  481. \ ' \ \___/ \ \_\ \_\ \_\ \_\ /\_/ /\_\ \/_/\_\_/ ',
  482. \ ' \/__/ \/_/\/_/\/_/\/_/ \// \/_/ \/_/ ',
  483. \ ]
  484. <
  485. Example #2:~
  486. >
  487. let g:startify_custom_header =
  488. \ map(split(system('fortune | cowsay'), '\n'), '" ". v:val')
  489. <
  490. Example #3:~
  491. Let's assume you like the default boxed random quote, but not the ASCII art
  492. cow. You'd rather have another small ASCII art come before the quote. No
  493. problem!
  494. >
  495. let g:ascii = [
  496. \ ' __',
  497. \ '.--.--.|__|.--------.',
  498. \ '| | || || |',
  499. \ ' \___/ |__||__|__|__|',
  500. \ ''
  501. \]
  502. let g:startify_custom_header = g:ascii + startify#fortune#boxed()
  503. <
  504. Looks great! But it's not on the same column as the indices below which makes
  505. it look awkward. Let's indent the header by 3 spaces:
  506. >
  507. let g:startify_custom_header =
  508. \ map(g:ascii + startify#fortune#boxed(), '" ".v:val')
  509. <
  510. Ah, much better! There's only one issue left. If you set
  511. g:startify_custom_header this way, it will only be done once. Hence spamming
  512. :Startify will always show the same quote.
  513. If you provide a string to it instead, Startify will evaluate it every time
  514. :Startify is run:
  515. >
  516. let g:startify_custom_header =
  517. \ 'map(g:ascii + startify#fortune#boxed(), "\" \".v:val")'
  518. <
  519. Happy customizing!
  520. Also have a look at |startify-faq-08|.
  521. ------------------------------------------------------------------------------
  522. *g:startify_custom_header_quotes*
  523. If you don't set |g:startify_custom_header|, the internal cowsay implementation
  524. with predefined random quotes will be used.
  525. To use your own quotes, set this option to a list of quotes. Each quote is
  526. either another list or a |Funcref| (see |expr-lambda|) that returns a list.
  527. Each element of the inner lists is put on an own line in the custom header.
  528. >
  529. let g:startify_custom_header_quotes = [
  530. \ ['quote #1'],
  531. \ ['quote #2', 'using', 'three lines'],
  532. \ {-> systemlist('echo quote #3')}
  533. \ ]
  534. <
  535. If you want the predefined quotes as well, use this:
  536. >
  537. let g:startify_custom_header_quotes =
  538. \ startify#fortune#predefined_quotes() + [['quote 1', 'quote 2']]
  539. <
  540. ------------------------------------------------------------------------------
  541. *g:startify_custom_footer*
  542. >
  543. let g:startify_custom_footer = ''
  544. <
  545. Same as the custom header, but shown at the bottom of the startify buffer.
  546. ------------------------------------------------------------------------------
  547. *g:startify_disable_at_vimenter*
  548. >
  549. let g:startify_disable_at_vimenter = 0
  550. <
  551. Don't run Startify at Vim startup. You can still call it anytime via
  552. :Startify.
  553. -----------------------------------------------------------------------------
  554. *g:startify_relative_path*
  555. >
  556. let g:startify_relative_path = 0
  557. <
  558. If the file is in or below the current working directory, use a relative path.
  559. Otherwise an absolute path is used. The latter prevents hard to grasp entries
  560. like `../../../../../foo`.
  561. NOTE: This only applies to the "files" list, since the "dir" list is
  562. relative by nature.
  563. -----------------------------------------------------------------------------
  564. *g:startify_use_env*
  565. >
  566. let g:startify_use_env = 0
  567. <
  568. Show environment variables in path, if their name is shorter than their value.
  569. See |startify-colors| for highlighting them.
  570. $PWD and $OLDPWD are ignored.
  571. ==============================================================================
  572. AUTOCMD *startify-autocmd*
  573. When the Startify buffer is fully set up, it emits an User event. You can hook
  574. into that to customize Startify even further:
  575. >
  576. autocmd User Startified let &l:stl = ' This statusline rocks!'
  577. <
  578. Or use it to disable single mappings: |startify-faq-16|.
  579. NOTE: Autocmds don't nest by default. If you use any command that triggers new
  580. events, be sure to add "nested": |autocmd-nested|.
  581. ==============================================================================
  582. COMMANDS *startify-commands*
  583. *startify-:Startify*
  584. >
  585. :Startify
  586. <
  587. Open the startify buffer.
  588. *startify-:SSave*
  589. *startify-:SDelete*
  590. >
  591. :SSave[!] [session]
  592. :SDelete[!] [session]
  593. <
  594. Save or delete a session. If you don't specify a session name, it will prompt
  595. you for one.
  596. Use `:SSave!` or `:SDelete!` to always overwrite or delete an existing session.
  597. *startify-:SLoad*
  598. >
  599. :SLoad [session]
  600. <
  601. Load a session. If you don't specify a session name, it will either prompt you
  602. for one (Windows) or load the last used session (Unix).
  603. Providing only a part of the session name works too, if you complete the
  604. argument with either <c-d> or <tab> afterwards.
  605. NOTE: This command is affected by |g:startify_session_delete_buffers|.
  606. *startify-:SClose*
  607. >
  608. :SClose
  609. <
  610. Save and close the current session, close all listed buffers, and open the
  611. Startify buffer.
  612. NOTE: This command is affected by |g:startify_session_delete_buffers|.
  613. ==============================================================================
  614. MAPPINGS *startify-mappings*
  615. Some things are remapped in the startify buffer..
  616. >
  617. q
  618. <
  619. Close startify. Also quit Vim if it is the only buffer.
  620. >
  621. e
  622. <
  623. Close startify and create a blank buffer.
  624. >
  625. i
  626. <insert>
  627. <
  628. Close startify, create a blank buffer and jump into insert mode right away.
  629. >
  630. <2-LeftMouse>
  631. <
  632. Use a simple mouse click to open the targeted entry.
  633. >
  634. [any number that is shown between square brackets]
  635. <
  636. Open the entry with the given number.
  637. >
  638. b
  639. s
  640. v
  641. t
  642. <
  643. Mark current entry to be opened in either the same window, in a split window,
  644. in a vertical split window or in a new tab.
  645. >
  646. <cr>
  647. <
  648. Open all marked entries. If nothing was marked beforehand, just open the
  649. current entry.
  650. If you want to use another key instead of <cr>, put this in your vimrc:
  651. >
  652. autocmd User Startified nmap <buffer> o <plug>(startify-open-buffers)
  653. <
  654. ==============================================================================
  655. COLORS *startify-colors*
  656. You can overwrite the highlight groups used by startify. The plugin defines
  657. these groups:
  658. Highlight group | Description | Default
  659. ------------------------------------------------------------------
  660. | |
  661. StartifyBracket | [,] | linked to Delimiter
  662. StartifyFile | the actual file | <none>
  663. StartifyFooter | the custom footer | linked to Normal
  664. StartifyHeader | the custom header | linked to Normal
  665. StartifyNumber | the numbers between [] | linked to Number
  666. StartifyPath | the path to a file | <none>
  667. StartifySection | section headers | linked to Special
  668. StartifySelect | selected entries | linked to Title
  669. StartifySlash | slashes in paths | <none>
  670. StartifySpecial | <empty buffer>,<quit> | <none>
  671. StartifyVar | environment variables | linked to StartifyPath
  672. Example: (my terminal emulator supports 256 colors)
  673. >
  674. highlight StartifyBracket ctermfg=240
  675. highlight StartifyFooter ctermfg=240
  676. highlight StartifyHeader ctermfg=114
  677. highlight StartifyNumber ctermfg=215
  678. highlight StartifyPath ctermfg=245
  679. highlight StartifySlash ctermfg=240
  680. highlight StartifySpecial ctermfg=240
  681. <
  682. ==============================================================================
  683. MISC *startify-misc*
  684. Changing the entry format:~
  685. You can create a function `StartifyEntryFormat()` which returns a string that
  686. gets evaluated in Startify. In that string, `entry_path` and `absolute_path`
  687. will be replaced by their respective values.
  688. `absolute_path` is self-explaining and `entry_path` is the same path but
  689. potentially shortened, depending on options like |g:startify_relative_path|.
  690. Let us assume you have vim-devicons installed. That plugin has a function
  691. `WebDevIconsGetFileTypeSymbol()` which returns an icon depending on the given
  692. file. Prepend the logo to each Startify entry by putting this in your vimrc:
  693. >
  694. function! StartifyEntryFormat()
  695. return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path'
  696. endfunction
  697. <
  698. ==============================================================================
  699. FAQ *startify-faq*
  700. |startify-faq-01| I don't want the start screen to use cursorline!
  701. |startify-faq-02| Recent files aren't shown!
  702. |startify-faq-03| I have broken colors when using sessions!
  703. |startify-faq-04| How to disable common but unimportant files?
  704. |startify-faq-05| Why is the Startify buffer not using buftype=nofile?
  705. |startify-faq-06| How do I get both NERDTree and Startify working at
  706. startup?
  707. |startify-faq-07| The session autoload feature is not working!
  708. |startify-faq-08| How do I center my header/footer?
  709. |startify-faq-09| tmux-resurrect?
  710. |startify-faq-10| Temporarily skip Startify at start?
  711. |startify-faq-11| How to use the output of a command as header?
  712. |startify-faq-12| There is an empty window with vim-plug!
  713. |startify-faq-13| How to disable random quotes header?
  714. |startify-faq-14| NERDTree with NERDTreeTabs does not work in gvim!
  715. |startify-faq-15| Startify is cluttered with help files!
  716. |startify-faq-16| How to disable single mappings?
  717. |startify-faq-17| Run Startify for each new tab!
  718. ------------------------------------------------------------------------------
  719. *startify-faq-01*
  720. I want to use cursorline!~
  721. Startify issues a User event when it's finished. It can be used to set
  722. buffer-local options etc.
  723. >
  724. autocmd User Startified setlocal cursorline
  725. <
  726. ------------------------------------------------------------------------------
  727. *startify-faq-02*
  728. Recent files aren't shown!~
  729. Perhaps the problem is that the viminfo file..
  730. - doesn't exist
  731. - is invalid
  732. - is empty
  733. - can't be read (check permissions)
  734. I suggest the following steps:
  735. 1) Create a new directory:
  736. >
  737. $ mkdir -p ~/.vim/files/info
  738. <
  739. 2) Put this into your vimrc:
  740. >
  741. set viminfo='100,n$HOME/.vim/files/info/viminfo
  742. <
  743. See |'viminfo'| for information about the second step and what it does
  744. exactly.
  745. ------------------------------------------------------------------------------
  746. *startify-faq-03*
  747. I have broken colors when using sessions!~
  748. Nothing this plugin could do about. Try playing around with 'sessionoptions'.
  749. NOTE: Startify removes 'options' from the session options automatically,
  750. because it's the source of many problems.
  751. Some people swear it works for them with these settings:
  752. >
  753. set sessionoptions=blank,curdir,folds,help,tabpages,winpos
  754. <
  755. ------------------------------------------------------------------------------
  756. *startify-faq-04*
  757. How to disable common but unimportant files?~
  758. Use |g:startify_skiplist|.
  759. ------------------------------------------------------------------------------
  760. *startify-faq-05*
  761. Why is the Startify buffer not using buftype=nofile?~
  762. Did you accidentally use |:write| in the Startify buffer and it was saved to
  763. an actual file on disk? It's because buftype=nofile is not used.
  764. This is done to improve compatibility with other plugins. When buftype=nofile
  765. was set, plugins like CtrlP or NERDTree would open splits instead of reusing
  766. the window showing the Startify buffer.
  767. If you understand this but want it anyway, put this in your vimrc:
  768. >
  769. autocmd User Startified setlocal buftype=nofile
  770. <
  771. ------------------------------------------------------------------------------
  772. *startify-faq-06*
  773. How do I get both NERDTree and Startify working at startup?~
  774. Put this in your vimrc:
  775. >
  776. autocmd VimEnter *
  777. \ if !argc()
  778. \ | Startify
  779. \ | NERDTree
  780. \ | wincmd w
  781. \ | endif
  782. <
  783. ------------------------------------------------------------------------------
  784. *startify-faq-07*
  785. The session autoload feature is not working!~
  786. Do you have NERDTree installed by any chance? If so, try this:
  787. >
  788. let NERDTreeHijackNetrw = 0
  789. <
  790. ------------------------------------------------------------------------------
  791. *startify-faq-08*
  792. How do I center my header/footer?~
  793. Try something along these lines:
  794. >
  795. function! s:filter_header(lines) abort
  796. let longest_line = max(map(copy(a:lines), 'strwidth(v:val)'))
  797. let centered_lines = map(copy(a:lines),
  798. \ 'repeat(" ", (&columns / 2) - (longest_line / 2)) . v:val')
  799. return centered_lines
  800. endfunction
  801. let g:startify_custom_header = s:filter_header(startify#fortune#cowsay())
  802. <
  803. ------------------------------------------------------------------------------
  804. *startify-faq-09*
  805. tmux-resurrect?~
  806. If you use tmux-resurrect to restore your tmux environment, you can use :SLoad
  807. to load your last used session right away:
  808. >
  809. set -g @resurrect-processes '"vim->vim +SLoad"'
  810. <
  811. ------------------------------------------------------------------------------
  812. *startify-faq-10*
  813. Temporarily skip Startify at start?~
  814. In some cases you might need to skip Startify at start. E.g.
  815. >
  816. vim +VimwikiMakeDiaryNote
  817. <
  818. Startify would interfere in this case. A simple way to avoid that would be:
  819. >
  820. vim --cmd 'let g:startify_disable_at_vimenter = 1' +VimwikiMakeDiaryNote
  821. <
  822. ------------------------------------------------------------------------------
  823. *startify-faq-11*
  824. How to use the output of a command as header?~
  825. >
  826. redir => test
  827. silent echo 'one'
  828. silent echo 'two'
  829. silent echo 'three'
  830. redir END
  831. let g:startify_custom_header =
  832. \ map(split(test), 'repeat(" ", 10) . v:val')
  833. <
  834. |:redir| puts a string into 'test'. Then we turn it into a list of strings.
  835. Then we shift each string to the right by 10 spaces. Afterwards we add an
  836. empty string to the list, which results in an empty line in the header.
  837. ------------------------------------------------------------------------------
  838. *startify-faq-12*
  839. There is an empty window with vim-plug!~
  840. After start there might be only the Startify buffer which is marked as
  841. |unlisted-buffer|. The problem arises if you use :PlugUpdate followed by 'D'
  842. to see the changes. An empty window!
  843. The actual problem is that Vim won't close the last listed buffer. Try this:
  844. >
  845. $ vim -u NONE -N
  846. :set nobuflisted
  847. :new
  848. :bd
  849. <
  850. It won't close the buffer and therefore the window. This also happens in
  851. vim-plug. Note that this is no bug in neither plugin, it's a Vim weirdness.
  852. Workaround #1:~
  853. >
  854. autocmd User Startified setlocal buflisted
  855. <
  856. In some cases this could break other plugins at start (I look at you
  857. NERDTree), but works well most of the time.
  858. Workaround #2:~
  859. >
  860. let g:plug_window = 'enew' " or maybe 'tabnew'
  861. <
  862. This will open the plug buffer in the current window instead of creating a new
  863. window on the left side. Mind that this will also close the Startify buffer
  864. since it will be hidden.
  865. ------------------------------------------------------------------------------
  866. *startify-faq-13*
  867. How to disable random quotes header?~
  868. >
  869. let g:startify_custom_header = []
  870. <
  871. See |g:startify_custom_header|.
  872. ------------------------------------------------------------------------------
  873. *startify-faq-14*
  874. NERDTree with NERDTreeTabs does not work in gvim!~
  875. Mind that `https://github.com/jistr/vim-nerdtree-tabs` is no longer maintained
  876. and has quite some issues.
  877. Anyway, this particular issue can be resolved in different ways. See:
  878. https://github.com/mhinz/vim-startify/issues/24
  879. ------------------------------------------------------------------------------
  880. *startify-faq-15*
  881. Startify is cluttered with help files!~
  882. Everytime you use |:h|, you open a file from the Vim runtime directory or of
  883. an installed plugin. By default, Startify detects these files and skips them.
  884. This works for most use cases, but not for all.
  885. If the default fails for you and the Startify buffer is cluttered with help
  886. files, add that path to the skiplist yourself: |g:startify_skiplist|.
  887. ------------------------------------------------------------------------------
  888. *startify-faq-16*
  889. How to disable single mappings?~
  890. Use |startify-autocmd|:
  891. >
  892. autocmd User Startified for key in ['b','s','t','v'] |
  893. \ execute 'nunmap <buffer>' key | endfor
  894. <
  895. ------------------------------------------------------------------------------
  896. *startify-faq-17*
  897. Run Startify for each new tab!~
  898. >
  899. if has('nvim')
  900. autocmd TabNewEntered * Startify
  901. else
  902. autocmd VimEnter * let t:startify_new_tab = 1
  903. autocmd BufEnter *
  904. \ if !exists('t:startify_new_tab') && empty(expand('%')) |
  905. \ let t:startify_new_tab = 1 |
  906. \ Startify |
  907. \ endif
  908. endif
  909. <
  910. ==============================================================================
  911. EXAMPLE *startify-example*
  912. >
  913. autocmd User Startified setlocal cursorline
  914. let g:startify_enable_special = 0
  915. let g:startify_files_number = 8
  916. let g:startify_relative_path = 1
  917. let g:startify_change_to_dir = 1
  918. let g:startify_update_oldfiles = 1
  919. let g:startify_session_autoload = 1
  920. let g:startify_session_persistence = 1
  921. let g:startify_skiplist = [
  922. \ 'COMMIT_EDITMSG',
  923. \ 'bundle/.*/doc',
  924. \ '/data/repo/neovim/runtime/doc',
  925. \ '/Users/mhi/local/vim/share/vim/vim74/doc',
  926. \ ]
  927. let g:startify_bookmarks = [
  928. \ { 'c': '~/.vim/vimrc' },
  929. \ '~/golfing',
  930. \ ]
  931. let g:startify_custom_header =
  932. \ startify#fortune#cowsay('', '═','║','╔','╗','╝','╚')
  933. let g:startify_custom_footer =
  934. \ ['', " Vim is charityware. Please read ':help uganda'.", '']
  935. hi StartifyBracket ctermfg=240
  936. hi StartifyFile ctermfg=147
  937. hi StartifyFooter ctermfg=240
  938. hi StartifyHeader ctermfg=114
  939. hi StartifyNumber ctermfg=215
  940. hi StartifyPath ctermfg=245
  941. hi StartifySlash ctermfg=240
  942. hi StartifySpecial ctermfg=240
  943. <
  944. ==============================================================================
  945. vim: tw=78