startify.txt 34 KB

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