Skip to content

Commit a8fe699

Browse files
committed
Merge branch 'develop'
2 parents c65d42f + 77e3b97 commit a8fe699

5 files changed

Lines changed: 257 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.swp

.vimrc

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+

README.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,68 @@
1-
# pyvim-docker
2-
VIM as Python IDE wrapped in a Docker image
1+
# pyvim
2+
3+
## Intro
4+
*__pyvim DOES NOT support Python 2__*
5+
6+
pyvim is a preconfigured plugins and settings [Vim] tailor made for Python
7+
development.
8+
9+
Included Vim plugins:
10+
- [Vundle.vim] - plugins management
11+
- [NERDTree] - tree file explore
12+
- [NERD Commenter] - code comment
13+
- [YouCompleteMe] - code completion
14+
- [SimpylFold] - cold folding for Python
15+
- [lightline.vim] - statusline/tabline
16+
- [fugitive.vim] - git integration
17+
- [syntastic] - syntax check
18+
- [auto-pairs] - auto generates surround pairs
19+
20+
pyvim is good for remote Python development with iPad via `ssh`/`mosh` as
21+
plugins & settings preconfigured in `.vimrc` are fully tested on the iPad
22+
Pro with its' Magic Keyboard using [Blink], and the macOS built-in
23+
terminal.
24+
25+
## Installation
26+
You can either use the `.vimrc` included directly and install [Vundle] &
27+
[YouCompleteMe] youself, or pull the prebuilt docker images from Docker
28+
Hub:
29+
```sh
30+
docker pull devtography/pyvim:tagname
31+
```
32+
33+
### Supported tags and repective `Dockerfile` links
34+
- [py3.8], [py3.8-focal], [latest]
35+
- [py3.7], [py3.7-focal]
36+
37+
## Fetaures request
38+
If there's any feature you'd like to see it be included in pyvim, you can
39+
open a new issue to make the request, or contribute via a pull request.
40+
41+
By making the request, please do explain why you think the requesting
42+
feature should be included. The general principle for the requesting
43+
feature to be accepted is the feature shold be benefit for the majority,
44+
and not anything heavy like en elephant whcih slows the Vim down.
45+
46+
## Contributions
47+
Contributions via pull requests are welcome and encouraged :)
48+
49+
## License
50+
pyvim is licensed under the [Apache License, Version 2.0](LICENSE.md).
51+
52+
[Vim]: https://www.vim.org
53+
[Vundle.vim]: https://github.com/VundleVim/Vundle.vim
54+
[NERDTree]: https://github.com/preservim/nerdtree
55+
[NERD Commenter]: https://github.com/preservim/nerdcommenter
56+
[YouCompleteMe]: https://github.com/ycm-core/YouCompleteMe
57+
[SimpylFold]: https://github.com/tmhedberg/SimpylFold
58+
[lightline.vim]: https://github.com/itchyny/lightline.vim
59+
[fugitive.vim]: https://github.com/tpope/vim-fugitive
60+
[syntastic]: https://github.com/vim-syntastic/syntastic
61+
[auto-pairs]: https://github.com/jiangmiao/auto-pairs
62+
[Blink]: https://blink.sh
63+
[Vundle]: https://github.com/VundleVim/Vundle.vim
64+
[latest]: https://github.com/Devtography/pyvim/blob/master/docker/Dockerfile
65+
[py3.8]: https://github.com/Devtography/pyvim/blob/master/docker/Dockerfile
66+
[py3.8-focal]: https://github.com/Devtography/pyvim/blob/master/docker/Dockerfile
67+
[py3.7]: https://github.com/Devtography/pyvim/blob/master/docker/Dockerfile_py3.7
68+
[py3.7-focal]: https://github.com/Devtography/pyvim/blob/master/docker/Dockerfile_py3.7

docker/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# VIM based Python IDE image on Ubuntu 20.04.
2+
FROM ubuntu:20.04
3+
4+
LABEL \
5+
maintainer="Wing Chau <wing@devtography.com>" \
6+
description="VIM based Python IDE on Ubuntu 20.04." \
7+
python-verion="3.8.2" \
8+
license="Apache License 2.0"
9+
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
12+
# Get the essential updates & packages
13+
RUN apt-get update && apt-get upgrade -y && apt-get clean
14+
15+
# Install Python3.8 & relative packages
16+
RUN apt-get update \
17+
&& apt-get install -y python3 python3-dev python3-venv python3-pip \
18+
&& pip3 install --upgrade pip \
19+
&& apt-get remove -y python3-pip \
20+
&& apt-get autoremove -y \
21+
&& apt-get clean \
22+
&& ln -s /usr/bin/python3 /usr/bin/python \
23+
&& pip install setuptools \
24+
&& pip install pipenv pylint yapf
25+
26+
# Install & setup development tools
27+
COPY .vimrc /root/.vimrc
28+
RUN apt-get install -y build-essential cmake curl git git-flow vim \
29+
&& git clone https://github.com/VundleVim/Vundle.vim.git \
30+
/root/.vim/bundle/Vundle.vim \
31+
&& vim +PluginInstall +qall \
32+
&& /root/.vim/bundle/YouCompleteMe/install.py --clangd-completer
33+
34+
CMD ["bash"]
35+

docker/Dockerfile_py3.7

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# VIM based Python IDE image on Ubuntu 20.04.
2+
FROM ubuntu:20.04
3+
4+
LABEL \
5+
maintainer="Wing Chau <wing@devtography.com>" \
6+
description="VIM based Python IDE on Ubuntu 20.04." \
7+
python-verion="3.7.7" \
8+
license="Apache License 2.0"
9+
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
12+
# Get the essential updates & packages
13+
RUN apt-get update && apt-get upgrade -y && apt-get clean \
14+
&& apt-get install -y software-properties-common \
15+
&& add-apt-repository ppa:deadsnakes/ppa \
16+
&& apt-get remove -y software-properties-common \
17+
&& apt-get autoremove -y \
18+
&& apt-get clean
19+
20+
# Install Python3.7 & relative packages
21+
RUN apt-get update \
22+
&& apt-get install -y python3.7 python3.7-dev python3.7-venv \
23+
&& apt-get clean \
24+
&& ln -s /usr/bin/python3.7 /usr/bin/python3 \
25+
&& ln -s /usr/bin/python3 /usr/bin/python \
26+
&& python3.7 -m ensurepip --default-pip \
27+
&& pip install --upgrade pip \
28+
&& pip install pipenv pylint yapf
29+
30+
# Install & setup development tools
31+
COPY .vimrc /root/.vimrc
32+
RUN apt-get install -y build-essential cmake curl git git-flow vim \
33+
&& git clone https://github.com/VundleVim/Vundle.vim.git \
34+
/root/.vim/bundle/Vundle.vim \
35+
&& vim +PluginInstall +qall \
36+
&& /root/.vim/bundle/YouCompleteMe/install.py --clangd-completer
37+
38+
CMD ["bash"]
39+

0 commit comments

Comments
 (0)