Added new plugins and set up deoplete for python and C++
This commit is contained in:
+107
-20
@@ -1,13 +1,15 @@
|
||||
" Vim settings
|
||||
let g:python_host_prog='/usr/bin/python'
|
||||
|
||||
let g:python_host_prog='/Users/samuelperry/.pyenv/shims/python'
|
||||
let g:python3_host_prog = '/Users/samuelperry/.pyenv/shims/python3'
|
||||
filetype off " required
|
||||
|
||||
" set the runtime path to include Vundle and initialize
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
set rtp+=/usr/local/Cellar/fzf/HEAD
|
||||
call plug#begin()
|
||||
|
||||
function! DoRemote(arg)
|
||||
UpdateRemotePlugins
|
||||
endfunction
|
||||
" let Vundle manage Vundle, required
|
||||
" Plug 'Valloric/YouCompleteMe'
|
||||
Plug 'bling/vim-airline'
|
||||
@@ -39,8 +41,13 @@ Plug 'lervag/vimtex'
|
||||
Plug 'bjoernd/vim-ycm-tex'
|
||||
Plug 'mhinz/vim-startify'
|
||||
Plug 'Konfekt/FastFold'
|
||||
Plug 'Shougo/deoplete.nvim'
|
||||
" Plug 'benekastah/neomake'
|
||||
Plug 'Shougo/deoplete.nvim', { 'do': function('DoRemote') }
|
||||
Plug 'tpope/vim-dispatch'
|
||||
Plug 'zchee/deoplete-clang'
|
||||
Plug 'zchee/deoplete-jedi'
|
||||
Plug 'benekastah/neomake'
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
call plug#end() " required
|
||||
filetype on
|
||||
filetype plugin on
|
||||
@@ -115,16 +122,22 @@ set wildmenu
|
||||
set lazyredraw
|
||||
|
||||
" Set line wrap to 79 charachters.
|
||||
set tw=79
|
||||
" set tw=79
|
||||
|
||||
" Change directory to the directory of the current file.
|
||||
set autochdir
|
||||
|
||||
" ====================================
|
||||
" LaTeX Settings
|
||||
" ====================================
|
||||
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
|
||||
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
|
||||
" The following changes the default filetype back to 'tex':
|
||||
let g:tex_flavor='latex'
|
||||
let g:tex_conceal = ""
|
||||
|
||||
autocmd BufWritePost *.tex Dispatch! latexmk -pdf
|
||||
|
||||
" ====================================
|
||||
" Startify Settings
|
||||
" ====================================
|
||||
@@ -134,12 +147,12 @@ nnoremap <silent> <leader>m :Startify<CR>
|
||||
" ====================================
|
||||
" Neomake Settings
|
||||
" ====================================
|
||||
"set errorformat=%f:%l:%m
|
||||
"
|
||||
"if has('autocmd')
|
||||
" autocmd! BufWritePost * Neomake
|
||||
"endif
|
||||
"
|
||||
set errorformat=%f:%l:%m
|
||||
|
||||
if has('autocmd')
|
||||
autocmd! BufWritePost * Neomake
|
||||
endif
|
||||
|
||||
"let g:neomake_open_list = 2
|
||||
"
|
||||
"let g:neomake_python_enabled_makers = ['pep8', 'pylint']
|
||||
@@ -201,7 +214,6 @@ set background=dark
|
||||
let g:solarized_termcolors=16
|
||||
let g:solarized_visibility="high"
|
||||
set t_Co=16
|
||||
hi Visual term=reverse cterm=reverse guibg=Grey
|
||||
|
||||
" ====================================
|
||||
" NerdTree Settings
|
||||
@@ -357,7 +369,7 @@ function! ToggleErrors()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:syntastic_auto_loc_list = 0
|
||||
let g:syntastic_auto_loc_list = 0
|
||||
|
||||
" Run all checkers and then create list of errors rather than showing error
|
||||
" lists individually
|
||||
@@ -384,9 +396,25 @@ set pumheight=20"
|
||||
" ====================================
|
||||
" Use deoplete.
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
" Unsure what these do but things seem to work so not touching... took from here: https://github.com/zchee/deoplete-clang/issues/15
|
||||
set completeopt+=noinsert
|
||||
set completeopt-=preview
|
||||
let g:deoplete#enable_smart_case = 1
|
||||
let g:deoplete#auto_completion_start_length = 0
|
||||
let g:min_pattern_length = 0
|
||||
|
||||
" Allow navigation through auto-completions using tab.
|
||||
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
|
||||
|
||||
" Set paths to homebrew clang library and executable for deoplete clang
|
||||
let g:deoplete#sources#clang#libclang_path = "/usr/local/Cellar/llvm/HEAD/lib/libclang.dylib"
|
||||
let g:deoplete#sources#clang#clang_header = "/usr/local/Cellar/llvm/HEAD/lib/clang"
|
||||
|
||||
" Ensure buffer based completion is shown alongside plugin completions such as
|
||||
" clang or jedi.
|
||||
call deoplete#custom#set('buffer', 'rank', 9999)
|
||||
|
||||
" ====================================
|
||||
" YouCompleteMe Settings (Deprecated as of DeoPlete)
|
||||
" ====================================
|
||||
@@ -503,12 +531,12 @@ inoremap <C-l> <ESC>:wincmd l<CR>
|
||||
autocmd BufWinEnter,WinEnter term://* startinsert
|
||||
|
||||
" Window resizing mappings /*{{{*/
|
||||
if bufwinnr(1)
|
||||
noremap <silent> <S-H> :vertical resize +1<CR>
|
||||
noremap <silent> <S-L> :vertical resize -1<CR>
|
||||
noremap <silent> <S-J> :resize +1<CR>
|
||||
noremap <silent> <S-K> :resize -1<CR>
|
||||
endif
|
||||
" if bufwinnr(1)
|
||||
" noremap <silent> <S-H> :vertical resize +1<CR>
|
||||
" noremap <silent> <S-L> :vertical resize -1<CR>
|
||||
" noremap <silent> <S-J> :resize +1<CR>
|
||||
" noremap <silent> <S-K> :resize -1<CR>
|
||||
" endif
|
||||
|
||||
nmap <leader>r <C-w>R
|
||||
|
||||
@@ -546,3 +574,62 @@ nnoremap k gk
|
||||
" source ./vimrc.local
|
||||
"endif
|
||||
|
||||
|
||||
" Be aware of whether you are right or left vertical split
|
||||
" so you can use arrows more naturally.
|
||||
" Inspired by https://github.com/ethagnawl.
|
||||
function! g:IntelligentVerticalResize(direction) abort
|
||||
let l:window_resize_count = 5
|
||||
let l:current_window_is_last_window = (winnr() == winnr('$'))
|
||||
|
||||
if (a:direction ==# 'left')
|
||||
let [l:modifier_1, l:modifier_2] = ['+', '-']
|
||||
else
|
||||
let [l:modifier_1, l:modifier_2] = ['-', '+']
|
||||
endif
|
||||
|
||||
let l:modifier = l:current_window_is_last_window ? l:modifier_1 : l:modifier_2
|
||||
let l:command = 'vertical resize ' . l:modifier . l:window_resize_count . '<CR>'
|
||||
execute l:command
|
||||
endfunction
|
||||
|
||||
nnoremap <silent> <Right> :call IntelligentVerticalResize('right')<CR>
|
||||
nnoremap <silent> <Left> :call IntelligentVerticalResize('left')<CR>
|
||||
|
||||
" When switching colorscheme in terminal vim change the profile in iTerm as well.
|
||||
"if !has('gui_running')
|
||||
" function! s:change_iterm2_profile()
|
||||
" let dual_colorschemes = ["solarized"]
|
||||
" if exists('g:colors_name')
|
||||
" let profile = g:colors_name
|
||||
" if index(dual_colorschemes, g:colors_name) >= 0
|
||||
" let profile .= '_'.&background
|
||||
" endif
|
||||
" let escape = '\033]50;SetProfile='.profile.'\x7'
|
||||
" if exists('$TMUX')
|
||||
" let escape = '\033Ptmux;'.substitute(escape, '\\033', '\\033\\033', 'g').'\033\\'
|
||||
" endif
|
||||
" silent call system("printf '".escape."' > /dev/tty")
|
||||
" endif
|
||||
" endfunction
|
||||
"
|
||||
" autocmd VimEnter,ColorScheme * call s:change_iterm2_profile()
|
||||
"endif
|
||||
|
||||
" if $TERM_PROGRAM == 'iTerm.app'
|
||||
" if exists('$ITERM_PROFILE')
|
||||
" if ($ITERM_PROFILE == 'solarized_dark')
|
||||
" set t_Co=16
|
||||
" let g:solarized_termcolors=16
|
||||
" let g:solarized_termtrans=1
|
||||
" set background=dark
|
||||
" colorscheme solarized
|
||||
" elseif ($ITERM_PROFILE == 'solarized_light')
|
||||
" set t_Co=16
|
||||
" let g:solarized_termcolors=16
|
||||
" let g:solarized_termtrans=1
|
||||
" set background=light
|
||||
" colorscheme solarized
|
||||
" endif
|
||||
" endif
|
||||
" endif
|
||||
|
||||
Reference in New Issue
Block a user