" === system if has("win32")||has("win64")||has("win95")||has("win16") let g:isWIN = 1 else let g:isWIN = 0 endif if has("gui_running") let g:isGUI = 1 else let g:isGUI = 0 endif if g:isWIN&&g:isGUI let plugpath = 'D:\Vim\vimfiles\plugged' elseif g:isWIN let plugpath = '/d/Vim/vimfiles/plugged' else let plugpath = '/home/WJ/.vim/plugged' endif " ===main setting commands let mapleader=" " syntax on :colorscheme molokai set background=dark set lines=40 columns=130 set noeb vb t_vb= set nobackup set noundofile set nohlsearch set number " set relativenumber set showcmd set ignorecase set smartcase set tabstop=4 set expandtab set shiftwidth=4 set autoindent set fileencodings=utf-8,gbk,ucs-bom,cp936,latin1 set guifont=Consolas:h10 " ===screen split noremap sk :set nosplitbelow:split noremap sj :set splitbelow:split noremap sh :set nosplitright:vsplit noremap sl :set splitright:vsplit noremap q :q noremap w :w noremap :q! noremap K 5k noremap J 5j noremap H 5h noremap L 5l map k map j map h map l map :res +5 map :res -5 map :vertical resize -5 map :vertical resize +5 inoremap ' ''i inoremap " ""i inoremap [ []i inoremap { {}i inoremap ( ()i inoremap < <>i vnoremap ' di''hp vnoremap [ di[]hp vnoremap { di{}hp vnoremap ( di()hp vnoremap < di<>hp inoremap /'\\|"\\|]\\|}\\|)\\|>a inoremap i inoremap o inoremap O autocmd FileType python noremap ma iif__name__=="__main__": map :call Compile() map :source $MYVIMRC func! Compile() exec "w" if &filetype == 'python' exec "!python %" endif endfunc " === Vim-Plugs call plug#begin(plugpath) Plug 'scrooloose/nerdtree' call plug#end() " === nerdtree config noremap :NERDTreeToggle autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif