startify.txt 34 KB

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