Skip to content

Instantly share code, notes, and snippets.

@drobati
Created November 6, 2014 23:16
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 drobati/d966f8037d6a05b9bb7f to your computer and use it in GitHub Desktop.
Save drobati/d966f8037d6a05b9bb7f to your computer and use it in GitHub Desktop.
" -----
" VIMRC
" -----
scriptencoding utf-8
" Setup Vundle
call plug#begin('~/.vim/plugged')
" Manage Plugins
Plug 'gmarik/Vundle.vim'
Plug 'myusuf3/numbers.vim'
Plug 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
Plug 'mfukar/robotframework-vim'
Plug 'Lokaltog/vim-easymotion'
Plug 'sjl/gundo.vim'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'mattn/webapi-vim'
Plug 'mattn/gist-vim' " Depends on webapi-vim
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'tpope/vim-surround'
Plug 'scrooloose/syntastic'
Plug 'majutsushi/tagbar'
Plug 'jmcantrell/vim-virtualenv'
" End Setup of Vundle
call plug#end()
filetype plugin indent on
syntax enable
" GUI
set guioptions-=r
set guioptions-=m
set guioptions-=L
set guioptions-=T
set number
set colorcolumn=81
set textwidth=80
set visualbell
set list listchars=tab:▸\ ,trail:·,extends:»,precedes:«
set columns=81 " Set width of floating window.
set lines=67 " Set height of floating window.
set cmdheight=1 " Set command window to hieght of 1.
" Indentation
set expandtab
set tabstop=4
set shiftwidth=4
set nowrap
set smartindent
set autoindent
set nosmarttab
" Search
set incsearch
set hlsearch
set ignorecase
" Behaviors
set backspace=2 " delete over linebreaks
set whichwrap+=<,>,h,l,[,] " movements over linebreaks
set report=0 " count lines yanked/deleted
let g:mapleader = ","
set foldmethod=indent " fold based on indent
set nofoldenable " don't fold by default
set foldlevel=1 " only close/open one foldlevel at a time
augroup view
autocmd BufWinLeave * silent! mkview " save view when closing buffer
autocmd BufWinEnter * silent! loadview " load view when opening buffer
augroup END
" Change pwd to file location.
nnoremap ,cd :cd %:p:h<CR>:pwd<CR>
" Move visual block
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv
" set working directory to file's path
nnoremap <silent> <m-p> :lprevious <CR>
nnoremap <silent> <m-n> :lnext <CR>
" Disable Swap Files
set nobackup " do not keep backups after close
set nowritebackup " do not keep a backup while working
set noswapfile " don't keep swp files either
" Store Backup Elsewhere
set backupdir=$HOME/.vim/backup " store backups under ~/.vim/backup
set backupcopy=yes " keep attributes of original file
set backupskip=/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*
set directory=~/.vim/swap,~/tmp,. " keep swp files under ~/.vim/swap
" Powerline
set laststatus=2
set rtp+=/home/drobati/.local/lib/python2.7/site-packages/powerline/bindings/vim
" Style
set t_Co=256 " XTerm 256 color support.
if has('gui_running')
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 14
colorscheme Tomorrow-Night
else
colorscheme Tomorrow-Night
endif
" -------------------------
" LANGUAGE SPECIFIC OPTIONS
" -------------------------
" C++
set tags=./tags;/
" Python
" -----------------------
" PLUGIN SPECIFIC OPTIONS
" -----------------------
" EasyMotion
let g:EasyMotion_do_mapping = 0 " Disable default mappings
nmap s <Plug>(easymotion-bd-w)
nmap t <Plug>(easymotion-t2)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
let g:EasyMotion_smartcase = 1 " type `l` and match `l`&`L`
let g:EasyMotion_use_smartsign_us = 1 " type `3` and match `3`&`#`
" Gist
"" sudo apt-get install xclip
let g:gist_clip_command = 'xclip -selection clipboard'
let g:gist_detect_filetype = 1
let g:gist_open_browser_after_post = 1
let g:gist_browser_command = 'firefox %URL%'
let g:gist_show_privates = 1
let g:gist_post_private = 1
" Syntastic
let g:syntastic_check_on_open = 1
let g:syntastic_error_symbol = 'X'
let g:syntastic_warning_symbol = '!'
let g:syntastic_auto_loc_list = 2
let g:syntastic_loc_list_height = 5
" Fugitive
nnoremap <leader>gs :Gstatus<cr>
" Tagbar
nnoremap <F8> :TagbarToggle<CR>
" Gundo
nnoremap <F5> :GundoToggle<CR>
" Ultisnips
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
let g:UltiSnipsEditSplit = "vertical"
let g:ultisnips_python_style = "google"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment