Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim: save a list of open files and later open all files

Tags:

I want to save a list of open files (:ls), quit gvim, start gvim, reopen all previously opened files. I don't want to use :mksession because it doesn't work correctly (probably due to some of the plugins I'm using)

like image 287
tvrtko Avatar asked May 25 '10 04:05

tvrtko


People also ask

How do I open multiple files in Vim?

Ctrl-W w to switch between open windows, and Ctrl-W h (or j or k or l ) to navigate through open windows. Ctrl-W c to close the current window, and Ctrl-W o to close all windows except the current one. Starting vim with a -o or -O flag opens each file in its own split.

How do I save and quit all tabs in Vim?

:wa - save all tabs / unsaved buffers. :xa / :wqa - save all tabs / unsaved buffers and exit Vim.

How do I make multiple tabs in Vim?

To directly move to first tab or last tab, you can enter the following in command mode: :tabfirst or :tablast for first or last tab respectively. To move back and forth : :tabn for next tab and :tabp for previous tab. You can list all the open tabs using : :tabs. To open multiple files in tabs: $ vim -p source.


1 Answers

Maybe the bug/conflict with :mksession is only if you have parts of :mksession enabled that you don't care about.

Try this:

:set sessionoptions=buffers :mksession 
like image 143
JasonWoof Avatar answered Sep 18 '22 22:09

JasonWoof