filetype plugin indent on syntax on autocmd CmdwinEnter * noremap autocmd FileType rust,c,cpp,java,python,sh,tex set noexpandtab colorcolumn=101 textwidth=100 autocmd FileType markdown set noexpandtab colorcolumn=81 textwidth=80 autocmd FileType markdown,tex set ai spell set encoding=utf-8 set termencoding=utf-8 set fileencodings=ucs-bom,utf-8,chinese let mapleader=" " nnoremap nnoremap Y y$ nnoremap : vnoremap : nnoremap f 1z= nnoremap h :noh:echo "Stopped search highlighting." nnoremap i :call ToggleIntuitiveLineMovement() nnoremap l :set list! nnoremap q gwap nnoremap r :set relativenumber! nnoremap s :call ToggleSpellCheck() nnoremap w :update set backspace=indent,eol,start " powerful backspace set complete+=kspell " dictionary completion set cpo+=J " sentences are separated by two spaces set display=lastline " show as much as possible when it doesn't fit set hlsearch set incsearch set listchars=eol:$,tab:>-,trail:ยท set mouse=a set number set relativenumber set showcmd set spelllang=en_us,cjk hi Normal ctermfg=white ctermbg=none hi Search ctermfg=yellow ctermbg=black hi IncSearch ctermfg=black ctermbg=yellow hi LineNr ctermfg=10 ctermbg=0 hi CursorLineNr ctermfg=12 ctermbg=0 hi Visual ctermfg=16 ctermbg=yellow hi Pmenu ctermfg=NONE ctermbg=236 hi PmenuSel ctermfg=0 ctermbg=10 set tabstop=4 set shiftwidth=4 set timeout ttimeoutlen=25 function! ToggleSpellCheck() set spell! if &spell echo "Spell check is now on." else echo "Spell check is now off." endif endfunction function! ToggleIntuitiveLineMovement() if mapcheck("jk")=="" echo "Intuitive line movement is now on." nnoremap j gj nnoremap k gk inoremap gj inoremap gk else echo "Intuitive line movement is now off." nunmap j nunmap k iunmap iunmap endif endfunction