Alex Rivera | Logout

Vi/Vim restore opened files

Asked 2009-09-13T01:00:20.253
52

I was wondering if this common IDE feature is available.

Suppose I open many files using Vim, using vsplit and split. Then, I close everything.

The next day, I want to recover those files. That is, recover the way they were opened, not having to open each one (using split and vsplit) again.

Is that possible?

UPDATE:

Using mksession! and source commands, mapping commands in .vimrc file, is there a way to parameterize mappings so as to write a specific file?

for example:

map <F2> :mksession! ~/vim_session @INSERT_HERE<cr> "Save session to @INSERTHERE file

Thanks in advance

Edit
Report

3 Answers

2

You could consider using GNU Screen. In short: it's a command line Window Manager that allows a user to access multiple separate terminal sessions inside a single terminal session. The main advantage to me is that you can detach the session, close your terminal window, and later re-attach the session, and continue working.

answered 2009-09-17T20:46:21.100
1

You might be interested in this book:

http://www.swaroopch.com/notes/Vim#Download

It's one of the first few things they show you as an example of how great Vim is. ;)

Also, <cr> stands for Carriage Return.

answered 2009-09-13T03:33:40.253
1

SessionMan http://www.vim.org/scripts/script.php?script_id=2010 offers easier functionality. Be careful with miniBufExplorer. It's incompatible unless you use the modified version made by andrew on vim_use (and even then, it's only halfway compatible)

answered 2010-07-28T04:32:21.267

Your Answer