46 lines
879 B
VimL
Executable file
46 lines
879 B
VimL
Executable file
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
|
|
|