startify.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  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. COMMANDS ....................................... |startify-commands|
  30. COLORS ......................................... |startify-colors|
  31. FAQ ............................................ |startify-faq|
  32. ==============================================================================
  33. INTRO *startify-intro*
  34. Startify is a plugin that shows recently used files, bookmarks 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 that always
  43. 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. ==============================================================================
  63. OPTIONS *startify-options*
  64. Put these variables into your vimrc. The shown assignments are also the
  65. default values.
  66. |g:startify_session_dir|
  67. |g:startify_list_order|
  68. |g:startify_bookmarks|
  69. |g:startify_files_number|
  70. |g:startify_session_detection|
  71. |g:startify_session_autoload|
  72. |g:startify_session_persistence|
  73. |g:startify_skiplist|
  74. |g:startify_skiplist_server|
  75. |g:startify_change_to_dir|
  76. |g:startify_custom_indices|
  77. |g:startify_custom_header|
  78. |g:startify_custom_footer|
  79. |g:startify_restore_position|
  80. |g:startify_empty_buffer_key|
  81. |g:startify_enable_special|
  82. |g:startify_session_savevars|
  83. |g:startify_session_savecmds|
  84. |g:startify_disable_at_vimenter|
  85. ------------------------------------------------------------------------------
  86. *g:startify_session_dir*
  87. >
  88. let g:startify_session_dir = '~/.vim/session'
  89. <
  90. The directory to save/load sessions to/from.
  91. The default for Windows systems is '$HOME\vimfiles\session'.
  92. ------------------------------------------------------------------------------
  93. *g:startify_list_order*
  94. >
  95. let g:startify_list_order = ['files', 'dir', 'bookmarks', 'sessions']
  96. <
  97. At the moment startify supports these lists:~
  98. 1) "files"
  99. This lists the most recently used files using viminfo. The number of files
  100. is limited by g:startify_files_number.
  101. 2) "dir"
  102. This lists the files from the current directory sorted by modification
  103. time. The number of files is limited by g:startify_files_number.
  104. 3) "bookmarks"
  105. This lists bookmarks, thus hardcoded files or directories that will always
  106. be shown. Have a look at g:startify_bookmarks.
  107. 4) "sessions"
  108. This lists all the sessions saved in the directory
  109. g:startify_session_dir.
  110. Section headers:~
  111. Additionally you can add lists of strings to that list. These will be shown
  112. above the following item in |g:startify_list_order|.
  113. NOTE: Section headers are context-senstive. This means that if the following
  114. item is a startify list ("dir", "bookmarks", ...) and empty (no files in the
  115. current directory, no bookmarks defined, ...), the section header won't be
  116. shown as well.
  117. NOTE: The section header use the StartifySection highlight group.
  118. Section headers example:~
  119. >
  120. let g:startify_list_order = [
  121. \ [' My last recently', ' opened files'],
  122. \ 'files',
  123. \ [' My last recently modified files in the current directory:'],
  124. \ 'dir',
  125. \ [' These are my sessions:'],
  126. \ 'sessions',
  127. \ [' These are my bookmarks:'],
  128. \ 'bookmarks',
  129. \ ]
  130. <
  131. Feel free to add some cool ASCII action!
  132. ------------------------------------------------------------------------------
  133. *g:startify_bookmarks*
  134. >
  135. let g:startify_bookmarks = []
  136. <
  137. A list of files to bookmark. Those files will always be shown at the bottom of
  138. the start screen.
  139. Example:
  140. >
  141. let g:startify_bookmarks = [ '~/.vimrc' ]
  142. <
  143. ------------------------------------------------------------------------------
  144. *g:startify_files_number*
  145. >
  146. let g:startify_files_number = 10
  147. <
  148. The number of files to list.
  149. ------------------------------------------------------------------------------
  150. *g:startify_session_detection*
  151. >
  152. let g:startify_session_detection = 1
  153. <
  154. When the file Session.vim is found in the current directory, it will be shown
  155. at the top of all lists as entry [0].
  156. ------------------------------------------------------------------------------
  157. *g:startify_session_autoload*
  158. >
  159. let g:startify_session_autoload = 0
  160. <
  161. If you bookmark a directory that contains a Session.vim and this option is
  162. enabled, that session will be loaded automatically when you open the
  163. directory.
  164. Great way to create a portable project folder.
  165. ------------------------------------------------------------------------------
  166. *g:startify_session_persistence*
  167. >
  168. let g:startify_session_persistence = 0
  169. <
  170. Automatically update sessions before exiting Vim.
  171. ------------------------------------------------------------------------------
  172. *g:startify_change_to_dir*
  173. >
  174. let g:startify_change_to_dir = 1
  175. <
  176. When opening a file or bookmark, change to its directory.
  177. ------------------------------------------------------------------------------
  178. *g:startify_change_to_vcs_root*
  179. >
  180. let g:startify_change_to_vcs_root = 0
  181. <
  182. When opening a file or bookmark, seek and change to the root directory of the
  183. VCS (if there is one).
  184. At the moment only git, hg, bzr and svn are supported.
  185. ------------------------------------------------------------------------------
  186. *g:startify_skiplist*
  187. >
  188. let g:startify_skiplist = []
  189. <
  190. A list of Vim regular expressions to filter recently used files and files in
  191. the current directory.
  192. Example:
  193. >
  194. let g:startify_skiplist = [
  195. \ '.vimgolf',
  196. \ '^/tmp'
  197. \ '/project/.*/documentation'
  198. \ ]
  199. <
  200. ------------------------------------------------------------------------------
  201. *g:startify_skiplist_server*
  202. >
  203. let g:startify_skiplist_server = []
  204. <
  205. Do not create the startify buffer, if this is a Vim server instance with a
  206. name contained in this list.
  207. Example:
  208. >
  209. let g:startify_skiplist_server = [ 'GVIM' ]
  210. <
  211. ------------------------------------------------------------------------------
  212. *g:startify_empty_buffer_key*
  213. >
  214. let g:startify_empty_buffer_key = 'o'
  215. <
  216. This creates an additional, hidden mapping for the empty buffer.
  217. Default: does not exist
  218. ------------------------------------------------------------------------------
  219. *g:startify_enable_special*
  220. >
  221. let g:startify_enable_special = 1
  222. <
  223. Show <empty buffer> and <quit>.
  224. ------------------------------------------------------------------------------
  225. *g:startify_session_savevars*
  226. >
  227. let g:startify_session_savevars = []
  228. <
  229. Include a list of variables in here which you would like Startify to save into
  230. the session file in addition to what Vim normally saves into the session file.
  231. For example, Vim will not normally save all-lowercase global variables, which
  232. are common for plugin settings. It may be advisable to include
  233. |g:startify_session_savevars| and |g:startify_session_savecmds| into this list
  234. so they are saved every time the session saves.
  235. Example:
  236. >
  237. let g:startify_session_savevars = [
  238. \ 'g:startify_session_savevars',
  239. \ 'g:startify_session_savecmds',
  240. \ 'g:random_plugin_use_feature'
  241. \ ]
  242. <
  243. ------------------------------------------------------------------------------
  244. *g:startify_session_savecmds*
  245. >
  246. let g:startify_session_savecmds = []
  247. <
  248. Include a list of cmdline commands which Vim will run upon loading the
  249. session. This can be useful to set various things (other than variables,
  250. |g:startify_session_savevars| above) which Vim may not normally save into the
  251. session file, as well as run external commands upon loading a session.
  252. Example:
  253. >
  254. let g:startify_session_savecmds = [
  255. \ 'silent !pdfreader ~/latexproject/main.pdf &'
  256. \ ]
  257. <
  258. ------------------------------------------------------------------------------
  259. *g:startify_restore_position*
  260. >
  261. let g:startify_restore_position = 0
  262. <
  263. Jump to the last cursor position when opening a file. You don't need this, if
  264. you already have this in your vimrc: |last-position-jump|.
  265. ------------------------------------------------------------------------------
  266. *g:startify_custom_indices*
  267. >
  268. let g:startify_custom_indices = []
  269. <
  270. Use any list of strings as indices instead of increasing numbers. If there are
  271. more startify entries than actual items in the custom list, the remaining
  272. entries will be filled using the default numbering scheme starting from 0.
  273. Thus you can create your own indexing scheme that fits your keyboard layout.
  274. You don't want to leave the home row, do you?!
  275. Example:
  276. >
  277. let g:startify_custom_indices = ['f', 'g', 'h']
  278. <
  279. This would result in:
  280. [f] /last/recently/used/file1
  281. [g] /last/recently/used/file2
  282. [h] /last/recently/used/file3
  283. [0] /last/recently/used/file4
  284. [1] /last/recently/used/file5
  285. [2] /last/recently/used/file6
  286. etc.
  287. NOTE: There is no sanitizing going on, so you should know what you're doing!
  288. Best practices:
  289. - do not use 'e', 'i' or 'q' (they will be overwritten anyway)
  290. - do not use 'b', 's', 't', 'v' (used for opening several files at once)
  291. - do not use duplicates (previous mappings will be overwritten)
  292. - do not uses empty strings (creates unreachable entries)
  293. - you might want to keep 'j' and 'k' (for navigation)
  294. ------------------------------------------------------------------------------
  295. *g:startify_custom_header*
  296. >
  297. let g:startify_custom_header = ''
  298. <
  299. This is a list of single-quoted strings to be shown before everything else.
  300. Every string will be written on its own line.
  301. NOTE: If a string contains ', you have to quote it with another '.
  302. A programmatic example:
  303. >
  304. let g:startify_custom_header =
  305. \ map(split(system('fortune | cowsay'), '\n'), '" ". v:val') + ['','']
  306. <
  307. A hardcoded example:
  308. >
  309. let g:startify_custom_header = [
  310. \ ' __ ___ ______ ____ ',
  311. \ ' \ \ / (_) |____ |___ \ ',
  312. \ ' \ \ / / _ _ __ ___ / / __) |',
  313. \ ' \ \/ / | | ''_ ` _ \ / / |__ <',
  314. \ ' \ / | | | | | | | / / ___) |',
  315. \ ' \/ |_|_| |_| |_| /_(_) |____/ ',
  316. \ '',
  317. \ '',
  318. \ ]
  319. <
  320. ------------------------------------------------------------------------------
  321. *g:startify_custom_footer*
  322. >
  323. let g:startify_custom_footer = ''
  324. <
  325. Same as the custom header, but shown at the bottom of the startify buffer.
  326. ------------------------------------------------------------------------------
  327. *g:startify_disable_at_vimenter*
  328. >
  329. let g:startify_disable_at_vimenter = 0
  330. <
  331. Don't run Startify at Vim startup. You can still call it anytime via
  332. :Startify.
  333. ==============================================================================
  334. COMMANDS *startify-commands*
  335. >
  336. :SLoad
  337. :SSave
  338. :SDelete
  339. <
  340. Commands to load, save or delete a session. These take either 0 or 1 argument.
  341. If you don't specify the session name as an argument, they will just ask for
  342. it.
  343. Providing only a part of the session name works too, if you complete the
  344. argument with either <c-d> or <tab> afterwards.
  345. >
  346. :Startify
  347. <
  348. Open the startify buffer.
  349. ==============================================================================
  350. COLORS *startify-colors*
  351. You can overwrite the highlight groups used by startify. The plugin defines
  352. these groups:
  353. StartifyBracket [,]
  354. StartifyFile the actual file
  355. StartifyFooter the custom footer
  356. StartifyHeader the custom header
  357. StartifyNumber the numbers between []
  358. StartifyPath the path to a file
  359. StartifySection section headers
  360. StartifySlash slashes in paths
  361. StartifySpecial <empty buffer>,<quit>
  362. Example: (my terminal emulator supports 256 colors)
  363. >
  364. hi StartifyBracket ctermfg=240
  365. hi StartifyFooter ctermfg=111
  366. hi StartifyHeader ctermfg=203
  367. hi StartifyNumber ctermfg=215
  368. hi StartifyPath ctermfg=245
  369. hi StartifySlash ctermfg=240
  370. <
  371. ==============================================================================
  372. FAQ *startify-faq*
  373. ------------------------------------------------------------------------------
  374. CtrlP opens a split in Startify!~
  375. Solution 1)
  376. >
  377. let g:ctrlp_reuse_window = 'startify'
  378. <
  379. Solution 2)
  380. >
  381. autocmd FileType startify setlocal buftype=
  382. <
  383. ------------------------------------------------------------------------------
  384. How do I get both NERDTree and Startify working at startup?~
  385. Put this in your vimrc:
  386. >
  387. autocmd VimEnter *
  388. \ if !argc() |
  389. \ Startify |
  390. \ NERDTree |
  391. \ execute "normal \<c-w>w" |
  392. \ endif
  393. <
  394. ------------------------------------------------------------------------------
  395. The session autoload feature is not working!~
  396. Do you have NERDTree installed by any chance? If so, try this:
  397. >
  398. let NERDTreeHijackNetrw = 0
  399. <
  400. ------------------------------------------------------------------------------
  401. I don't want the start screen to use cursorline!~
  402. Startify sets its own filetype "startify". Thus one could set buffer-local
  403. options like this:
  404. >
  405. autocmd FileType startify setlocal nocursorline
  406. <
  407. ------------------------------------------------------------------------------
  408. Last recently used files don't seem to get updated at :Startify!~
  409. Vim loads the list from viminfo only once, at startup.
  410. ------------------------------------------------------------------------------
  411. I have broken colors when using sessions!~
  412. Nothing this plugin could do about. Try playing around with 'sessionoptions'.
  413. NOTE: Startify removes 'options' from the session options automatically,
  414. because it's the source of many problems.
  415. Some people swear it works for them with these settings:
  416. >
  417. set sessionoptions=blank,curdir,folds,help,tabpages,winpos
  418. <
  419. ------------------------------------------------------------------------------
  420. How to disable common but unimportant files?~
  421. Use the skiplist. Personally I use:
  422. >
  423. let g:startify_skiplist = [
  424. \ 'COMMIT_EDITMSG',
  425. \ $VIMRUNTIME .'/doc',
  426. \ 'bundle/.*/doc',
  427. \ '\.DS_Store'
  428. \ ]
  429. <
  430. ==============================================================================
  431. vim: tw=78