How to auto save vim session on quit and auto reload on start including split window state?

前端 未结 8 666
孤城傲影
孤城傲影 2020-12-13 04:35

I like to split my vim screen in 3. one :vsplit and one :split. I want these windows and the files I worked on to be saved when I close vim. I also want these windows to aut

8条回答
  •  醉梦人生
    2020-12-13 05:05

    The autosess plugin works well for this. Also available on GitHub: powerman/vim-plugin-autosess.

    From the plugin's description:

    Start Vim without file arguments to automatically load previous session for current directory. This make easier work with complex projects - just chdir to project directory and start vim.

    When you quit from Vim, if there are more than one open tab/window, session will be automatically saved. This let you edit single files in same directory without breaking your saved session. (Quickfix and vimdiff's windows are ignored.)

    If you quit from Vim with no open files, session will be deleted. This let you start usual empty Vim in this directory next time.

提交回复
热议问题