Making (Mac)Vim reopen with files open when closed

后端 未结 3 1393
醉酒成梦
醉酒成梦 2021-01-31 12:49

Use case:

You have 2-3 files displayed in your MacVim window(s). You press ctrl+Q and MacVim closes. When you restart MacVim it opens displaying the same files you had w

相关标签:
3条回答
  • 2021-01-31 13:18

    I suggest you read about sessions :help session,that should answer your question. There are even nice scripts to deal with sessions.

    0 讨论(0)
  • 2021-01-31 13:35

    Install this plugin: https://github.com/xolox/vim-session

    And add this following two lines to your .vimrc :

    let g:session_autosave = 'yes'
    let g:session_autoload = 'yes'
    

    Now if you close your MacVim/GVim it saves and loads the session automatically.

    0 讨论(0)
  • 2021-01-31 13:35

    I suggest that you use session.vim Extended session management for Vim for session management as this plugin just works. You can automatically save your current session everytime you close vim or create a new session, close/open vim and load that session.

    0 讨论(0)
提交回复
热议问题