14.06.2014 Views

vim 101 hacks

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Buyer: xiujuan lu (luxiujuan@gmail.com)<br />

Transaction ID: 85W16630AD8515549<br />

Vim <strong>101</strong> Hacks<br />

www.thegeekstuff.com<br />

All of the above information will be stored when you save your session. You<br />

can also customize and decide which options you prefer to have stored by the<br />

save session command.<br />

To save the current session, do the following.<br />

:mksession<br />

When you have N files opened along with folds, multiple options set, different<br />

directory, window size customization, mksession will save all those things.<br />

To open a saved session, do the following.<br />

$ <strong>vim</strong> -S Session.<strong>vim</strong><br />

Session Command<br />

:mksession<br />

Description<br />

Creates a new session with the default file name<br />

Session.<strong>vim</strong> in the current working directory.<br />

:mksession filename<br />

Saves the session in the specified filename in the<br />

current working directory.<br />

$ <strong>vim</strong> –S Opens the default saved session. i.e., Opens<br />

Session.<strong>vim</strong> in the current directory.<br />

$ <strong>vim</strong> –S filename Opens a session using the session filename in the<br />

current directory.<br />

:source Session.<strong>vim</strong><br />

applies all session settings from a particular<br />

session file after you are already in the Vim<br />

editor<br />

115

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!