Ⅰ. 插件描述
Vim Save and Restore Window Size/PositionⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'zkhvan/vim-savescreen'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'zkhvan/vim-savescreen'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'zkhvan/vim-savescreen'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/zkhvan/vim-savescreen
Ⅳ. 文档说明
Vim Save and Restore Window Size/Position
This tip is useful if you always want Vim to startup in the same location and
size as the time you exit it. Most applications (i.e. FireFox) do this already.
Another reason to use this tip is if you often have more than one Vim (GUI on
Windows) running. Quite often I will have one per project, each instance
editing multiple buffers. When I start Vim, I name it (based on the project or
tool I launched it from).
gvim myFile1 myFile2
gvim --servername MyProject filename1 filename2 filename3
gvim --servername VS_NET filenameWhen I re-open Vim I like its screen position and size to be the same as they
were when Vim was closed. The scripts below can be added to your .vimrc file.
They offer 2 configuration options which can be set at the bottom before the
autocmds:
" To enable the saving and restoring of screen positions.
let g:screen_size_restore_pos = 1
" To save and restore screen for each Vim instance.
" This is useful if you routinely run more than one Vim instance.
" For all Vim to use the same settings, change this to 0.
let g:screen_size_by_vim_instance = 1