Skip to content

Commit 586d014

Browse files
committed
Merge branch 'release/2020.06.22'
2 parents f0f1f03 + ab78b2d commit 586d014

File tree

5 files changed

+72
-10
lines changed

5 files changed

+72
-10
lines changed

.vimrc

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ filetype off " required
44
" set the runtime path to include Vundle and initialise
55
set rtp+=~/.vim/bundle/Vundle.vim/
66
call vundle#begin()
7-
87
" let Vundle manage Vundle, required
98
Plugin 'VundleVim/Vundle.vim'
109
" tree file explore
1110
Plugin 'preservim/nerdtree'
11+
" git status flags on NERDTree
12+
Plugin 'Xuyuanp/nerdtree-git-plugin'
1213
" code comment
1314
Plugin 'preservim/nerdcommenter'
1415
" auto complete
@@ -19,10 +20,10 @@ Plugin 'tmhedberg/SimpylFold'
1920
Plugin 'itchyny/lightline.vim'
2021
" git integration
2122
Plugin 'tpope/vim-fugitive'
23+
" indicates which lines have been modified in editor window
24+
Plugin 'airblade/vim-gitgutter'
2225
" syntax check
2326
Plugin '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
2829
call vundle#end() " required
@@ -41,17 +42,29 @@ syntax on " enable syntax highlighting
4142
colorscheme desert " set `desert` as default colour scheme
4243
set autoindent " indent when moving to the next while writing code
4344
set colorcolumn=80 " show 80 line indicator
45+
set cursorline " show cursorline by default
4446
set encoding=utf-8 " show output in UTF-8 as YouCompleteMe requires
4547
set expandtab " expand tabs into spaces
4648
set fileencoding=utf-8 " save file with UTF-8 encoding
4749
set fileformat=unix " save file with LF line endings
50+
set hlsearch " highlight the search results
4851
set laststatus=2 " show the statusline/tabline
4952
set number " show line numbers
5053
set shiftwidth=4 " shift lines by 4 spaces for indent
54+
set shell=bash " set bash as default terminal
5155
set showmatch " show the matching part of the pair for [] {} & ()
5256
set softtabstop=4 " for easier backspacing the soft tabs
5357
set tabstop=4 " set tabs to have 4 spaces
58+
set timeoutlen=100 " reduce mapping & keycode delay for sanppy responses
5459
set tws=15x0 " 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
5770
set splitbelow
@@ -66,17 +79,24 @@ nnoremap <C-H> <C-W><C-H>
6679
" code folding
6780
set foldmethod=indent
6881
set foldlevel=99
82+
6983
" enable folding with spacebar
7084
nnoremap <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
7393
highlight BadWhitespace ctermbg=yellow guibg=yellow
7494
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match
7595
\ BadWhitespace /\s\+$/
7696

7797
" hide colorcolumn in non-editor windows
7898
au 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
82102
let python_highlight_all=1
@@ -117,3 +137,9 @@ let g:ale_linters={ 'python': ['pylint'] }
117137
let g:ale_fixers={ 'python': ['yapf'] }
118138
let g:ale_open_list=1
119139
let 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

CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
77

8+
## [2020.06.22]
9+
### Added
10+
- Auto case-sensitive & case-insensitive switch for searches
11+
- Vim plugin `airblade/vim-gitgutter` to show Git diff in the sign column next
12+
to line numbers in editor windows.
13+
- Vim plugin `Xuyuanp/nerdtree-git-plugin` to show Git status flags on NERDTree.
14+
- Highlight on search result & custom highlight colour.
15+
- Added global git config `credential.helper cache` for macOS user as
16+
`osxkeychain` is not available on Linux.
17+
18+
### Changed
19+
- Default shell for Vim to `bash`.
20+
- Backspace to allow backspcaing over everthing in insert mode like most usual
21+
editors.
22+
- `cursorline` is now enabled by default.
23+
24+
### Fixed
25+
- Heavy delay on shortcut `<<` while decreasing indent by reducing the
26+
`timeoutlen` to `100`(0.1s).
27+
- Text being moved to new line automatically at position `72` as Vim setting
28+
`textwidth` has been overriden by `ftplugin` for filetype `gitcomit.
29+
Implemented an `autocmd` to override it back to `textwidth=0`.
30+
- 1st file opened will notshow line numbers and colour column if Vim is
31+
initialised with cmd `vi`/`vim` due to the `autocmd` set to hide those items
32+
on `YouCompleteMe` preivew windo overrides the settings. Implemented a new
33+
`autocmd` which fixed this issue.
34+
35+
### Removed
36+
- Vim plugin `jiangmiao/auto-pairs` as it somehow messes with the indents for
37+
bracket closures.
38+
839
## [2020.06.19]
940
### Added
1041
- Vim plugin `dense-analysis/ale` (a.k.a. ALE) for much faster linting.
@@ -38,7 +69,8 @@ found` by pinning the `pipenv` version to `2018.11.26`.
3869
- `.vimrc` configured for Python developemnt.
3970
- Ubuntu 20.04 based dockerfiles to build images for Python 3.7 & 3.8 variants.
4071

41-
[Unreleased]: https://github.com/devtography/pyvim/compare/2020.06.19...HEAD
72+
[Unreleased]: https://github.com/devtography/pyvim/compare/2020.06.22...HEAD
73+
[2020.06.22]: https://github.com/devtography/pyvim/compare/2020.06.19...2020.06.22
4274
[2020.06.19]: https://github.com/devtography/pyvim/compare/2020.06.18...2020.06.19
4375
[2020.06.18]: https://github.com/devtography/pyvim/compare/2020.06.17...2020.06.18
4476
[2020.06.17]: https://github.com/devtography/pyvim/releases/tag/2020.06.17

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ development.
99
Included Vim plugins:
1010
- [Vundle.vim] - plugins management
1111
- [NERDTree] - tree file explore
12-
- [NERD Commenter] - code comment
12+
- [nerdtree-git-plugin] - plugin of [NERDTree] showing git status flags
13+
- [NERD Commenter] - powerful code comment tool
1314
- [YouCompleteMe] - code completion
1415
- [SimpylFold] - cold folding for Python
1516
- [lightline.vim] - statusline/tabline
1617
- [fugitive.vim] - git integration
1718
- [Asynchronous Lint Engine] \(a.k.a. ALE) - linting
18-
- [auto-pairs] - auto generates surround pairs
19+
- [vim-gitgutter] - shows git diff in the sign column
1920

2021
pyvim is good for remote Python development with iPad via `ssh`/`mosh` as
2122
plugins & settings preconfigured in `.vimrc` are fully tested on the iPad
@@ -52,13 +53,14 @@ pyvim is licensed under the [Apache License, Version 2.0](LICENSE.md).
5253
[Vim]: https://www.vim.org
5354
[Vundle.vim]: https://github.com/VundleVim/Vundle.vim
5455
[NERDTree]: https://github.com/preservim/nerdtree
56+
[nerdtree-git-plugin]: https://github.com/Xuyuanp/nerdtree-git-plugin
5557
[NERD Commenter]: https://github.com/preservim/nerdcommenter
5658
[YouCompleteMe]: https://github.com/ycm-core/YouCompleteMe
5759
[SimpylFold]: https://github.com/tmhedberg/SimpylFold
5860
[lightline.vim]: https://github.com/itchyny/lightline.vim
5961
[fugitive.vim]: https://github.com/tpope/vim-fugitive
6062
[Asynchronous Lint Engine]: https://github.com/dense-analysis/ale
61-
[auto-pairs]: https://github.com/jiangmiao/auto-pairs
63+
[vim-gitgutter]: https://github.com/airblade/vim-gitgutter
6264
[Blink]: https://blink.sh
6365
[Vundle]: https://github.com/VundleVim/Vundle.vim
6466
[latest]: https://github.com/Devtography/pyvim/blob/master/docker/Dockerfile

docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ RUN apt-get install -y build-essential cmake curl git git-flow iputils-ping vim
2929
&& git clone https://github.com/VundleVim/Vundle.vim.git \
3030
/root/.vim/bundle/Vundle.vim \
3131
&& vim +PluginInstall +qall \
32-
&& /root/.vim/bundle/YouCompleteMe/install.py --clangd-completer
32+
&& /root/.vim/bundle/YouCompleteMe/install.py --clangd-completer \
33+
&& git config --global credentail.helper cache
3334

3435
CMD ["bash"]
3536

docker/Dockerfile_py3.7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ RUN apt-get install -y build-essential cmake curl git git-flow iputils-ping vim
3333
&& git clone https://github.com/VundleVim/Vundle.vim.git \
3434
/root/.vim/bundle/Vundle.vim \
3535
&& vim +PluginInstall +qall \
36-
&& /root/.vim/bundle/YouCompleteMe/install.py --clangd-completer
36+
&& /root/.vim/bundle/YouCompleteMe/install.py --clangd-completer \
37+
&& git config --global credential.helper cache
3738

3839
CMD ["bash"]
3940

0 commit comments

Comments
 (0)