Skip to content

Instantly share code, notes, and snippets.

@badstreff
Created April 27, 2017 14:47
Show Gist options
  • Save badstreff/b35c4630d8513cb07864596b782943a3 to your computer and use it in GitHub Desktop.
Save badstreff/b35c4630d8513cb07864596b782943a3 to your computer and use it in GitHub Desktop.
let win_shell = (has('win32') || has('win64')) && &shellcmdflag =~ '/'
" if not on windows enable python2 and python3 support
if !win_shell
set pythonhome=$HOME/.pyenv/versions/2.7.11
set pythondll=$HOME/.pyenv/versions/2.7.11/lib/libpython2.7.dylib
set pythonthreehome=$HOME/.pyenv/versions/3.6.0
set pythonthreedll=$HOME/.pyenv/versions/3.6.0/lib/libpython3.6m.dylib
let g:python2_host_prog = '/usr/local/bin/python'
let g:python3_host_prog = '/usr/local/bin/python3'
endif
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
let vimDir = win_shell ? '$HOME/vimfiles' : '$HOME/.vim'
let &runtimepath .= ',' . expand(vimDir . '/bundle/Vundle.vim')
call vundle#rc(expand(vimDir . '/bundle'))
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-surround'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'flazz/vim-colorschemes'
Plugin 'airblade/vim-gitgutter'
Plugin 'Valloric/YouCompleteMe'
Plugin 'klen/python-mode'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on
" map leader to comma
let mapleader = ","
" show line number on cursor
set number
" Configure colorscheme
set termguicolors
colorscheme greygull
" Configure python settings
let g:pymode_options_colorcolumn = 0
let g:pymode_rope_lookup_project = 0
let g:pymode_rope = 0
let g:pymode_python = 'python3'
let python_highlight_all=1
syntax on
" configure airline
" sping_night theme needs installed along with the Meslo powerline font
set laststatus=2
set ttimeoutlen=50
set guifont=Meslo\ LG\ S\ Regular\ for\ Powerline:h12
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme = 'light'
" configure NERDTree
autocmd vimenter * NERDTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
map <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" configure vsplit to be more natural
set splitright
set splitbelow
" split navigations 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>
" fast buffer switching binds from vim-unimpaired
map [b :bprevious<CR>
map ]b :bnext<CR>
" bind <space> for folding/unfolding a line
nnoremap <Space> za
" bind for quickly switching between buffers
nnoremap <leader>l :ls<CR>:b<space>
" highlight current line
set cursorline
" keep buffers open
set hidden
" configure backspace to work correctly in insert mode
set backspace=indent,eol,start
" enable mousewheel scrolling
set mouse=a
" I HAVE HAD ENOUGH OF THESE F*CKING SWAP FILES
set nobackup
set nowritebackup
set noswapfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment