armsultan
12/21/2016 - 2:36 AM

.vimrc

.vimrc

set nocompatible              " required
filetype off                  " required

" MAC OS SHOULD USE MACVIM. run:
" brew install macvim --with-override-system-vim
" or create an alias:
" alias vim="/Users/user/Applications/MacVim.app/Contents/MacOS/Vim"

" 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'

" Airline
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'

" ***** PYTHON PLUGINS *****
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
" SimpylFold https://github.com/tmhedberg/SimpylFold
Plugin 'tmhedberg/SimpylFold'
" Auto-Indentation
Plugin 'vim-scripts/indentpython.vim'
" Auto-complete
Bundle 'Valloric/YouCompleteMe'

" Syntastic Syntax Checking/Highlighting
Plugin 'scrooloose/syntastic'

" PEP8 checking
Plugin 'nvie/vim-flake8'

" color schemes
Plugin 'dracula/vim'

" Nerd Tree File Browsing and tabs
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'

" Super Searching
Plugin 'kien/ctrlp.vim'

" Git Integration
Plugin 'tpope/vim-fugitive'

"Powerline
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}

" ***** END *****


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

" UTF8 Support
set encoding=utf-8

" specify different areas of the screen where the splits should occur
set splitbelow
set splitright

" split navigations keyboard shortcuts
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>

" Fix Mac delete key function
:set backspace=indent,eol,start

" Cycling through listed buffers
:nnoremap <Tab> :bnext<CR>
:nnoremap <S-Tab> :bprevious<CR>

" Enable folding
set foldmethod=indent
set foldlevel=99

" Enable folding with the spacebar
nnoremap <space> za

" PEP8 
" standard four spaces when you hit tab, ensure your line length doesn’t go
" beyond 80 characters, and store the file in a unix format so you don’t get a
" bunch of conversion issues when checking into GitHub and/or sharing with
" other users.
" Settings for Python
au BufNewFile,BufRead *.py
    \ set tabstop=4
    \ set softtabstop=4
    \ set shiftwidth=4
    \ set textwidth=79
    \ set expandtab
    \ set autoindent
    \ set fileformat=unix

" Other settings for web 
au BufNewFile,BufRead *.js, *.html, *.css
    \ set tabstop=2
    \ set softtabstop=2
    \ set shiftwidth=2
" avoid extraneous whitespace. We can have VIM flag that for us so that it’s
" easy to spot – and then remove.
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/

"  YouCompleteMe Plugin settings
"  The former line ensures that the autocomplete window goes away when you’re
"  done with it, and the latter defines a shortcut for goto definition.
"  My leader key is mapped to space, so space-g will goto definition of
"  whatever I’m currently on. Helpful when exploring new code
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g  :YcmCompleter GoToDefinitionElseDeclaration<CR>

" Python with virtualenv support
" Virtualenv Support
"
" One issue with the goto definition above is that VIM by default doesn’t know
" anything about virtualenv, so you have to make VIM and YouCompleteMe aware
" of your virtualenv

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

" Python syntax highlighting
let python_highlight_all=1
syntax on

" hide .pyc files in NERD tree
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree

" Line numbering
set nu

" System clipboard to cut, copy, and/or paste to/from other applications outside of VIM
set clipboard=unnamed

" Mouse support
set mouse=a

" Enable Airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1

" Show an underlin when Vim is in Insert Mode 
:autocmd InsertEnter * set cul
:autocmd InsertLeave * set nocul