call plug#begin('~/.vim/plugged') Plug 'Smirnov-O/nten16.vim' Plug 'itchyny/lightline.vim' Plug 'jiangmiao/auto-pairs' Plug 'maxboisvert/vim-simple-complete' Plug 'preservim/nerdcommenter' Plug 'sheerun/vim-polyglot' call plug#end() "== General " Appearance set termguicolors colorscheme nten16 " Line numbers set nu rnu " Line wrap set nowrap nolinebreak " Tabs set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab set expandtab set autoindent " Status line set noshowmode showcmd set ruler " Mouse set mouse=a set mousehide set cursorline " Encoding set encoding=utf-8 set fileencodings=utf-8 " Backup file & history set nobackup noswapfile set history=100 " Search set incsearch set ignorecase set smartcase " Enable mode line set modeline " File explorer let g:netrw_banner = 0 let g:netrw_browse_split = 2 let g:netrw_winsize = 15 " Auto reload file set autoread " Buffer set hidden " Spell checker set nospell spelllang=en_us " Space/tab indicator set list listchars=tab:>·,trail:~,extends:>,precedes:<,space:· " Disable sound set visualbell t_vb= "== Settings for specific files autocmd BufWritePre *.py normal m`:%s/\s\+$//e `` autocmd FileType python,go,json setlocal expandtab shiftwidth=4 tabstop=4 autocmd FileType html,css,javascript,javascriptreact,yaml setlocal expandtab shiftwidth=2 tabstop=2 "== Aliases command! W :w command! Q :q command! Wq :wq command! WQ :wq command! Wiki :e ~/doc/index.md command! Prettier :!prettier --write % command! ESlint :!eslint % command! Flake8 :!flake8 % command! Black :!black % command! AutoPep8 :!autopep8 --in-place % "== Plug in configuration let g:lightline = { \ 'colorscheme': 'nten16', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], \ [ 'readonly', 'modified' ] ], \ 'right': [ [ 'lineinfo' ], \ [ 'percent' ], \ [ 'filename', 'filetype' ] ] } \ } let g:NERDCreateDefaultMappings = 1 let g:NERDSpaceDelims = 1 let g:NERDCompactSexyComs = 1 "== Mapping let mapleader="'" " Alternative keys noremap :w noremap :tabnew noremap ww :Wiki noremap e :Ve " Window noremap :wincmd h noremap :wincmd j noremap :wincmd k noremap :wincmd l " Split noremap spv :vsp noremap sph :sp noremap spk :wincmd K noremap spl :wincmd L noremap spn :wincmd n " Tab noremap tn :tabnew noremap tc :tabclose noremap :tabn 1 noremap :tabn 2 noremap :tabn 3 noremap :tabn 4 noremap :tabn 5 noremap :tabn 6 noremap :tabn 7 noremap :tabn 8 noremap :tabn 9 " Buffer noremap Bn :bnext noremap Bp :bprev " Work with system clipboard noremap y "*yy noremap p "+p