Last active
March 22, 2020 23:45
-
-
Save cijohnson/9e84a54bd6c1a813e04c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install pathogen.vim | |
------------------------ | |
- mkdir -p ~/.vim/autoload | |
- curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
2. Add runtime path manipulation | |
--------------------------------- | |
Write the following in ~/.vimrc | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
" Disable auto indent in local file by pressing F8 | |
:nnoremap <F8> :setl noai nocin nosi inde=<CR> | |
3. Add the vim-flake8 plugin to vim: | |
------------------------------------ | |
- git clone git@github.com:nvie/vim-flake8.git ~/.vim/bundle/vim-flake8 | |
4. Create python Virtual Env(Optional): | |
--------------------------------------- | |
Most of the development machines will not grant root permission to install python packages, So better to | |
create a virtualenv to install our experimental python pacakges | |
- cd /home/<user>/ | |
- virtualenv devenv | |
5. Install flake8 in the devenv: | |
-------------------------------- | |
- source /home/<user>/devenv/bin/activate | |
- sudo pip install flake8 | |
6. Automatic PEP8 check on saving a file: | |
------------------------------------------ | |
6.1 Write the following in ~/.bashrc | |
source /home/<user>/devenv/bin/activate | |
6.2 Write the following in ~/.vimrc | |
autocmd BufWritePost *.py call Flake8() | |
NOTE: If auto PEP8 check is not prefered skip step 6.2, Instead press F7 to check | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment