分页: 1 / 1

vim是否可以自动恢复关闭前已经打开的文件?

发表于 : 2011-05-25 17:09
redhatlinux10
如题,又来麻烦大家了,万分感谢!

Re: vim是否可以自动恢复关闭前已经打开的文件?

发表于 : 2011-05-25 17:28
redhatlinux10
消灭0回复!
sessionman.vim应该可以解决这个问题。

Re: vim是否可以自动恢复关闭前已经打开的文件?

发表于 : 2011-05-25 18:45
redhatlinux10
sessionman我没有弄好,向大家推荐这个session.vim
我的配置:
[vim]"configurations for session.vim
"
"要使得session.vim能自动保存和加载default.vim,需要先运行下SaveSession命令!
"
"let g:session_directory = $VIM '/vimfiles/sessions'
"By default this option is set to false (0). This means that when you start Vim without opening any files and the default session script exists,
"the session.vim plug-in will ask whether you want to restore your default session.
"When you set this option to true (1) and you start Vim without opening any files the default session will be restored without a prompt.
let g:session_autoload = 1

"By default this option is set to false (0). When you’ve opened a session and you quit Vim,
"the session.vim plug-in will ask whether you want to save the changes to your session.
"Set this option to true (1) to always automatically save open sessions when you quit Vim.
let g:session_autosave = 1[/vim]

Re: vim是否可以自动恢复关闭前已经打开的文件?

发表于 : 2011-05-28 9:28
using
ctrl+o ctrl+o ,注意是两次, 可以在.vimrc(或.gvimrc) 中加入映射,例如映射为F2:
map <F2> <C-o><C-o>