添加vim简单模式配置,无插件

This commit is contained in:
xinyz 2021-12-13 12:26:44 +08:00
parent 103e9e951c
commit a4600df465

45
vim/simple/vimrc Executable file
View file

@ -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