startify.txt 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. *startify.txt* Showing recently used stuff like a boss.
  2. *startify*
  3. __ __ ___
  4. /\ \__ /\ \__ __ /'___\
  5. ____\ \ ,_\ __ _ __\ \ ,_\/\_\/\ \__/ __ __
  6. /',__\\ \ \/ /'__`\ /\`'__\ \ \/\/\ \ \ ,__\/\ \/\ \
  7. /\__, `\\ \ \_/\ \L\.\_\ \ \/ \ \ \_\ \ \ \ \_/\ \ \_\ \
  8. \/\____/ \ \__\ \__/.\_\\ \_\ \ \__\\ \_\ \_\ \/`____ \
  9. \/___/ \/__/\/__/\/_/ \/_/ \/__/ \/_/\/_/ `/___/> \
  10. /\___/
  11. \/__/
  12. by Marco Hinz~
  13. Twitter: https://twitter.com/_mhinz_
  14. Github: http://github.com/mhinz
  15. IRC: mhi^ (Freenode)
  16. >
  17. If you use any of my plugins, please star them on github. It's a great way
  18. of getting feedback and gives me the kick to put more time into their
  19. development.
  20. If you encounter any bugs or have feature requests, just open an issue
  21. report on Github.
  22. Thank you for flying mhi^ airlines. Get the Vim on!
  23. <
  24. ==============================================================================
  25. CONTENTS *startify-contents*
  26. INTRO .......................................... |startify-intro|
  27. USAGE .......................................... |startify-usage|
  28. OPTIONS ........................................ |startify-options|
  29. AUTOCMD ........................................ |startify-autocmd|
  30. COMMANDS ....................................... |startify-commands|
  31. MAPPINGS ....................................... |startify-mappings|
  32. COLORS ......................................... |startify-colors|
  33. FAQ ............................................ |startify-faq|
  34. EXAMPLE ........................................ |startify-example|
  35. ==============================================================================
  36. INTRO *startify-intro*
  37. Startify is a plugin that shows recently used files, bookmarks and
  38. sessions that were saved to a certain directory.
  39. ==============================================================================
  40. USAGE *startify-usage*
  41. Startify basically provides two things:
  42. 1) If you start Vim without giving any filenames to it (or pipe stuff to it so
  43. it reads from STDIN), startify will show a small but pretty start screen
  44. that shows recently used files (using viminfo) and sessions by default.
  45. Additionally, you can define bookmarks, thus entries for files that always
  46. should be available on the start screen.
  47. You can either navigate to a certain menu entry and hit enter or you just
  48. key in whatever is written between the square brackets on that line. You
  49. can even double-click anywhere on the line now.
  50. In addition, 'e' creates an empty buffer, 'i' creates an empty buffer and
  51. jumps into insert mode, 'q' quits.
  52. Moreover, you can open several files at one go. Navigate to an entry and
  53. hit either 'b' (open in same window), 's' (open in split), 'v' (open in
  54. vertical split) or 't' (open in tab). You can do that for multiple entries.
  55. You can also mix them. The order of the selections will be remembered.
  56. Afterwards execute these actions via <cr>.
  57. When the selection is finished, Startify will close automatically. You can
  58. reopen the screen via :Startify.
  59. And you can define your own custom ascii art header now!
  60. 2) It eases handling of loading and saving sessions by only working with a
  61. certain directory. These commands are used for convenience:
  62. :SLoad load a session
  63. :SSave save a session
  64. :SDelete[!] delete a session
  65. :SClose close a session
  66. If ! is given, you won't get prompted.
  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_relative_path|
  79. |g:startify_skiplist|
  80. |g:startify_update_oldfiles|
  81. Misc options:~
  82. |g:startify_custom_footer|
  83. |g:startify_custom_indices|
  84. |g:startify_disable_at_vimenter|
  85. |g:startify_enable_unsafe|
  86. |g:startify_files_number|
  87. |g:startify_mapping_nowait|
  88. |g:startify_skiplist_server|
  89. |g:startify_use_env|
  90. Sessions:~
  91. |g:startify_session_autoload|
  92. |g:startify_session_delete_buffers|
  93. |g:startify_session_dir|
  94. |g:startify_session_persistence|
  95. |g:startify_session_remove_lines|
  96. |g:startify_session_savecmds|
  97. |g:startify_session_savevars|
  98. ------------------------------------------------------------------------------
  99. *g:startify_session_dir*
  100. >
  101. let g:startify_session_dir = '~/.vim/session'
  102. <
  103. The directory to save/load sessions to/from.
  104. The default for Windows systems is '$HOME\vimfiles\session'.
  105. ------------------------------------------------------------------------------
  106. *g:startify_list_order*
  107. >
  108. let g:startify_list_order = ['files', 'dir', 'bookmarks', 'sessions']
  109. <
  110. At the moment startify supports these lists:~
  111. 1) "files"
  112. This lists the most recently used files using viminfo. The number of files
  113. is limited by |g:startify_files_number|.
  114. 2) "dir"
  115. This lists the files from the current directory sorted by modification
  116. time. The number of files is limited by |g:startify_files_number|.
  117. 3) "bookmarks"
  118. This lists bookmarks, thus hardcoded files or directories that will always
  119. be shown. Have a look at |g:startify_bookmarks|.
  120. 4) "sessions"
  121. This lists all the sessions saved in the directory |g:startify_session_dir|.
  122. Section headers:~
  123. Additionally you can add lists of strings to that list. These will be shown
  124. above the following item in |g:startify_list_order|.
  125. NOTE: Section headers are context-senstive. This means that if the following
  126. item is a startify list ("dir", "bookmarks", ...) and empty (no files in the
  127. current directory, no bookmarks defined, ...), the section header won't be
  128. shown as well.
  129. NOTE: The section header use the StartifySection highlight group.
  130. Section headers example:~
  131. >
  132. let g:startify_list_order = [
  133. \ [' My most recently', ' used files'],
  134. \ 'files',
  135. \ [' My most recently used files in the current directory:'],
  136. \ 'dir',
  137. \ [' These are my sessions:'],
  138. \ 'sessions',
  139. \ [' These are my bookmarks:'],
  140. \ 'bookmarks',
  141. \ ]
  142. <
  143. Feel free to add some cool ASCII action!
  144. ------------------------------------------------------------------------------
  145. *g:startify_bookmarks*
  146. >
  147. let g:startify_bookmarks = []
  148. <
  149. A list of files or directories to bookmark. The list can contain two kinds of
  150. types. Either a path or a dictionary whereas the key is the custom index and
  151. the value the path.
  152. Example:
  153. >
  154. let g:startify_bookmarks = [ {'c': '~/.vimrc'}, '~/.zshrc' ]
  155. <
  156. NOTE: Avoid using keys from |startify-mappings| if providing custom indices.
  157. ------------------------------------------------------------------------------
  158. *g:startify_files_number*
  159. >
  160. let g:startify_files_number = 10
  161. <
  162. The number of files to list.
  163. ------------------------------------------------------------------------------
  164. *g:startify_update_oldfiles*
  165. >
  166. let g:startify_update_oldfiles = 0
  167. <
  168. Usually |v:oldfiles| only gets updated when Vim exits. Using this option updates
  169. it on-the-fly, so that :Startify is always up-to-date.
  170. ------------------------------------------------------------------------------
  171. *g:startify_session_autoload*
  172. >
  173. let g:startify_session_autoload = 0
  174. <
  175. If you fire up "vim" in a directory that contains a "Session.vim", that session
  176. will be loaded automatically. Otherwise it will be shown as the top entry in
  177. the Startify buffer.
  178. This also works if you open a bookmarked directory.
  179. Great way to create a portable project folder.
  180. ------------------------------------------------------------------------------
  181. *g:startify_session_persistence*
  182. >
  183. let g:startify_session_persistence = 0
  184. <
  185. Automatically update sessions in two cases:
  186. 1) Before leaving Vim
  187. 2) Before loading a new session via :SLoad
  188. This also works for sessions started with:
  189. >
  190. vim -S mysession.vim
  191. <
  192. ------------------------------------------------------------------------------
  193. *g:startify_session_delete_buffers*
  194. >
  195. let g:startify_session_delete_buffers = 0
  196. <
  197. Delete open buffers before loading a new session.
  198. ------------------------------------------------------------------------------
  199. *g:startify_change_to_dir*
  200. >
  201. let g:startify_change_to_dir = 1
  202. <
  203. When opening a file or bookmark, change to its directory.
  204. ------------------------------------------------------------------------------
  205. *g:startify_change_to_vcs_root*
  206. >
  207. let g:startify_change_to_vcs_root = 0
  208. <
  209. When opening a file or bookmark, seek and change to the root directory of the
  210. VCS (if there is one).
  211. At the moment only git, hg, bzr and svn are supported.
  212. ------------------------------------------------------------------------------
  213. *g:startify_skiplist*
  214. >
  215. let g:startify_skiplist = [
  216. \ 'COMMIT_EDITMSG',
  217. \ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc',
  218. \ 'bundle/.*/doc',
  219. \ ]
  220. <
  221. A list of Vim regular expressions that is used to filter recently used files.
  222. See |pattern.txt| for what patterns can be used.
  223. NOTE: Due to the nature of patterns, you can't just use "~/mysecret" but have
  224. to use "$HOME .'/mysecret.txt'". The former would do something entirely
  225. different: |/\~|. When using backslashes as path separators, escape them.
  226. Otherwise using "C:\this\vim\path\is\problematic" would not match what you
  227. expect, since |/\v| is a pattern, too.
  228. Example:
  229. >
  230. let g:startify_skiplist = [
  231. \ '\.vimgolf',
  232. \ '^/tmp',
  233. \ '/project/.*/documentation',
  234. \ escape(fnamemodify($HOME, ':p'), '\') .'mysecret.txt',
  235. \ ]
  236. <
  237. ------------------------------------------------------------------------------
  238. *g:startify_skiplist_server*
  239. >
  240. let g:startify_skiplist_server = []
  241. <
  242. Do not create the startify buffer, if this is a Vim server instance with a
  243. name contained in this list.
  244. Example:
  245. >
  246. let g:startify_skiplist_server = [ 'GVIM' ]
  247. <
  248. ------------------------------------------------------------------------------
  249. *g:startify_enable_special*
  250. >
  251. let g:startify_enable_special = 1
  252. <
  253. Show <empty buffer> and <quit>.
  254. ------------------------------------------------------------------------------
  255. *g:startify_enable_unsafe*
  256. >
  257. let g:startify_enable_unsafe = 0
  258. <
  259. Enable the option only in case you think Vim starts too slowly (because of
  260. :Startify) or if you often edit files on remote filesystems.
  261. It's called unsafe because it improves the time :Startify needs to execute by
  262. reducing the amount of syscalls to the underlying operating system, but
  263. sacrifices the precision of shown entries.
  264. This could lead to inconsistences in the shown :Startify entries (e.g. the
  265. same file could be shown twice, because one time file was opened via absolute
  266. path and another time via symlink).
  267. Currently this option does this:
  268. - don't resolves symlinks (readlink(2))
  269. - don't check every file if it's readable (stat(2))
  270. - don't filter through the bookmark list
  271. ------------------------------------------------------------------------------
  272. *g:startify_session_remove_lines*
  273. >
  274. let g:startify_session_remove_lines = []
  275. <
  276. Lines matching any of the patterns in this list, will be removed from the
  277. session file.
  278. Example:
  279. >
  280. let g:startify_session_remove_lines = ['setlocal', 'winheight']
  281. <
  282. Internally this simply does:
  283. >
  284. :global/setlocal/delete
  285. :global/winheight/delete
  286. <
  287. So you can use any |pattern|.
  288. NOTE: Take care not to mess up any expressions within the session file,
  289. otherwise you'll probably get problems when trying to load it.
  290. ------------------------------------------------------------------------------
  291. *g:startify_session_savevars*
  292. >
  293. let g:startify_session_savevars = []
  294. <
  295. Include a list of variables in here which you would like Startify to save into
  296. the session file in addition to what Vim normally saves into the session file.
  297. For example, Vim will not normally save all-lowercase global variables, which
  298. are common for plugin settings. It may be advisable to include
  299. |g:startify_session_savevars| and |g:startify_session_savecmds| into this list
  300. so they are saved every time the session saves.
  301. Example:
  302. >
  303. let g:startify_session_savevars = [
  304. \ 'g:startify_session_savevars',
  305. \ 'g:startify_session_savecmds',
  306. \ 'g:random_plugin_use_feature'
  307. \ ]
  308. <
  309. ------------------------------------------------------------------------------
  310. *g:startify_session_savecmds*
  311. >
  312. let g:startify_session_savecmds = []
  313. <
  314. Include a list of cmdline commands which Vim will run upon loading the
  315. session. This can be useful to set various things (other than variables,
  316. |g:startify_session_savevars| above) which Vim may not normally save into the
  317. session file, as well as run external commands upon loading a session.
  318. Example:
  319. >
  320. let g:startify_session_savecmds = [
  321. \ 'silent !pdfreader ~/latexproject/main.pdf &'
  322. \ ]
  323. <
  324. ------------------------------------------------------------------------------
  325. *g:startify_custom_indices*
  326. >
  327. let g:startify_custom_indices = []
  328. <
  329. Use any list of strings as indices instead of increasing numbers. If there are
  330. more startify entries than actual items in the custom list, the remaining
  331. entries will be filled using the default numbering scheme starting from 0.
  332. Thus you can create your own indexing scheme that fits your keyboard layout.
  333. You don't want to leave the home row, do you?!
  334. Example:
  335. >
  336. let g:startify_custom_indices = ['f', 'g', 'h']
  337. <
  338. This would result in:
  339. [f] /most/recently/used/file1
  340. [g] /most/recently/used/file2
  341. [h] /most/recently/used/file3
  342. [0] /most/recently/used/file4
  343. [1] /most/recently/used/file5
  344. [2] /most/recently/used/file6
  345. etc.
  346. If you want numbers to start at 1 instead of 0, you could use this:
  347. >
  348. let g:startify_custom_indices = map(range(1,100), 'string(v:val)')
  349. <
  350. NOTE: There is no sanitizing going on, so you should know what you're doing!
  351. Avoid using keys from |startify-mappings|.
  352. ------------------------------------------------------------------------------
  353. *g:startify_custom_header*
  354. >
  355. let g:startify_custom_header = ''
  356. <
  357. This is a list of single-quoted strings to be shown before everything else.
  358. Every string will be written on its own line.
  359. NOTE: If a string contains ', you have to quote it with another '.
  360. A programmatic example:
  361. >
  362. let g:startify_custom_header =
  363. \ map(split(system('fortune | cowsay'), '\n'), '" ". v:val') + ['','']
  364. <
  365. A hardcoded example:
  366. >
  367. let g:startify_custom_header = [
  368. \ ' ________ __ __ ',
  369. \ ' __ /\_____ \/\ \\ \ ',
  370. \ ' __ __ /\_\ ___ ___ \/___//''/''\ \ \\ \ ',
  371. \ ' /\ \/\ \\/\ \ /'' __` __`\ /'' /'' \ \ \\ \_ ',
  372. \ ' \ \ \_/ |\ \ \/\ \/\ \/\ \ /'' /''__ \ \__ ,__\',
  373. \ ' \ \___/ \ \_\ \_\ \_\ \_\ /\_/ /\_\ \/_/\_\_/ ',
  374. \ ' \/__/ \/_/\/_/\/_/\/_/ \// \/_/ \/_/ ',
  375. \ '',
  376. \ '',
  377. \ ]
  378. <
  379. Also have a look at |startify-faq-08|.
  380. ------------------------------------------------------------------------------
  381. *g:startify_custom_footer*
  382. >
  383. let g:startify_custom_footer = ''
  384. <
  385. Same as the custom header, but shown at the bottom of the startify buffer.
  386. ------------------------------------------------------------------------------
  387. *g:startify_disable_at_vimenter*
  388. >
  389. let g:startify_disable_at_vimenter = 0
  390. <
  391. Don't run Startify at Vim startup. You can still call it anytime via
  392. :Startify.
  393. -----------------------------------------------------------------------------
  394. *g:startify_relative_path*
  395. >
  396. let g:startify_relative_path = 0
  397. <
  398. Show filenames relative to the current working directory instead of as
  399. absolute paths. This only applies to the "files" list, since the "dir" list is
  400. relative by nature.
  401. -----------------------------------------------------------------------------
  402. *g:startify_use_env*
  403. >
  404. let g:startify_use_env = 0
  405. <
  406. Show environment variables in path, if their name is shorter than their value.
  407. See |startify-colors| for highlighting them.
  408. $PWD and $OLDPWD are ignored.
  409. -----------------------------------------------------------------------------
  410. *g:startify_mapping_nowait*
  411. >
  412. let g:startify_mapping_nowait = 0
  413. <
  414. Force the usage of |<nowait>| in all mappings.
  415. This helps guarding against global mappings that start with the same
  416. characters as a Startify index, but might break local mappings, e.g. when you
  417. have indexes "1" and "11", the "11" won't be accessable anymore, since "1"
  418. will be opened right way.
  419. Only use this when you know what you're doing.
  420. NOTE: This option needs at least Vim 7.3.1261. It gets ignored otherwise.
  421. ==============================================================================
  422. AUTOCMD *startify-autocmd*
  423. In case you want to alter the startify buffer to cause all kinds of mayhem, an
  424. user autocmd is issued. You can hook into it like this:
  425. >
  426. autocmd User Startified let &l:stl = ' This statusline rocks!'
  427. <
  428. ==============================================================================
  429. COMMANDS *startify-commands*
  430. >
  431. :Startify
  432. <
  433. Open the startify buffer.
  434. >
  435. :SSave [session]
  436. :SDelete [session]
  437. <
  438. Save or delete a session. If you don't specify a session name, it will prompt
  439. you for one.
  440. >
  441. :SLoad [session]
  442. <
  443. Load a session. If you don't specify a session name, it will either prompt you
  444. for one (Windows) or load the last used session (Unix).
  445. Providing only a part of the session name works too, if you complete the
  446. argument with either <c-d> or <tab> afterwards.
  447. >
  448. :SClose
  449. <
  450. Save and close the current session, close all listed buffers, and open the
  451. Startify buffer.
  452. ==============================================================================
  453. MAPPINGS *startify-mappings*
  454. Some things are remapped in the startify buffer..
  455. >
  456. q
  457. <
  458. Close startify. Also quit Vim if it is the only buffer.
  459. >
  460. e
  461. <
  462. Close startify and create a blank buffer.
  463. >
  464. i
  465. <insert>
  466. <
  467. Close startify, create a blank buffer and jump into insert mode right away.
  468. >
  469. <2-LeftMouse>
  470. <
  471. Use a simple mouse click to open the targeted entry.
  472. >
  473. [any number that is shown between square brackets]
  474. <
  475. Open the entry with the given number.
  476. >
  477. b
  478. s
  479. v
  480. t
  481. <
  482. Mark current entry to be opened in either the same window, in a split window,
  483. in a vertical split window or in a new tab.
  484. >
  485. <cr>
  486. <
  487. Open all marked entries. If nothing was marked beforehand, just open the
  488. current entry.
  489. If you want to use another key instead of <cr>, put this in your vimrc:
  490. >
  491. autocmd User Startified nmap <buffer> o <plug>(startify-open-buffers)
  492. <
  493. ==============================================================================
  494. COLORS *startify-colors*
  495. You can overwrite the highlight groups used by startify. The plugin defines
  496. these groups:
  497. Highlight group | Description | Default
  498. ------------------------------------------------------------------
  499. | |
  500. StartifyBracket | [,] | linked to Delimiter
  501. StartifyFile | the actual file | <none>
  502. StartifyFooter | the custom footer | linked to Normal
  503. StartifyHeader | the custom header | linked to Normal
  504. StartifyNumber | the numbers between [] | linked to Number
  505. StartifyPath | the path to a file | <none>
  506. StartifySection | section headers | linked to Special
  507. StartifySelect | selected entries | linked to Title
  508. StartifySlash | slashes in paths | <none>
  509. StartifySpecial | <empty buffer>,<quit> | <none>
  510. StartifyVar | environment variables | linked to StartifyPath
  511. Example: (my terminal emulator supports 256 colors)
  512. >
  513. highlight StartifyBracket ctermfg=240
  514. highlight StartifyFooter ctermfg=240
  515. highlight StartifyHeader ctermfg=114
  516. highlight StartifyNumber ctermfg=215
  517. highlight StartifyPath ctermfg=245
  518. highlight StartifySlash ctermfg=240
  519. highlight StartifySpecial ctermfg=240
  520. <
  521. ==============================================================================
  522. FAQ *startify-faq*
  523. |startify-faq-01| I don't want the start screen to use cursorline!
  524. |startify-faq-02| Recent files aren't shown!
  525. |startify-faq-03| I have broken colors when using sessions!
  526. |startify-faq-04| How to disable common but unimportant files?
  527. |startify-faq-05| CtrlP or NERDTree open a split in Startify!
  528. |startify-faq-06| How do I get both NERDTree and Startify working at
  529. startup?
  530. |startify-faq-07| The session autoload feature is not working!
  531. |startify-faq-08| How do I center my header/footer?
  532. |startify-faq-09| tmux-resurrect?
  533. |startify-faq-10| Temporarily skip Startify at start?
  534. |startify-faq-11| How to use the output of a command as header?
  535. |startify-faq-12| There is an empty window with vim-plug!
  536. ------------------------------------------------------------------------------
  537. *startify-faq-01*
  538. I want to use cursorline!~
  539. Startify issues a User event when it's finished. It can be used to set
  540. buffer-local options etc.
  541. >
  542. autocmd User Startified setlocal cursorline
  543. <
  544. ------------------------------------------------------------------------------
  545. *startify-faq-02*
  546. Recent files aren't shown!~
  547. Perhaps the problem is that the viminfo file..
  548. - doesn't exist
  549. - is invalid
  550. - is empty
  551. - can't be read (check permissions)
  552. I suggest the following steps:
  553. 1) Create a new directory:
  554. >
  555. $ mkdir -p ~/.vim/files/info
  556. <
  557. 2) Put this into your vimrc:
  558. >
  559. set viminfo='100,n$HOME/.vim/files/info/viminfo
  560. <
  561. See |'viminfo'| for information about the second step and what it does
  562. exactly.
  563. ------------------------------------------------------------------------------
  564. *startify-faq-03*
  565. I have broken colors when using sessions!~
  566. Nothing this plugin could do about. Try playing around with 'sessionoptions'.
  567. NOTE: Startify removes 'options' from the session options automatically,
  568. because it's the source of many problems.
  569. Some people swear it works for them with these settings:
  570. >
  571. set sessionoptions=blank,curdir,folds,help,tabpages,winpos
  572. <
  573. ------------------------------------------------------------------------------
  574. *startify-faq-04*
  575. How to disable common but unimportant files?~
  576. Use |g:startify_skiplist|.
  577. ------------------------------------------------------------------------------
  578. *startify-faq-05*
  579. CtrlP or NERDTree open a split in Startify!~
  580. Put this in your vimrc:
  581. >
  582. autocmd User Startified setlocal buftype=
  583. <
  584. If you're using CtrlP without NERDTree, there is an even more elegant
  585. solution:
  586. >
  587. let g:ctrlp_reuse_window = 'startify'
  588. <
  589. ------------------------------------------------------------------------------
  590. *startify-faq-06*
  591. How do I get both NERDTree and Startify working at startup?~
  592. Put this in your vimrc:
  593. >
  594. autocmd VimEnter *
  595. \ if !argc()
  596. \ | Startify
  597. \ | NERDTree
  598. \ | wincmd w
  599. \ | endif
  600. <
  601. ------------------------------------------------------------------------------
  602. *startify-faq-07*
  603. The session autoload feature is not working!~
  604. Do you have NERDTree installed by any chance? If so, try this:
  605. >
  606. let NERDTreeHijackNetrw = 0
  607. <
  608. ------------------------------------------------------------------------------
  609. *startify-faq-08*
  610. How do I center my header/footer?~
  611. Try something along these lines:
  612. >
  613. function! s:filter_header(lines) abort
  614. let longest_line = max(map(copy(a:lines), 'len(v:val)'))
  615. let centered_lines = map(copy(a:lines),
  616. \ 'repeat(" ", (&columns / 2) - (longest_line / 2)) . v:val')
  617. return centered_lines
  618. endfunction
  619. let g:startify_custom_header = s:filter_header(['a', 'bb', 'ccc'])
  620. <
  621. ------------------------------------------------------------------------------
  622. *startify-faq-09*
  623. tmux-resurrect?~
  624. If you use tmux-resurrect to restore your tmux environment, you can use :SLoad
  625. to load your last used session right away:
  626. >
  627. set -g @resurrect-processes '"vim->vim +SLoad"'
  628. <
  629. ------------------------------------------------------------------------------
  630. *startify-faq-10*
  631. Temporarily skip Startify at start?~
  632. In some cases you might need to skip Startify at start. E.g.
  633. >
  634. vim +VimwikiMakeDiaryNote
  635. <
  636. Startify would interfere in this case. A simple way to avoid that would be:
  637. >
  638. vim --cmd 'let g:startify_disable_at_vimenter = 1' +VimwikiMakeDiaryNote
  639. <
  640. ------------------------------------------------------------------------------
  641. *startify-faq-11*
  642. How to use the output of a command as header?~
  643. >
  644. redir => test
  645. silent echo 'one'
  646. silent echo 'two'
  647. silent echo 'three'
  648. redir END
  649. let g:startify_custom_header =
  650. \ map(split(test), 'repeat(" ", 10) . v:val') + ['']
  651. <
  652. |:redir| puts a string into 'test'. Then we turn it into a list of strings.
  653. Then we shift each string to the right by 10 spaces. Afterwards we add an
  654. empty string to the list, which results in an empty line in the header.
  655. ------------------------------------------------------------------------------
  656. *startify-faq-12*
  657. There is an empty window with vim-plug!~
  658. After start there might be only the Startify buffer which is marked as
  659. |unlisted-buffer|. The problem arises if you use :PlugUpdate followed by 'D'
  660. to see the changes. An empty window!
  661. The actual problem is that Vim won't close the last listed buffer. Try this:
  662. >
  663. $ vim -u NONE -N
  664. :set nobuflisted
  665. :new
  666. :bd
  667. <
  668. It won't close the buffer and therefore the window. This also happens in
  669. vim-plug. Note that this is no bug in neither plugin, it's a Vim weirdness.
  670. Workaround #1:~
  671. >
  672. autocmd User Startified setlocal buflisted
  673. <
  674. In some cases this could break other plugins at start (I look at you
  675. NERDTree), but works well most of the time.
  676. Workaround #2:~
  677. >
  678. let g:plug_window = 'enew' " or maybe 'tabnew'
  679. <
  680. This will open the plug buffer in the current window instead of creating a new
  681. window on the left side. Mind that this will also close the Startify buffer
  682. since it will be hidden.
  683. ==============================================================================
  684. EXAMPLE *startify-example*
  685. This is my configuration..
  686. >
  687. autocmd User Startified setlocal cursorline
  688. let g:startify_enable_special = 0
  689. let g:startify_files_number = 8
  690. let g:startify_relative_path = 1
  691. let g:startify_change_to_dir = 1
  692. let g:startify_update_oldfiles = 1
  693. let g:startify_session_autoload = 1
  694. let g:startify_session_persistence = 1
  695. let g:startify_session_delete_buffers = 1
  696. let g:startify_list_order = [
  697. \ [' LRU:'],
  698. \ 'files',
  699. \ [' LRU within this dir:'],
  700. \ 'dir',
  701. \ [' Sessions:'],
  702. \ 'sessions',
  703. \ [' Bookmarks:'],
  704. \ 'bookmarks',
  705. \ ]
  706. let g:startify_skiplist = [
  707. \ 'COMMIT_EDITMSG',
  708. \ 'bundle/.*/doc',
  709. \ '/data/repo/neovim/runtime/doc',
  710. \ '/Users/mhi/local/vim/share/vim/vim74/doc',
  711. \ ]
  712. let g:startify_bookmarks = [
  713. \ { 'c': '~/.vim/vimrc' },
  714. \ '~/golfing',
  715. \ ]
  716. let g:startify_custom_footer =
  717. \ ['', " Vim is charityware. Please read ':help uganda'.", '']
  718. let g:startify_custom_header =
  719. \ map(split(system('tips | cowsay -f apt'), '\n'), '" ". v:val') + ['']
  720. hi StartifyBracket ctermfg=240
  721. hi StartifyFile ctermfg=147
  722. hi StartifyFooter ctermfg=240
  723. hi StartifyHeader ctermfg=114
  724. hi StartifyNumber ctermfg=215
  725. hi StartifyPath ctermfg=245
  726. hi StartifySlash ctermfg=240
  727. hi StartifySpecial ctermfg=240
  728. <
  729. ==============================================================================
  730. vim: tw=78