This is it. A start screen for Vim.
It does 3 things that will be explained in detail further below:
- it shows lists of files and directories
- eased session handling
- powerful menu entry handling
If you start Vim without giving any filenames or piping text to it, Startify will show a pretty start screen that shows a configurable list of files or directories:
Custom header ( empty by default ):
How about some ASCII art action?
Files from directory ( disabled by default ):
This lists all files from the current directory sorted by modification time.
Recently used files ( enabled by default ):
This uses the viminfo file to get a list of most recently used files. The list can also be filtered.
Sessions ( enabled by default ):
This will list all your sessions from a certain directory.
Bookmarks ( empty by default ):
Additionally, you can define bookmarks, thus entries for files that always should be available on the start screen.
See :h startify-options
for more information.
Please read and understand :help 'sessionoptions'
if you work with sessions.
Essentially there are two kinds of supported workflows for handling sessions that will be shown here.
a) The Startify way.
The handling of loading, saving and deleting sessions is eased by always working with one and the same directory. These commands are used for convenience:
:SLoad load a session
:SSave save a session
:SDelete delete a session
See :h startify-commands
for more information.
The advantage of always using the same directory is that Startify can show you a list of all your sessions that are scattered around the system.
b) The old way.
The old way means using :mksession
to save a Session.vim
file to the current
directory. Imagine a project folder with a Session.vim at its root directory.
This way makes it very portable.
When Vim gets started and the file Session.vim is found in the current
directory, it will be shown at the top of all lists as entry [0]
as a
shortcut.
If you bookmark a directory (project folder, anyone?) that contains a Session.vim, and you access that directory via Startify, that session will be loaded automatically.
Optionally, there is even support for persistent sessions. Thus you load a session via Startify, add some buffers, remove some buffers, change the window layout, .. and when you finish and exit Vim, the session will be saved automatically. This works for both ways of handling sessions.
Read :help startify-options
to learn more about how to configure session
handling to your liking.
You can either navigate to a certain entry using j
/k
and hit <cr>
or just
key in whatever is written between the square brackets on that line. You can
even double-click anywhere on the line.
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), v
(open in vertical
split) or t
(open in tab) for marking it. You can mark several entries and
also mix different markers. Afterwards execute all the markers in the order they
were given via <cr>
.
In case you don't want to open a file, there is also e
for creating an empty
buffer, i
for creating an empty buffer and jumping into insert mode and q
for quitting.
When one or more files were opened by Startify, it will close automatically. You
can always reopen the screen via :Startify
.
If you like any of my plugins, please star it on github. That is a great way of getting feedback. Same for issues reports or feature requests.
Marco Hinz aka mhinz aka mhi^ aka mhi
Mail: <[email protected]>
Twitter: @mhinz
Stackoverflow: mhinz
Thank you for flying mhi airlines. Get your Vim on!
If you have no preferred installation method, I suggest using tpope's pathogen. Afterwards installing vim-startify is as easy as pie:
$ git clone https://github.com/mhinz/vim-startify ~/.vim/bundle/vim-startify
$ vim
It works without any configuration, but you might want to look into the documentation for further customization:
:Helptags " rebuilding tags files
:h startify
:h startify-faq
MIT license. Copyright (c) 2013 Marco Hinz.