|
| 1 | +set nocompatible " be IMproved, requied |
| 2 | +filetype off " required |
| 3 | + |
| 4 | +" set the runtime path to include Vundle and initialise |
| 5 | +set rtp+=~/.vim/bundle/Vundle.vim/ |
| 6 | +call vundle#begin() |
| 7 | + |
| 8 | +" let Vundle manage Vundle, required |
| 9 | +Plugin 'VundleVim/Vundle.vim' |
| 10 | +" tree file explore |
| 11 | +Plugin 'preservim/nerdtree' |
| 12 | +" code comment |
| 13 | +Plugin 'preservim/nerdcommenter' |
| 14 | +" auto complete |
| 15 | +Plugin 'ycm-core/YouCompleteMe' |
| 16 | +" code folding for Python |
| 17 | +Plugin 'tmhedberg/SimpylFold' |
| 18 | +" fancy statusline/tabline |
| 19 | +Plugin 'itchyny/lightline.vim' |
| 20 | +" git integration |
| 21 | +Plugin 'tpope/vim-fugitive' |
| 22 | +" syntax check |
| 23 | +Plugin 'vim-syntastic/syntastic' |
| 24 | +" auto generates surround pairs |
| 25 | +Plugin 'jiangmiao/auto-pairs' |
| 26 | + |
| 27 | +" All of the plugins must be added before the following line |
| 28 | +call vundle#end() " required |
| 29 | +filetype plugin indent on " required |
| 30 | + |
| 31 | +" Brief help |
| 32 | +" :PluginList - lists configured plugins |
| 33 | +" :PluginInstall - installs plugins; append `!` to update or just |
| 34 | +" :PluginUpdate |
| 35 | +" :PluginSearch foo - searches for foo; append `!` to refresh local cache |
| 36 | +" :PluginClean - confirms removal of unused plugins; append `!` to |
| 37 | +" auto-approve removal |
| 38 | + |
| 39 | +" Non-plugin settings after this line |
| 40 | +syntax on " enable syntax highlighting |
| 41 | +colorscheme desert " set `desert` as default colour scheme |
| 42 | +set autoindent " indent when moving to the next while writing code |
| 43 | +set encoding=utf-8 " show output in UTF-8 as YouCompleteMe requires |
| 44 | +set expandtab " expand tabs into spaces |
| 45 | +set fileencoding=utf-8 " save file with UTF-8 encoding |
| 46 | +set fileformat=unix " save file with LF line endings |
| 47 | +set laststatus=2 " show the statusline/tabline |
| 48 | +set number " show line numbers |
| 49 | +set shiftwidth=4 " shift lines by 4 spaces for indent |
| 50 | +set showmatch " show the matching part of the pair for [] {} & () |
| 51 | +set softtabstop=4 " for easier backspacing the soft tabs |
| 52 | +set tabstop=4 " set tabs to have 4 spaces |
| 53 | + |
| 54 | +highlight cursorcolumn cterm=NONE ctermbg=darkgrey ctermfg=white |
| 55 | + \ guibg=darkgrey guifg=white |
| 56 | + |
| 57 | +" split layout |
| 58 | +set splitbelow |
| 59 | +set splitright |
| 60 | + |
| 61 | +" split navigations |
| 62 | +nnoremap <C-J> <C-W><C-J> |
| 63 | +nnoremap <C-K> <C-W><C-K> |
| 64 | +nnoremap <C-L> <C-w><C-L> |
| 65 | +nnoremap <C-H> <C-W><C-H> |
| 66 | +
|
| 67 | +" code folding |
| 68 | +set foldmethod=indent |
| 69 | +set foldlevel=99 |
| 70 | +" enable folding with spacebar |
| 71 | +nnoremap <space> za |
| 72 | +
|
| 73 | +" plugin settings - NERDTree |
| 74 | +map <C-\> :NERDTreeToggle<CR> |
| 75 | +
|
| 76 | +" plugin settings - NERD Commenter |
| 77 | +map <C-_> <leader>ci |
| 78 | +map <D-_> <leader>ci |
| 79 | +map <C-/> <leader>ci |
| 80 | +
|
| 81 | +let g:NERDSpaceDelims=1 |
| 82 | + |
| 83 | +" plugin settings - SimpylFold |
| 84 | +let g:SimpylFold_docstring_preview=1 |
| 85 | + |
| 86 | +" plugin settings - lightline |
| 87 | +set noshowmode " get rid of the redundant -- INSERT -- |
| 88 | +if !has('gui_running') |
| 89 | + set t_Co=256 |
| 90 | +endif |
| 91 | + |
| 92 | +" plugin settings - YouCompleteMe |
| 93 | +let g:ycm_semantic_triggers={ 'python': [ 're!\w{1}' ] } |
| 94 | +let g:ycm_autoclose_preview_window_after_completion=1 |
| 95 | + |
| 96 | +" plugin settings - syntasatic |
| 97 | +set statusline+=%#warningmsg# |
| 98 | +set statusline+=%{SyntasticStatuslineFlag()} |
| 99 | +set statusline+=%* |
| 100 | + |
| 101 | +let g:syntastic_always_populate_loc_list=1 |
| 102 | +let g:syntastic_auto_loc_list=1 |
| 103 | +let g:syntastic_check_on_open=1 |
| 104 | +let g:syntastic_check_on_wq=0 |
| 105 | +let g:syntastic_python_checkers=['pylint'] |
| 106 | + |
| 107 | +" enable all Python syntax highlighting features |
| 108 | +let python_highlight_all=1 |
| 109 | + |
| 110 | +" highlight unneccessary whitespaces |
| 111 | +highlight BadWhitespace ctermbg=yellow guibg=yellow |
| 112 | +au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match |
| 113 | + \ BadWhitespace /\s\+$/ |
| 114 | + |
0 commit comments