English 中文(简体)
六、拯救公开档案清单,随后开放所有档案
原标题:vim: save a list of open files and later open all files
  • 时间:2010-05-25 04:42:00
  •  标签:
  • vim

我想拯救一份公开档案清单(:ls),开端,开端,重新开放以前开过的所有档案。 我不想使用:mksession,因为它没有正确工作(可能是因为使用Im的原始金)

最佳回答

或许,如果你有一部分:mksession使你不关心,那么与:mksession的 b/冲突才会发生。

为此:

:set sessionoptions=buffers
:mksession
问题回答

另一种答案是,届会经理们的花钱是巨大的。 但是,我有一个非常轻重的备选办法,我可以在此留任。 (由于这一问题十分活跃,因此这一问题已经相当活跃。)

下面的法典自动节省了本届会议的闭幕式,并确定了一个关键指挥系统,以人工上载(在我确实想要举行有新档案的新会议时,可以操作)。 如果你能做到,每当一生再次开始,就无条件地恢复上一届会议,放弃维埃特线。

作为一种奖金,这还能够人工节约并恢复一次有关键意愿的单独会议。

Somewhere in ~/.vim/vimrc

" Automatically save the current session whenever vim is closed
autocmd VimLeave * mksession! ~/.vim/shutdown_session.vim

" <F7> restores that  shutdown session 
noremap <F7> :source ~/.vim/shutdown_session.vim<CR>

" If you really want to, this next line should restore the shutdown session 
" automatically, whenever you start vim.  (Commented out for now, in case 
" somebody just copy/pastes this whole block)
" 
" autocmd VimEnter source ~/.vim/shutdown_session.vim<CR>

" manually save a session with <F5>
noremap <F5> :mksession! ~/.vim/manual_session.vim<cr>

" recall the manually saved session with <F6>
noremap <F6> :source ~/.vim/manual_session.vim<cr>

用户可自行确定上文提及的会议选择:<代码> 求助会议选择。

I ve found setting viminfo in your .vimrc can also save the last known buffer list. Here s what I have.

“Set viminfo”

“助推器_21.txt

“5:将记住10份以前的文件

“50:每个登记册将节省100条线路

“:20:将记住多达20条线指挥线历史

“%:拯救和恢复缓冲清单

c viminfo=5,f1,”50,:20,%,n~/vim/viminfo





相关问题
Autoupdate VIM Plugins?

Is it possible to update vim plugins automatically?

how to unindent in vim without leaving edit mode?

I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

Vim - Deleting XML Comments

How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...

Limiting a match in vim to certain filetypes?

I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签