Skip to content

Instantly share code, notes, and snippets.

@ghazanhaider
Created September 26, 2016 08:12
Show Gist options
  • Save ghazanhaider/f7e6996e499a9cde314251cc7a7dd834 to your computer and use it in GitHub Desktop.
Save ghazanhaider/f7e6996e499a9cde314251cc7a7dd834 to your computer and use it in GitHub Desktop.
set nocompatible
filetype off
syntax on
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin() " PLUGINS
Plugin 'gmarik/Vundle.vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'Valloric/YouCompleteMe' "Big one. Compile with:
Plugin 'scrooloose/syntastic' " Code syntax check, also uses flake8 (or pylint)
Plugin 'nvie/vim-flake8'
" Color plugins:
Plugin 'jnurmine/Zenburn' "Coloring
Plugin 'altercation/vim-colors-solarized' " Specific color theme
Plugin 'vim-airline/vim-airline' " Powerline replacement
" Git
Plugin 'tpope/vim-fugitive' " Basic GIT
" Github Gists
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
call vundle#end() " PLUGINS END
filetype plugin indent on
" Enable code folding
set foldmethod=indent " Or syntax
set foldlevel=99
let g:SimpylFold_docstring_preview=1
" Enable folding with the spacebar
nnoremap <space> za
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=79 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
set encoding=utf-8
let python_highlight_all=1
au BufNewFile,BufRead *.js, *.html, *.css
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2
" Minor improvements to YCM
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"" python with virtualenv support. Leaving them commented for now.
"py << EOF
"import os
"import sys
"if 'VIRTUAL_ENV' in os.environ:
" project_base_dir = os.environ['VIRTUAL_ENV']
" activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
" execfile(activate_this, dict(__file__=activate_this))
" EOF
"
" Color selection:
"
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
" Able to toggle this with F5
call togglebg#map("<F5>")
" Marking spaces before EOL
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match Conceal /^\s\+$/
" Pathogen plugin needs this:
" Read: https://github.com/klen/python-mode#using-pathogen-recommended
execute pathogen#infect()
" Disable syntasic syntax, too damn verbose:
let g:syntastic_quiet_messages = { "type": "style" }
set nu
set laststatus=2
" Direction of new window in split commands:
set splitbelow
set splitright
"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"
" OSX Clipboard access (for gist maybe)
set clipboard^=unnamedplus
let g:gist_clip_command = 'pbcopy'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment