startify.txt 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  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. ==============================================================================
  66. OPTIONS *startify-options*
  67. Put these variables into your vimrc. The shown assignments are also the
  68. default values.
  69. |g:startify_bookmarks|
  70. |g:startify_change_to_dir|
  71. |g:startify_custom_footer|
  72. |g:startify_custom_header|
  73. |g:startify_custom_indices|
  74. |g:startify_disable_at_vimenter|
  75. |g:startify_enable_special|
  76. |g:startify_files_number|
  77. |g:startify_list_order|
  78. |g:startify_relative_path|
  79. |g:startify_session_autoload|
  80. |g:startify_session_delete_buffers|
  81. |g:startify_session_dir|
  82. |g:startify_session_persistence|
  83. |g:startify_session_savecmds|
  84. |g:startify_session_savevars|
  85. |g:startify_skiplist_server|
  86. |g:startify_skiplist|
  87. ------------------------------------------------------------------------------
  88. *g:startify_session_dir*
  89. >
  90. let g:startify_session_dir = '~/.vim/session'
  91. <
  92. The directory to save/load sessions to/from.
  93. The default for Windows systems is '$HOME\vimfiles\session'.
  94. ------------------------------------------------------------------------------
  95. *g:startify_list_order*
  96. >
  97. let g:startify_list_order = ['files', 'dir', 'bookmarks', 'sessions']
  98. <
  99. At the moment startify supports these lists:~
  100. 1) "files"
  101. This lists the most recently used files using viminfo. The number of files
  102. is limited by g:startify_files_number.
  103. 2) "dir"
  104. This lists the files from the current directory sorted by modification
  105. time. The number of files is limited by g:startify_files_number.
  106. 3) "bookmarks"
  107. This lists bookmarks, thus hardcoded files or directories that will always
  108. be shown. Have a look at g:startify_bookmarks.
  109. 4) "sessions"
  110. This lists all the sessions saved in the directory
  111. g:startify_session_dir.
  112. Section headers:~
  113. Additionally you can add lists of strings to that list. These will be shown
  114. above the following item in |g:startify_list_order|.
  115. NOTE: Section headers are context-senstive. This means that if the following
  116. item is a startify list ("dir", "bookmarks", ...) and empty (no files in the
  117. current directory, no bookmarks defined, ...), the section header won't be
  118. shown as well.
  119. NOTE: The section header use the StartifySection highlight group.
  120. Section headers example:~
  121. >
  122. let g:startify_list_order = [
  123. \ [' My last recently', ' opened files'],
  124. \ 'files',
  125. \ [' My last recently modified files in the current directory:'],
  126. \ 'dir',
  127. \ [' These are my sessions:'],
  128. \ 'sessions',
  129. \ [' These are my bookmarks:'],
  130. \ 'bookmarks',
  131. \ ]
  132. <
  133. Feel free to add some cool ASCII action!
  134. ------------------------------------------------------------------------------
  135. *g:startify_bookmarks*
  136. >
  137. let g:startify_bookmarks = []
  138. <
  139. A list of files to bookmark. Those files will always be shown at the bottom of
  140. the start screen.
  141. Example:
  142. >
  143. let g:startify_bookmarks = [ '~/.vimrc' ]
  144. <
  145. ------------------------------------------------------------------------------
  146. *g:startify_files_number*
  147. >
  148. let g:startify_files_number = 10
  149. <
  150. The number of files to list.
  151. ------------------------------------------------------------------------------
  152. *g:startify_session_autoload*
  153. >
  154. let g:startify_session_autoload = 0
  155. <
  156. If you bookmark a directory that contains a Session.vim and this option is
  157. enabled, that session will be loaded automatically when you open the
  158. directory.
  159. Great way to create a portable project folder.
  160. ------------------------------------------------------------------------------
  161. *g:startify_session_persistence*
  162. >
  163. let g:startify_session_persistence = 0
  164. <
  165. Automatically update sessions in two cases:
  166. 1) Before leaving Vim
  167. 2) Before loading a new session via :SLoad
  168. This also works for sessions started with:
  169. >
  170. vim -S mysession.vim
  171. <
  172. ------------------------------------------------------------------------------
  173. *g:startify_session_delete_buffers*
  174. >
  175. let g:startify_session_delete_buffers = 0
  176. <
  177. Delete open buffers before loading a new session.
  178. ------------------------------------------------------------------------------
  179. *g:startify_change_to_dir*
  180. >
  181. let g:startify_change_to_dir = 1
  182. <
  183. When opening a file or bookmark, change to its directory.
  184. ------------------------------------------------------------------------------
  185. *g:startify_change_to_vcs_root*
  186. >
  187. let g:startify_change_to_vcs_root = 0
  188. <
  189. When opening a file or bookmark, seek and change to the root directory of the
  190. VCS (if there is one).
  191. At the moment only git, hg, bzr and svn are supported.
  192. ------------------------------------------------------------------------------
  193. *g:startify_skiplist*
  194. >
  195. let g:startify_skiplist = [
  196. \ 'COMMIT_EDITMSG',
  197. \ $VIMRUNTIME .'/doc',
  198. \ 'bundle/.*/doc',
  199. \ '.vimgolf',
  200. \ ]
  201. <
  202. A list of Vim regular expressions that filters recently used files.
  203. Example:
  204. >
  205. let g:startify_skiplist = [
  206. \ '\.vimgolf',
  207. \ '^/tmp',
  208. \ '/project/.*/documentation',
  209. \ ]
  210. <
  211. ------------------------------------------------------------------------------
  212. *g:startify_skiplist_server*
  213. >
  214. let g:startify_skiplist_server = []
  215. <
  216. Do not create the startify buffer, if this is a Vim server instance with a
  217. name contained in this list.
  218. Example:
  219. >
  220. let g:startify_skiplist_server = [ 'GVIM' ]
  221. <
  222. ------------------------------------------------------------------------------
  223. *g:startify_enable_special*
  224. >
  225. let g:startify_enable_special = 1
  226. <
  227. Show <empty buffer> and <quit>.
  228. ------------------------------------------------------------------------------
  229. *g:startify_session_savevars*
  230. >
  231. let g:startify_session_savevars = []
  232. <
  233. Include a list of variables in here which you would like Startify to save into
  234. the session file in addition to what Vim normally saves into the session file.
  235. For example, Vim will not normally save all-lowercase global variables, which
  236. are common for plugin settings. It may be advisable to include
  237. |g:startify_session_savevars| and |g:startify_session_savecmds| into this list
  238. so they are saved every time the session saves.
  239. Example:
  240. >
  241. let g:startify_session_savevars = [
  242. \ 'g:startify_session_savevars',
  243. \ 'g:startify_session_savecmds',
  244. \ 'g:random_plugin_use_feature'
  245. \ ]
  246. <
  247. ------------------------------------------------------------------------------
  248. *g:startify_session_savecmds*
  249. >
  250. let g:startify_session_savecmds = []
  251. <
  252. Include a list of cmdline commands which Vim will run upon loading the
  253. session. This can be useful to set various things (other than variables,
  254. |g:startify_session_savevars| above) which Vim may not normally save into the
  255. session file, as well as run external commands upon loading a session.
  256. Example:
  257. >
  258. let g:startify_session_savecmds = [
  259. \ 'silent !pdfreader ~/latexproject/main.pdf &'
  260. \ ]
  261. <
  262. ------------------------------------------------------------------------------
  263. *g:startify_custom_indices*
  264. >
  265. let g:startify_custom_indices = []
  266. <
  267. Use any list of strings as indices instead of increasing numbers. If there are
  268. more startify entries than actual items in the custom list, the remaining
  269. entries will be filled using the default numbering scheme starting from 0.
  270. Thus you can create your own indexing scheme that fits your keyboard layout.
  271. You don't want to leave the home row, do you?!
  272. Example:
  273. >
  274. let g:startify_custom_indices = ['f', 'g', 'h']
  275. <
  276. This would result in:
  277. [f] /last/recently/used/file1
  278. [g] /last/recently/used/file2
  279. [h] /last/recently/used/file3
  280. [0] /last/recently/used/file4
  281. [1] /last/recently/used/file5
  282. [2] /last/recently/used/file6
  283. etc.
  284. If you want numbers to start at 1 instead of 0, you could use this:
  285. >
  286. let g:startify_custom_indices = map(range(1,100), 'string(v:val)')
  287. <
  288. NOTE: There is no sanitizing going on, so you should know what you're doing!
  289. Best practices:
  290. - do not use 'e', 'i' or 'q' (they will be overwritten anyway)
  291. - do not use 'b', 's', 't', 'v' (used for opening several files at once)
  292. - do not use duplicates (previous mappings will be overwritten)
  293. - do not uses empty strings (creates unreachable entries)
  294. - you might want to keep 'j' and 'k' (for navigation)
  295. ------------------------------------------------------------------------------
  296. *g:startify_custom_header*
  297. >
  298. let g:startify_custom_header = ''
  299. <
  300. This is a list of single-quoted strings to be shown before everything else.
  301. Every string will be written on its own line.
  302. NOTE: If a string contains ', you have to quote it with another '.
  303. A programmatic example:
  304. >
  305. let g:startify_custom_header =
  306. \ map(split(system('fortune | cowsay'), '\n'), '" ". v:val') + ['','']
  307. <
  308. A hardcoded example:
  309. >
  310. let g:startify_custom_header = [
  311. \ ' ________ __ __ ',
  312. \ ' __ /\_____ \/\ \\ \ ',
  313. \ ' __ __ /\_\ ___ ___ \/___//''/''\ \ \\ \ ',
  314. \ ' /\ \/\ \\/\ \ /'' __` __`\ /'' /'' \ \ \\ \_ ',
  315. \ ' \ \ \_/ |\ \ \/\ \/\ \/\ \ /'' /''__ \ \__ ,__\',
  316. \ ' \ \___/ \ \_\ \_\ \_\ \_\ /\_/ /\_\ \/_/\_\_/ ',
  317. \ ' \/__/ \/_/\/_/\/_/\/_/ \// \/_/ \/_/ ',
  318. \ '',
  319. \ '',
  320. \ ]
  321. <
  322. ------------------------------------------------------------------------------
  323. *g:startify_custom_footer*
  324. >
  325. let g:startify_custom_footer = ''
  326. <
  327. Same as the custom header, but shown at the bottom of the startify buffer.
  328. ------------------------------------------------------------------------------
  329. *g:startify_disable_at_vimenter*
  330. >
  331. let g:startify_disable_at_vimenter = 0
  332. <
  333. Don't run Startify at Vim startup. You can still call it anytime via
  334. :Startify.
  335. -----------------------------------------------------------------------------
  336. *g:startify_relative_path*
  337. >
  338. let g:startify_relative_path = 0
  339. <
  340. Show filenames relative to the current working directory instead of as
  341. absolute paths.
  342. ==============================================================================
  343. AUTOCMD *startify-autocmd*
  344. In case you want to alter the startify buffer to cause all kinds of mayhem, an
  345. user autocmd is issued. You can hook into it like this:
  346. >
  347. autocmd User Startified let &l:stl = ' This statusline rocks!'
  348. <
  349. ==============================================================================
  350. COMMANDS *startify-commands*
  351. >
  352. :SLoad
  353. :SSave
  354. :SDelete
  355. <
  356. Commands to load, save or delete a session. These take either 0 or 1 argument.
  357. If you don't specify the session name as an argument, they will just ask for
  358. it.
  359. Providing only a part of the session name works too, if you complete the
  360. argument with either <c-d> or <tab> afterwards.
  361. >
  362. :Startify
  363. <
  364. Open the startify buffer.
  365. ==============================================================================
  366. MAPPINGS *startify-mappings*
  367. Some things are remapped in the startify buffer..
  368. >
  369. q
  370. <
  371. Close startify. Also quit Vim if it is the only buffer.
  372. >
  373. e
  374. <
  375. Close startify and create a blank buffer.
  376. >
  377. i
  378. <insert>
  379. <
  380. Close startify, create a blank buffer and jump into insert mode right away.
  381. >
  382. <2-LeftMouse>
  383. <
  384. Use a simple mouse click to open the targeted entry.
  385. >
  386. [any number that is shown between square brackets]
  387. <
  388. Open the entry with the given number.
  389. >
  390. b
  391. s
  392. v
  393. t
  394. <
  395. Mark current entry to be opened in either the same window, in a split window,
  396. in a vertical split window or in a new tab.
  397. >
  398. <cr>
  399. <
  400. Open all marked entries. If nothing was marked beforehand, just open the
  401. current entry.
  402. ==============================================================================
  403. COLORS *startify-colors*
  404. You can overwrite the highlight groups used by startify. The plugin defines
  405. these groups:
  406. Highlight group | Description | Default
  407. ------------------------------------------------------------------
  408. | |
  409. StartifyBracket | [,] | linked to Delimiter
  410. StartifyFile | the actual file | <none>
  411. StartifyFooter | the custom footer | linked to Normal
  412. StartifyHeader | the custom header | linked to Normal
  413. StartifyNumber | the numbers between [] | linked to Number
  414. StartifyPath | the path to a file | <none>
  415. StartifySection | section headers | linked to Special
  416. StartifySelect | selected entries | linked to Title
  417. StartifySlash | slashes in paths | <none>
  418. StartifySpecial | <empty buffer>,<quit> | <none>
  419. Example: (my terminal emulator supports 256 colors)
  420. >
  421. highlight StartifyBracket ctermfg=240
  422. highlight StartifyFooter ctermfg=240
  423. highlight StartifyHeader ctermfg=114
  424. highlight StartifyNumber ctermfg=215
  425. highlight StartifyPath ctermfg=245
  426. highlight StartifySlash ctermfg=240
  427. highlight StartifySpecial ctermfg=240
  428. <
  429. ==============================================================================
  430. FAQ *startify-faq*
  431. |startify-faq-01| I don't want the start screen to use cursorline!
  432. |startify-faq-02| Recent files aren't shown!
  433. |startify-faq-03| Last recently used files don't seem to get updated
  434. at :Startify!
  435. |startify-faq-04| I have broken colors when using sessions!
  436. |startify-faq-05| How to disable common but unimportant files?
  437. |startify-faq-06| CtrlP or NERDTree open a split in Startify!
  438. |startify-faq-07| How do I get both NERDTree and Startify working at
  439. startup?
  440. |startify-faq-08| Startify prevents my statusline plugin from working!
  441. |startify-faq-09| The session autoload feature is not working!
  442. ------------------------------------------------------------------------------
  443. *startify-faq-01*
  444. I don't want the start screen to use cursorline!~
  445. Startify sets its own filetype "startify". Thus one could set buffer-local
  446. options like this:
  447. >
  448. autocmd FileType startify setlocal nocursorline
  449. <
  450. ------------------------------------------------------------------------------
  451. *startify-faq-02*
  452. Recent files aren't shown!~
  453. Perhaps the problem is that the viminfo file..
  454. - doesn't exist
  455. - is invalid
  456. - is empty
  457. - can't be read (check permissions)
  458. I suggest the following steps:
  459. 1) Create a new directory:
  460. >
  461. $ mkdir -p ~/.vim/files/info
  462. <
  463. 2) Put this into your vimrc:
  464. >
  465. set viminfo='100,n$HOME/.vim/files/info/viminfo
  466. <
  467. See |'viminfo'| for information about the second step and what it does
  468. exactly.
  469. ------------------------------------------------------------------------------
  470. *startify-faq-03*
  471. Last recently used files don't seem to get updated at :Startify!~
  472. Vim loads the list from viminfo only once, at startup.
  473. ------------------------------------------------------------------------------
  474. *startify-faq-04*
  475. I have broken colors when using sessions!~
  476. Nothing this plugin could do about. Try playing around with 'sessionoptions'.
  477. NOTE: Startify removes 'options' from the session options automatically,
  478. because it's the source of many problems.
  479. Some people swear it works for them with these settings:
  480. >
  481. set sessionoptions=blank,curdir,folds,help,tabpages,winpos
  482. <
  483. ------------------------------------------------------------------------------
  484. *startify-faq-05*
  485. How to disable common but unimportant files?~
  486. Use the skiplist. Personally I use:
  487. >
  488. let g:startify_skiplist = [
  489. \ 'COMMIT_EDITMSG',
  490. \ $VIMRUNTIME .'/doc',
  491. \ 'bundle/.*/doc',
  492. \ '\.DS_Store'
  493. \ ]
  494. <
  495. ------------------------------------------------------------------------------
  496. *startify-faq-06*
  497. CtrlP or NERDTree open a split in Startify!~
  498. Put this in your vimrc:
  499. >
  500. autocmd FileType startify setlocal buftype=
  501. <
  502. If you're using CtrlP without NERDTree, there is an even more elegant
  503. solution:
  504. >
  505. let g:ctrlp_reuse_window = 'startify'
  506. <
  507. ------------------------------------------------------------------------------
  508. *startify-faq-07*
  509. How do I get both NERDTree and Startify working at startup?~
  510. Put this in your vimrc:
  511. >
  512. autocmd VimEnter *
  513. \ if !argc() |
  514. \ Startify |
  515. \ NERDTree |
  516. \ execute "normal \<c-w>w" |
  517. \ endif
  518. <
  519. ------------------------------------------------------------------------------
  520. *startify-faq-08*
  521. Startify prevents my statusline plugin from working!~
  522. airline:
  523. >
  524. autocmd User Startified call AirlineRefresh
  525. <
  526. lightline:
  527. >
  528. autocmd User Startified call lightline#update()
  529. <
  530. ------------------------------------------------------------------------------
  531. *startify-faq-09*
  532. The session autoload feature is not working!~
  533. Do you have NERDTree installed by any chance? If so, try this:
  534. >
  535. let NERDTreeHijackNetrw = 0
  536. <
  537. ==============================================================================
  538. EXAMPLE *startify-example*
  539. This is my configuration..
  540. >
  541. autocmd FileType startify setlocal cursorline
  542. let g:startify_enable_special = 0
  543. let g:startify_files_number = 8
  544. let g:startify_relative_path = 1
  545. let g:startify_change_to_dir = 1
  546. let g:startify_session_autoload = 1
  547. let g:startify_session_persistence = 1
  548. let g:startify_session_delete_buffers = 1
  549. let g:startify_list_order = [
  550. \ [' LRU:'],
  551. \ 'files',
  552. \ [' LRU within this dir:'],
  553. \ 'dir',
  554. \ [' Sessions:'],
  555. \ 'sessions',
  556. \ [' Bookmarks:'],
  557. \ 'bookmarks',
  558. \ ]
  559. let g:startify_skiplist = [
  560. \ 'COMMIT_EDITMSG',
  561. \ $VIMRUNTIME .'/doc',
  562. \ 'bundle/.*/doc',
  563. \ '\.vimgolf',
  564. \ ]
  565. let g:startify_bookmarks = [
  566. \ '~/.vim/vimrc',
  567. \ '/data/vim/golfing',
  568. \ ]
  569. let g:startify_custom_footer =
  570. \ ['', " Vim is charityware. Please read ':help uganda'.", '']
  571. let g:startify_custom_header =
  572. \ map(split(system('tips | cowsay -f apt'), '\n'), '" ". v:val') + ['']
  573. hi StartifyBracket ctermfg=240
  574. hi StartifyFile ctermfg=147
  575. hi StartifyFooter ctermfg=240
  576. hi StartifyHeader ctermfg=114
  577. hi StartifyNumber ctermfg=215
  578. hi StartifyPath ctermfg=245
  579. hi StartifySlash ctermfg=240
  580. hi StartifySpecial ctermfg=240
  581. <
  582. ==============================================================================
  583. vim: tw=78