2014-03-19 01:53:22 -07:00
|
|
|
|
set nocompatible " required
|
|
|
|
|
|
filetype off " required
|
|
|
|
|
|
|
|
|
|
|
|
"""" VUNDLE
|
|
|
|
|
|
" set the runtime path to include Vundle and initialize
|
|
|
|
|
|
set rtp+=~/.vim/bundle/vundle/
|
|
|
|
|
|
call vundle#rc()
|
|
|
|
|
|
" alternatively, pass a path where Vundle should install bundles
|
|
|
|
|
|
"let path = '~/some/path/here'
|
|
|
|
|
|
"call vundle#rc(path)
|
|
|
|
|
|
|
|
|
|
|
|
" let Vundle manage Vundle, required
|
|
|
|
|
|
Bundle 'gmarik/vundle'
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-19 02:55:07 -07:00
|
|
|
|
Bundle 'Lokaltog/vim-easymotion'
|
2014-03-19 01:53:22 -07:00
|
|
|
|
Bundle 'tpope/vim-sensible'
|
|
|
|
|
|
Bundle 'tpope/vim-eunuch'
|
2014-03-19 11:30:44 -07:00
|
|
|
|
Bundle 'tpope/vim-fugitive'
|
2014-03-19 01:53:22 -07:00
|
|
|
|
Bundle 'scrooloose/nerdtree'
|
|
|
|
|
|
Bundle 'tomtom/tcomment_vim'
|
|
|
|
|
|
Bundle 'tpope/vim-characterize'
|
|
|
|
|
|
Bundle 'klen/python-mode'
|
|
|
|
|
|
Bundle 'jonathanfilip/vim-lucius'
|
2014-04-24 18:22:51 -07:00
|
|
|
|
Bundle 'nanotech/jellybeans.vim'
|
2014-03-19 01:53:22 -07:00
|
|
|
|
Bundle 'majutsushi/tagbar'
|
2014-04-24 18:22:51 -07:00
|
|
|
|
Bundle 'bling/vim-bufferline'
|
2014-03-19 01:53:22 -07:00
|
|
|
|
Bundle 'sjl/gundo.vim'
|
|
|
|
|
|
Bundle 'SirVer/ultisnips'
|
|
|
|
|
|
Bundle 'kien/ctrlp.vim'
|
|
|
|
|
|
Bundle 'terryma/vim-multiple-cursors'
|
|
|
|
|
|
Bundle 'myusuf3/numbers.vim'
|
2014-04-24 18:05:49 -07:00
|
|
|
|
Bundle 'mhinz/vim-signify'
|
2014-03-19 01:53:22 -07:00
|
|
|
|
Bundle 'nathanaelkane/vim-indent-guides'
|
|
|
|
|
|
Bundle 'maxbrunsfeld/vim-yankstack'
|
|
|
|
|
|
Bundle 'tpope/vim-surround'
|
|
|
|
|
|
Bundle 'scrooloose/syntastic'
|
|
|
|
|
|
Bundle 'Valloric/YouCompleteMe'
|
2014-03-21 16:59:55 -07:00
|
|
|
|
Bundle 'christoomey/vim-tmux-navigator'
|
2014-03-19 01:53:22 -07:00
|
|
|
|
|
|
|
|
|
|
filetype plugin indent on " required
|
|
|
|
|
|
""" end vundle
|
2014-03-18 18:50:15 -07:00
|
|
|
|
|
|
|
|
|
|
"""" PLUGIN SETTINGS
|
|
|
|
|
|
|
2014-01-26 04:37:11 -08:00
|
|
|
|
""" Python-Mode settings
|
2014-03-18 18:50:15 -07:00
|
|
|
|
let g:pymode_lint = 0
|
|
|
|
|
|
let g:pymode_lint_checker = "pyflakes"
|
2014-01-26 04:37:11 -08:00
|
|
|
|
|
2014-03-18 18:50:15 -07:00
|
|
|
|
" don't complete with rope
|
|
|
|
|
|
let g:pymode_rope_completion = 0
|
2014-03-19 10:02:56 -07:00
|
|
|
|
let g:pymode_rope_autoimport = 0
|
|
|
|
|
|
|
|
|
|
|
|
" don't usually care about documentation
|
|
|
|
|
|
let g:pymode_rope_lookup_project = 0
|
|
|
|
|
|
|
|
|
|
|
|
" better definition keybind
|
|
|
|
|
|
let g:pymode_rope_goto_definition_bind = 'K'
|
2014-01-26 04:37:11 -08:00
|
|
|
|
|
2014-01-27 12:53:00 -08:00
|
|
|
|
let g:pymode_breakpoint_cmd = 'import ipdb;ipdb.set_trace() # FIXME: breakpoint!'
|
2014-01-26 04:37:11 -08:00
|
|
|
|
|
|
|
|
|
|
" syntax highlighting
|
|
|
|
|
|
let g:pymode_syntax = 1
|
|
|
|
|
|
let g:pymode_syntax_all = 1
|
|
|
|
|
|
let g:pymode_syntax_indent_errors = g:pymode_syntax_all
|
|
|
|
|
|
let g:pymode_syntax_space_errors = g:pymode_syntax_all
|
|
|
|
|
|
|
2014-03-18 18:50:15 -07:00
|
|
|
|
" don't autofold code
|
2014-01-26 04:37:11 -08:00
|
|
|
|
let g:pymode_folding = 0
|
|
|
|
|
|
""" End Python-Mode settings
|
2013-08-01 19:40:59 -07:00
|
|
|
|
|
2014-03-18 18:50:15 -07:00
|
|
|
|
" Syntastic
|
2014-03-18 21:20:35 -07:00
|
|
|
|
let g:syntastic_python_checkers = ['pyflakes', 'pep8', 'pep257']
|
2014-03-18 18:50:15 -07:00
|
|
|
|
|
|
|
|
|
|
" Powerline!
|
|
|
|
|
|
set rtp+=~/dotfiles/misc-files/powerline/powerline/bindings/vim
|
|
|
|
|
|
"
|
|
|
|
|
|
""" Easymotion
|
|
|
|
|
|
map / <Plug>(easymotion-sn)
|
2014-03-21 11:47:42 -07:00
|
|
|
|
omap / <Plug>(easymotion-tn)
|
2014-03-18 18:50:15 -07:00
|
|
|
|
map n <Plug>(easymotion-next)
|
|
|
|
|
|
map N <Plug>(easymotion-prev)
|
2014-03-18 21:20:35 -07:00
|
|
|
|
let g:EasyMotion_landing_highlight = 1
|
2014-03-18 18:50:15 -07:00
|
|
|
|
""" CtrlP
|
|
|
|
|
|
|
|
|
|
|
|
""" Gundo
|
|
|
|
|
|
map <leader>u :GundoToggle<CR>
|
|
|
|
|
|
|
|
|
|
|
|
"""" END PLUGIN SETTINGS
|
|
|
|
|
|
|
2013-08-02 04:13:40 -07:00
|
|
|
|
let mapleader=","
|
|
|
|
|
|
set nobackup
|
|
|
|
|
|
set noswapfile
|
|
|
|
|
|
set pastetoggle=<F2>
|
|
|
|
|
|
|
2014-01-27 12:53:00 -08:00
|
|
|
|
filetype on
|
2013-08-01 19:22:01 -07:00
|
|
|
|
filetype plugin indent on
|
2013-08-01 19:40:59 -07:00
|
|
|
|
syntax on
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
2014-05-27 05:46:46 +00:00
|
|
|
|
try
|
|
|
|
|
|
colorscheme lucius
|
|
|
|
|
|
catch
|
|
|
|
|
|
" deal with it
|
|
|
|
|
|
endtry
|
2014-03-13 16:40:13 -07:00
|
|
|
|
|
2013-08-01 20:07:12 -07:00
|
|
|
|
set t_Co=256
|
|
|
|
|
|
if &term =~ 'xterm-color'
|
|
|
|
|
|
set t_ut=
|
|
|
|
|
|
endif
|
2013-08-02 01:46:36 -07:00
|
|
|
|
let g:Powerline_symbols = 'fancy'
|
|
|
|
|
|
set nocompatible
|
|
|
|
|
|
set laststatus=2
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
2013-08-02 03:37:04 -07:00
|
|
|
|
if v:version >= 703
|
|
|
|
|
|
"undo settings
|
|
|
|
|
|
set undodir=~/.vim/undofiles
|
|
|
|
|
|
set undofile
|
|
|
|
|
|
|
|
|
|
|
|
set colorcolumn=+1 "mark the ideal max text width
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
2013-08-02 03:37:04 -07:00
|
|
|
|
set showmode
|
2013-08-01 20:07:12 -07:00
|
|
|
|
set number
|
|
|
|
|
|
set numberwidth=1
|
|
|
|
|
|
set background=dark
|
|
|
|
|
|
set cursorline
|
|
|
|
|
|
set cursorcolumn
|
|
|
|
|
|
set ruler
|
2014-03-13 16:40:13 -07:00
|
|
|
|
" do not redraw while macroing
|
|
|
|
|
|
set lazyredraw
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
|
|
|
|
|
set matchpairs+=<:>
|
|
|
|
|
|
|
|
|
|
|
|
set list
|
2013-08-02 11:26:14 -07:00
|
|
|
|
set listchars=tab:>-,trail:-,extends:>,precedes:<,nbsp:+,eol:$
|
2014-04-24 18:08:10 -07:00
|
|
|
|
set ts=4
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
2014-03-13 16:40:13 -07:00
|
|
|
|
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
|
|
|
|
|
|
set clipboard=unnamed
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
|
|
|
|
|
""" Searching and Patterns
|
|
|
|
|
|
set ignorecase
|
|
|
|
|
|
set smartcase
|
|
|
|
|
|
set smarttab
|
|
|
|
|
|
set hlsearch
|
2014-03-13 16:40:13 -07:00
|
|
|
|
" Add the g flag to search/replace by default
|
|
|
|
|
|
set gdefault
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
2013-08-02 03:37:04 -07:00
|
|
|
|
""" Folding
|
|
|
|
|
|
set nofoldenable
|
|
|
|
|
|
|
|
|
|
|
|
"recalculate the trailing whitespace warning when idle, and after saving
|
|
|
|
|
|
autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning
|
|
|
|
|
|
|
|
|
|
|
|
"return '[\s]' if trailing white space is detected return '' otherwise
|
|
|
|
|
|
function! StatuslineTrailingSpaceWarning()
|
|
|
|
|
|
if !exists("b:statusline_trailing_space_warning")
|
|
|
|
|
|
|
|
|
|
|
|
if !&modifiable
|
|
|
|
|
|
let b:statusline_trailing_space_warning = ''
|
|
|
|
|
|
return b:statusline_trailing_space_warning
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if search('\s\+$', 'nw') != 0
|
|
|
|
|
|
let b:statusline_trailing_space_warning = '[\s]'
|
|
|
|
|
|
else
|
|
|
|
|
|
let b:statusline_trailing_space_warning = ''
|
|
|
|
|
|
endif
|
|
|
|
|
|
endif
|
|
|
|
|
|
return b:statusline_trailing_space_warning
|
|
|
|
|
|
endfunction
|
2013-08-01 20:07:12 -07:00
|
|
|
|
|
2013-08-02 01:46:36 -07:00
|
|
|
|
|
2013-08-01 20:07:12 -07:00
|
|
|
|
""" Handy remaps
|
2014-03-13 16:40:13 -07:00
|
|
|
|
noremap ; :
|
|
|
|
|
|
inoremap jj <Esc>
|
2013-08-01 20:13:27 -07:00
|
|
|
|
nnoremap <silent> <F8> :TlistToggle<CR>
|
2013-08-02 03:37:04 -07:00
|
|
|
|
map <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
|
2014-03-13 16:40:13 -07:00
|
|
|
|
"nnoremap <leader>d :NERDTreeToggle<cr>
|
2014-01-27 12:53:00 -08:00
|
|
|
|
map \q :q<CR>
|
|
|
|
|
|
map \w :w<CR>
|
2014-03-18 18:50:15 -07:00
|
|
|
|
noremap Q <nop>
|
2013-08-02 04:13:40 -07:00
|
|
|
|
|
2014-03-13 16:40:13 -07:00
|
|
|
|
" Don’t reset cursor to start of line when moving around.
|
|
|
|
|
|
set nostartofline
|
|
|
|
|
|
" minimal number of lines to keep above/below cursorline
|
|
|
|
|
|
set scrolloff=10
|
2013-08-02 04:13:40 -07:00
|
|
|
|
|
2013-08-01 20:07:12 -07:00
|
|
|
|
""" Use the mouse
|
|
|
|
|
|
set mouse=a
|
|
|
|
|
|
|
2014-03-18 18:50:15 -07:00
|
|
|
|
""" smart path
|
|
|
|
|
|
set path=.,,**
|
2014-01-27 12:53:00 -08:00
|
|
|
|
"
|
2014-03-13 16:40:13 -07:00
|
|
|
|
" Don't use tabs in python files
|
|
|
|
|
|
autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4
|
|
|
|
|
|
|
|
|
|
|
|
command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>)
|
|
|
|
|
|
function! s:RunShellCommand(cmdline)
|
|
|
|
|
|
echo a:cmdline
|
|
|
|
|
|
let expanded_cmdline = a:cmdline
|
|
|
|
|
|
for part in split(a:cmdline, ' ')
|
|
|
|
|
|
if part[0] =~ '\v[%#<]'
|
|
|
|
|
|
let expanded_part = fnameescape(expand(part))
|
|
|
|
|
|
let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '')
|
|
|
|
|
|
endif
|
|
|
|
|
|
endfor
|
|
|
|
|
|
botright new
|
|
|
|
|
|
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
|
|
|
|
|
|
call setline(1, 'You entered: ' . a:cmdline)
|
|
|
|
|
|
call setline(2, 'Expanded Form: ' .expanded_cmdline)
|
|
|
|
|
|
call setline(3,substitute(getline(2),'.','=','g'))
|
|
|
|
|
|
execute '$read !'. expanded_cmdline
|
|
|
|
|
|
setlocal nomodifiable
|
|
|
|
|
|
1
|
|
|
|
|
|
endfunction
|
2014-03-21 11:47:42 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function! MoveToPrevTab()
|
|
|
|
|
|
"there is only one window
|
|
|
|
|
|
if tabpagenr('$') == 1 && winnr('$') == 1
|
|
|
|
|
|
return
|
|
|
|
|
|
endif
|
|
|
|
|
|
"preparing new window
|
|
|
|
|
|
let l:tab_nr = tabpagenr('$')
|
|
|
|
|
|
let l:cur_buf = bufnr('%')
|
|
|
|
|
|
if tabpagenr() != 1
|
|
|
|
|
|
close!
|
|
|
|
|
|
if l:tab_nr == tabpagenr('$')
|
|
|
|
|
|
tabprev
|
|
|
|
|
|
endif
|
|
|
|
|
|
sp
|
|
|
|
|
|
else
|
|
|
|
|
|
close!
|
|
|
|
|
|
exe "0tabnew"
|
|
|
|
|
|
endif
|
|
|
|
|
|
"opening current buffer in new window
|
|
|
|
|
|
exe "b".l:cur_buf
|
|
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
|
|
|
|
function! MoveToNextTab()
|
|
|
|
|
|
"there is only one window
|
|
|
|
|
|
if tabpagenr('$') == 1 && winnr('$') == 1
|
|
|
|
|
|
return
|
|
|
|
|
|
endif
|
|
|
|
|
|
"preparing new window
|
|
|
|
|
|
let l:tab_nr = tabpagenr('$')
|
|
|
|
|
|
let l:cur_buf = bufnr('%')
|
|
|
|
|
|
if tabpagenr() < tab_nr
|
|
|
|
|
|
close!
|
|
|
|
|
|
if l:tab_nr == tabpagenr('$')
|
|
|
|
|
|
tabnext
|
|
|
|
|
|
endif
|
|
|
|
|
|
sp
|
|
|
|
|
|
else
|
|
|
|
|
|
close!
|
|
|
|
|
|
tabnew
|
|
|
|
|
|
endif
|
|
|
|
|
|
"opening current buffer in new window
|
|
|
|
|
|
exe "b".l:cur_buf
|
|
|
|
|
|
endfunc
|
|
|
|
|
|
|
|
|
|
|
|
nnoremap <C-m> :call MoveToNextTab()<CR><C-w>H
|
|
|
|
|
|
nnoremap <C-n> :call MoveToPrevTab()<CR><C-w>H
|