From a4600df465e2c43d425f736085c21663886e7323 Mon Sep 17 00:00:00 2001 From: xinyz Date: Mon, 13 Dec 2021 12:26:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0vim=E7=AE=80=E5=8D=95?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=97=A0=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vim/simple/vimrc | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 vim/simple/vimrc diff --git a/vim/simple/vimrc b/vim/simple/vimrc new file mode 100755 index 0000000..5be6421 --- /dev/null +++ b/vim/simple/vimrc @@ -0,0 +1,45 @@ +function! Config_setEnv() abort + if exists('g:env') + return + endif + if has('win64') || has('win32') || has('win16') + let g:env = 'WINDOWS' + else + let g:env = toupper(substitute(system('uname'), '\n', '', '')) + endif +endfunction + +color desert +syntax on +set nu +set tabstop=4 +set shiftwidth=4 +set cindent +set backspace=indent,eol,start +set incsearch +set hlsearch +set fileencodings=utf-8,gbk +set nobackup +filetype on +filetype plugin on +filetype indent on + +call Config_setEnv() +if (g:env =~# 'WINDOWS') + set dir=$userprofile\\AppData\\Local\\Temp + set bdir=$userprofile\\AppData\\Local\\Temp +else + set dir=/tmp + set bdir=/tmp +endif + +if (g:env =~# 'WINDOWS') + au GUIEnter * simalt ~x +else + au GUIEnter * call MaximizeWindow() +endif + +function! MaximizeWindow() + silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz +endfunction +