@@ -4,11 +4,12 @@ filetype off " required
44" set the runtime path to include Vundle and initialise
55set rtp += ~/.vim/bundle/Vundle.vim/
66call vundle#begin ()
7-
87" let Vundle manage Vundle, required
98Plugin ' VundleVim/Vundle.vim'
109" tree file explore
1110Plugin ' preservim/nerdtree'
11+ " git status flags on NERDTree
12+ Plugin ' Xuyuanp/nerdtree-git-plugin'
1213" code comment
1314Plugin ' preservim/nerdcommenter'
1415" auto complete
@@ -19,10 +20,10 @@ Plugin 'tmhedberg/SimpylFold'
1920Plugin ' itchyny/lightline.vim'
2021" git integration
2122Plugin ' tpope/vim-fugitive'
23+ " indicates which lines have been modified in editor window
24+ Plugin ' airblade/vim-gitgutter'
2225" syntax check
2326Plugin ' dense-analysis/ale'
24- " auto generates surround pairs
25- Plugin ' jiangmiao/auto-pairs'
2627
2728" All of the plugins must be added before the following line
2829call vundle#end () " required
@@ -41,17 +42,29 @@ syntax on " enable syntax highlighting
4142colorscheme desert " set `desert` as default colour scheme
4243set autoindent " indent when moving to the next while writing code
4344set colorcolumn = 80 " show 80 line indicator
45+ set cursorline " show cursorline by default
4446set encoding = utf- 8 " show output in UTF-8 as YouCompleteMe requires
4547set expandtab " expand tabs into spaces
4648set fileencoding = utf- 8 " save file with UTF-8 encoding
4749set fileformat = unix " save file with LF line endings
50+ set hlsearch " highlight the search results
4851set laststatus = 2 " show the statusline/tabline
4952set number " show line numbers
5053set shiftwidth = 4 " shift lines by 4 spaces for indent
54+ set shell = bash " set bash as default terminal
5155set showmatch " show the matching part of the pair for [] {} & ()
5256set softtabstop = 4 " for easier backspacing the soft tabs
5357set tabstop = 4 " set tabs to have 4 spaces
58+ set timeoutlen = 100 " reduce mapping & keycode delay for sanppy responses
5459set tws = 15 x0 " set terminal windows size
60+ set updatetime = 100 " reduce Vim default delay time from 4000ms to 100ms
61+
62+ " allow backspacing over everthing in insert mode
63+ set backspace = indent ,eol ,start
64+
65+ " auto-switch between case-sensitive & case-insensitive search
66+ set ignorecase
67+ set smartcase
5568
5669" split layout
5770set splitbelow
@@ -66,17 +79,24 @@ nnoremap <C-H> <C-W><C-H>
6679" code folding
6780set foldmethod = indent
6881set foldlevel = 99
82+
6983" enable folding with spacebar
7084nnoremap <space> za
7185
86+ " prevents `ftplugin` to enforce the textwidth while editing commit msg
87+ au FileType gitcommit setlocal textwidth = 0
88+
89+ " highlight colour for search results
90+ highlight Search ctermbg= LightYellow ctermfg= DarkGrey
91+
7292" highlight unneccessary whitespaces
7393highlight BadWhitespace ctermbg= yellow guibg= yellow
7494au BufRead ,BufNewFile *.py,*.pyw,*.c,*.h match
7595 \ BadWhitespace /\s\+$/
7696
7797" hide colorcolumn in non-editor windows
7898au FileType fugitive,help,qf setlocal nonumber colorcolumn =
79- au BufEnter * if &ft == ' ' | setlocal nonumber colorcolumn = | endif
99+ au BufAdd * if &previewwindow | set nonumber colorcolumn = | endif
80100
81101" enable all Python syntax highlighting features
82102let python_highlight_all= 1
@@ -117,3 +137,9 @@ let g:ale_linters={ 'python': ['pylint'] }
117137let g: ale_fixers= { ' python' : [' yapf' ] }
118138let g: ale_open_list= 1
119139let g: ale_linters_explicit= 1
140+
141+ " plugin settings - vim-gitgutter
142+ highlight ! link SignColumn LineNr
143+ highlight GitGutterAdd ctermfg= 2
144+ highlight GitGutterChange ctermfg= 3
145+ highlight GitGutterDelete ctermfg= 1
0 commit comments