vim-sussify/doc/startify.txt
Marco Hinz b624d3a439 New option: g:startify_session_persistence
Whenever you load/save a session, v:this_session is set automatically.
If this option is enabled and v:this_session exists, the session file
will be updated before exiting Vim.

References #32.
2013-08-13 11:10:41 +02:00

388 lines
11 KiB
Plaintext

*startify.txt* Showing recently used stuff like a boss.
*startify*
__ __ ___
/\ \__ /\ \__ __ /'___\
____\ \ ,_\ __ _ __\ \ ,_\/\_\/\ \__/ __ __
/',__\\ \ \/ /'__`\ /\`'__\ \ \/\/\ \ \ ,__\/\ \/\ \
/\__, `\\ \ \_/\ \L\.\_\ \ \/ \ \ \_\ \ \ \ \_/\ \ \_\ \
\/\____/ \ \__\ \__/.\_\\ \_\ \ \__\\ \_\ \_\ \/`____ \
\/___/ \/__/\/__/\/_/ \/_/ \/__/ \/_/\/_/ `/___/> \
/\___/
\/__/
==============================================================================
CONTENTS *startify-contents*
1.Intro..........................................|startify-intro|
2.Usage..........................................|startify-usage|
3.Options........................................|startify-options|
4.Commands.......................................|startify-commands|
5.Colors.........................................|startify-colors|
6.FAQ............................................|startify-faq|
7.Author.........................................|startify-author|
8.License........................................|startify-license|
==============================================================================
1. Intro *startify-intro*
Startify is a plugin that shows recently used files, bookmarks and
sessions that were saved to a certain directory.
==============================================================================
2. Usage *startify-usage*
Startify basically provides two things:
1) If you start Vim without giving any filenames to it (or pipe stuff to it so
it reads from STDIN), startify will show a small but pretty start screen
that shows recently used files (using viminfo) and sessions by default.
Additionally, you can define bookmarks, thus entries for files that always
should be available on the start screen.
You can either navigate to a certain menu entry and hit enter or you just
key in whatever is written between the square brackets on that line. You
can even double-click anywhere on the line now.
In addition, 'e' creates an empty buffer, 'i' creates an empty buffer and
jumps into insert mode, 'q' quits.
Moreover, you can open several files at one go. Navigate to an entry and
hit either 'b' (open in same window), 's' (open in split) or 'v' (open in
vertical split). You can do that for multiple entries. You can also mix
them. The order of the selections will be remembered. Afterwards execute
these actions via <cr>.
When the selection is finished, Startify will close automatically. You can
reopen the screen via :Startify.
And you can define your own custom ascii art header now!
2) It eases handling of loading and saving sessions by only working with a
certain directory. These commands are used for convenience:
:SLoad load a session
:SSave save a session
:SDelete delete a session
==============================================================================
3. Options *startify-options*
Put these variables into your vimrc. The shown assignments are also the
default values.
============-
let g:startify_session_dir = '~/.vim/session'
The directory to save/load sessions to/from.
The default for Windows systems is '$HOME\vimfiles\session'.
============-
let g:startify_list_order = ['files', 'sessions', 'bookmarks']
At the moment startify can show these kind of lists:
1) Most recently used files.
This lists the most recently used files using viminfo. The number of files
is limited by g:startify_files_number.
2) Most recently changed files in the current directory.
This lists the files from the current directory sorted by modification
time. The number of files is limited by g:startify_files_number.
3) Bookmarks.
This lists bookmarks, thus hardcoded files that will always be shown.
Have a look at g:startify_bookmarks.
4) Sessions.
This lists all the sessions saved in the directory
g:startify_session_dir.
Therefore, to show all of them in the above order:
let g:startify_list_order = ['files', 'dir', 'bookmarks', 'sessions']
============-
let g:startify_bookmarks = []
A list of files to bookmark. Those files will always be shown at the bottom of
the start screen.
Example: let g:startify_bookmarks = [ '~/.vimrc' ]
============-
let g:startify_files_number = 10
The number of files to list.
============-
let g:startify_session_detection = 1
When the file Session.vim is found in the current directory, it will be shown at
the top of all lists as entry [0].
============-
let g:startify_session_autoload = 0
If you bookmark a directory that contains a Session.vim and this option is
enabled, that session will be loaded automatically when you open the
directory.
Great way to create a portable project folder.
============-
let g:startify_session_persistence = 0
Automatically update sessions before exiting Vim.
============-
let g:startify_change_to_dir = 1
When opening a file or bookmark, change to its directory.
============-
let g:startify_skiplist = []
A list of Vim regular expressions to filter recently used files and files in
the current directory.
Example: let g:startify_skiplist = [
\ 'COMMIT_EDITMSG',
\ $VIMRUNTIME .'/doc',
\ 'bundle/.*/doc'
\ ]
============-
let g:startify_skiplist_server = []
Do not create the startify buffer, if this is a Vim server instance with a
name contained in this list.
Example: let g:startify_skiplist_server = [ 'GVIM' ]
============-
let g:startify_empty_buffer_key = 'o'
This creates an additional, hidden mapping for the empty buffer.
Default: does not exist
============-
let g:startify_enable_special = 1
Show <empty buffer> and <quit>.
============-
let g:startify_restore_position = 0
Jump to the last cursor position when opening a file. You don't need this, if
you already have this in your vimrc: |last-position-jump|.
============-
let g:startify_custom_indices = []
Use any list of strings as indices instead of increasing numbers. If there are
more startify entries than actual items in the custom list, the remaining
entries will be filled using the default numbering scheme starting from 0.
Thus you can create your own indexing scheme that fits your keyboard layout.
You don't want to leave the home row, do you?!
Example: let g:startify_custom_indices = ['a','s','d','f']
This would result in:
[a] /last/recently/used/file1
[s] /last/recently/used/file2
[d] /last/recently/used/file3
[f] /last/recently/used/file4
[0] /last/recently/used/file5
[1] /last/recently/used/file6
etc.
NOTE: There is no sanitizing going on, so you should know what you're doing!
Best practices:
- do not use 'e', 'i' or 'q' (they will be overwritten anyway)
- do not use duplicates (previous mappings will be overwritten)
- do not uses empty strings (creates unreachable entries)
- (you might want to keep 'j' and 'k' for navigation)
============-
let g:startify_custom_header = ''
This is a list of single-quoted strings to be shown before everything else.
Every string will be written on its own line.
NOTE: If a string contains ', you have to quote it with another '.
Example:
let g:startify_custom_header = [
\ ' __ ___ ______ ____ ',
\ ' \ \ / (_) |____ |___ \ ',
\ ' \ \ / / _ _ __ ___ / / __) |',
\ ' \ \/ / | | ''_ ` _ \ / / |__ <',
\ ' \ / | | | | | | | / / ___) |',
\ ' \/ |_|_| |_| |_| /_(_) |____/ ',
\ '',
\ '',
\ ]
==============================================================================
4. Commands *startify-commands*
:SLoad load a session
:SSave save a session
:SDelete delete a session
These take either 0 or 1 argument. If you don't specify the session name as an
argument, they will just ask for it.
Providing only a part of the session name works too, if you complete the
argument with either <c-d> or <tab> afterwards.
:Startify
Open the startify buffer.
==============================================================================
5. Colors *startify-colors*
You can overwrite the highlight groups used by startify. The plugin defines
these groups:
StartifyBracket [,]
StartifyFile the actual file
StartifyHeader the custom header
StartifyNumber the numbers between []
StartifyPath the path to a file
StartifySlash slashes in paths
StartifySpecial <empty buffer>,<quit>
Example: (my terminal emulator supports 256 colors)
hi StartifyBracket ctermfg=240
hi StartifyHeader ctermfg=203
hi StartifyNumber ctermfg=215
hi StartifyPath ctermfg=245
hi StartifySlash ctermfg=240
==============================================================================
6. FAQ (Or: Typical rants) *startify-faq*
How do I get both NERDTree and Startify working at startup?
-----------------------------------------------------------
Put this in your vimrc:
autocmd VimEnter *
\ if !argc() |
\ Startify |
\ NERDTree |
\ execute "normal \<c-w>w" |
\ endif
The session autoload feature is not working!
--------------------------------------------
Do you have NERDTree installed by any chance? If so, try this:
let NERDTreeHijackNetrw = 0
I don't want the start screen to use cursorline!
------------------------------------------------
Startify sets its own filetype "startify". Thus one could set buffer-local
options like this:
autocmd FileType startify setlocal nocursorline
Last recently used files don't seem to get updated at :Startify!
----------------------------------------------------------------
It's because Vim loads the list from viminfo only once, at startup.
I use iTerm2 and have broken colors when using sessions!
--------------------------------------------------------
Nothing this plugin could do about. Try playing around with 'sessionoptions'.
Some people swear it works for them with these settings:
set sessionoptions=blank,curdir,folds,help,tabpages,winpos
==============================================================================
7. About the author *startify-author*
My nick on Freenode IRC is mhi^.
For latest developments: https://github.com/mhinz
If you use any of my plugins, star it on github. This is a great way of
getting feedback! Same for issues or feature requests.
Thank you for flying mhi airlines. Get the Vim on!
You can also follow me on Twitter: @_mhinz_
==============================================================================
8. License *startify-license*
MIT license. Copyright (c) 2013 Marco Hinz.
vim: tw=78