Simple vim configurations for remote coding in Python, heavily based on vim-for-server, are developed by incorporating few practical plugins and better python syntax highlight (python.vim
).
-
Back up the original
.vimrc
cp ~/.vimrc ~/.vimrc_backup
-
Use Vundle to manage vim plugins
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
-
Clone these dotfiles and put them into right places
git clone https://github.com/haibo-qiu/Simple-Remote-Vim cp Simple-Remote-Vim/.vimrc ~/.vimrc mkdir -p ~/.vim/after/syntax/ cp Simple-Remote-Vim/python.vim ~/.vim/after/syntax/python.vim
Note that
python.vim
is to highlight Python function properly.
-
Launch
vim
and run:PluginInstall
to install plugins.
For basic configurations and mappings in .vimrc
, please refer to this blog for detailed explanations.
Several adopted plugins are introduced as follows:
- vim-syntastic/syntastic: make sure flake8 is installed (
pip install flake8
), and<F7>
is for syntax checking. - tell-k/vim-autopep8: autopep8 is required (
pip install autopep8
), and<F8>
is for autopep8 formatting. - preservim/nerdtree: a file system explorer by
<ctrl-n>
. - preservim/nerdcommenter: for visual black,
,cc
and,cu
are for commenting and uncommenting separately. - Xuyuanp/nerdtree-git-plugin: show git status flags for nerdtree file explorer.
- vim-airline/vim-airline: a nice statusline at the bottom of vim window.
- vim-airline/vim-airline-themes: various themes for vim-airline.
- ctrlpvim/ctrlp.vim: a fuzzy file finder with
,p
. - tpope/vim-fugitive: use arbitrary Git commands in vim command line, e.g.,
:Git status -s
.
Note that there is no semantic autocompletion plugin in this .vimrc
. if your vim is compiled with python3
support, jedi-vim would be a good choice. To pursue a even better experience in autocompletion (e.g., LSP support) like vscode, coc.nvim can be considered, which, however, requires vim8 or neovim.
Resources for learning and configuring neovim:
Well-developed IDE-like neovim configurations: