111 lines
3.4 KiB
Plaintext
111 lines
3.4 KiB
Plaintext
set nocompatible " be iMproved, required
|
|
filetype off " required
|
|
|
|
nnoremap <Space> <Nop>
|
|
let mapleader="\<Space>"
|
|
let g:mapleader="\<Space>"
|
|
|
|
" 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'
|
|
|
|
" The following are examples of different formats supported.
|
|
" Keep Plugin commands between vundle#begin/end.
|
|
" plugin on GitHub repo
|
|
" plugin from http://vim-scripts.org/vim/scripts.html
|
|
Plugin 'tmhedberg/SimpylFold'
|
|
Plugin 'rizzatti/dash.vim'
|
|
Plugin 'vimwiki/vimwiki'
|
|
Plugin 'mattn/calendar-vim'
|
|
Plugin 'kien/ctrlp.vim'
|
|
Plugin 'octol/vim-cpp-enhanced-highlight'
|
|
Plugin 'mattn/emmet-vim'
|
|
Plugin 'tpope/vim-surround'
|
|
|
|
" All of your Plugins must be added before the following line
|
|
call vundle#end() " required
|
|
filetype plugin indent on " required
|
|
" To ignore plugin indent changes, instead use:
|
|
"filetype plugin on
|
|
"
|
|
" Brief help
|
|
" :PluginList - lists configured plugins
|
|
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
|
|
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
|
|
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
|
|
"
|
|
" see :h vundle for more details or wiki for FAQ
|
|
" Put your non-Plugin stuff after this line
|
|
|
|
" Allows YouCompleteMe to play nice with UltiSnips
|
|
function! g:UltiSnips_Complete()
|
|
call UltiSnips#ExpandSnippet()
|
|
if g:ulti_expand_res == 0
|
|
if pumvisible()
|
|
return "\<C-n>"
|
|
else
|
|
call UltiSnips#JumpForwards()
|
|
if g:ulti_jump_forwards_res == 0
|
|
return "\<TAB>"
|
|
endif
|
|
endif
|
|
endif
|
|
return ""
|
|
endfunction
|
|
|
|
let g:UltiSnipsExpandTrigger="<c-x>"
|
|
au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
|
|
let g:UltiSnipsJumpForwardTrigger="<tab>"
|
|
let g:UltiSnipsListSnippets="<c-e>"
|
|
" this mapping Enter key to <C-y> to chose the current highlight item
|
|
" and close the selection list, same as other IDEs.
|
|
" CONFLICT with some plugins like tpope/Endwise
|
|
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
|
|
|
"SimpylFold Config
|
|
let g:SimpylFold_docstring_preview=1
|
|
|
|
"CtrlP config
|
|
let g:ctrlp_map = '<leader>f'
|
|
nmap <silent> <leader>b :CtrlPBuffer<CR>
|
|
nmap <silent> <leader>r :CtrlPMRU<CR>
|
|
|
|
"Ranger utility function
|
|
function! RangeChooser()
|
|
let temp = tempname()
|
|
" The option "--choosefiles" was added in ranger 1.5.1. Use the next line
|
|
" with ranger 1.4.2 through 1.5.0 instead.
|
|
"exec 'silent !ranger --choosefile=' . shellescape(temp)
|
|
exec 'silent !ranger --choosefiles=' . shellescape(temp)
|
|
if !filereadable(temp)
|
|
redraw!
|
|
" Nothing to read.
|
|
return
|
|
endif
|
|
let names = readfile(temp)
|
|
if empty(names)
|
|
redraw!
|
|
" Nothing to open.
|
|
return
|
|
endif
|
|
" Edit the first item.
|
|
exec 'tabe ' . fnameescape(names[0])
|
|
" Add any remaning items to the arg list/buffer list.
|
|
for name in names[1:]
|
|
exec 'argadd ' . fnameescape(name)
|
|
endfor
|
|
redraw!
|
|
endfunction
|
|
command! -bar RangerChooser call RangeChooser()
|
|
nnoremap <leader>o :<C-U>RangerChooser<CR>
|
|
|
|
let g:ycm_server_python_interpreter="/usr/local/bin/python2"
|
|
let g:ycm_confirm_extra_conf=0
|
|
|
|
let g:user_emmet_leader_key="<C-e>"
|