Skip to content

Instantly share code, notes, and snippets.

@niranjrajasekaran
Created August 3, 2020 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niranjrajasekaran/fb0f86d6f4132aad48f87723970ceef6 to your computer and use it in GitHub Desktop.
Save niranjrajasekaran/fb0f86d6f4132aad48f87723970ceef6 to your computer and use it in GitHub Desktop.
A simple vimrc config file for python projects
set nocompatible " required
filetype off " required
" Enable folding
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
" Line Number
set number
" Cusrsor Line
set cursorline
hi cursorline cterm=none term=none
autocmd WinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
highlight CursorLine guibg=#303000 ctermbg=234
" Highlighter for column 79
:set colorcolumn=79
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'preservim/nerdtree'
Plugin 'junegunn/seoul256.vim'
Plugin 'vim-syntastic/syntastic'
Plugin 'davidhalter/jedi-vim'
" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)
" ...
"
" To automatically open NERDTree on vim init
autocmd vimenter * NERDTree
" Toggling NERDTree on pressing F6 Key
nmap <F6> :NERDTreeToggle<CR>
" Closes vim when there is no active file buffer
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Syntastic PEP8 highlighter
" Using flake8 for this
" Make the the flake8 is installed in your system or venv and added to your
" $PATH
" pip3 install flake8
" To be consistent add flake8 PATH in bashrc
let python_highlight_all=1
syntax on
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_check_on_open = 1
" All of your Plugins must be added before the following line
call vundle#end() " required
" seoul256 (dark):
" Range: 233 (darkest) ~ 239 (lightest)
" Default: 237
let g:seoul256_background = 233
colo seoul256
" This sets the ColorColumn to red
" Refer :help ctermbg
highlight ColorColumn ctermbg=1*
filetype plugin indent on " required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment