Tuesday, September 13, 2016

VIM and Python :: Ubuntu Xenial

Yesterday I read about making VIM to a powerful IDE for Python here:  VIM and Python - a Match Made in Heaven

The above post is almost complete and covers everything. I tried to run the configuration on Ubuntu Xenial and noticed that the following updates apply to the article:

1- Use the following code in PEP8 Python indentation instead of the default one of the blog post:

au BufNewFile,BufRead *.py
    \ set tabstop=4 |
    \ set softtabstop=4 |
    \ set shiftwidth=4 |
    \ set textwidth=79 |
    \ set expandtab |
    \ set autoindent |
    \ set fileformat=unix |

au BufNewFile,BufRead *.js,*.html,*.css
    \ set tabstop=2 |
    \ set softtabstop=2 |
    \ set shiftwidth=2 |

2- Add the following line before the code provided in Flagging Unnecessary Whitespace of the blog post:

highlight BadWhitespace ctermbg=red guibg=darkred

3- Use py3 << EOF instead of py << EOF in Virtualenv Support of the blog post.

4- Assign F6 key to toggle NERDTree:

nnoremap <F6> :NERDTreeToggle<CR>

and add the following lines to have powerline and NERDTree activated at startup:

autocmd vimenter * NERDTree
set laststatus=2
set t_Co=256

Happy developing!

No comments:

Post a Comment