From 695acf2d710a16a6793bb3f5b5ccee55c00f10a9 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 4 Jul 2018 11:54:15 -0400 Subject: [PATCH] added easymotion, indentline plugins --- files/.vim/vimrc | 138 ++++++++++++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 62 deletions(-) diff --git a/files/.vim/vimrc b/files/.vim/vimrc index 3c7f9bd..82546a2 100644 --- a/files/.vim/vimrc +++ b/files/.vim/vimrc @@ -3,6 +3,8 @@ set nocompatible syntax on " Line numbering set number +" Always show the signcolumn +set signcolumn=yes " highlight set cursorline " Encoding @@ -24,7 +26,7 @@ set ttimeoutlen=50 " Shut the annoying bell set novisualbell " Set the updatetime -set updatetime=750 +set updatetime=500 " Ignore case for ex command completion set smartcase nnoremap / /\C @@ -41,8 +43,8 @@ cmap w!! w !sudo tee % > /dev/null " Remember mouse cursor position augroup resCur - autocmd! - autocmd BufReadPost * call setpos(".", getpos("'\"")) + autocmd! + autocmd BufReadPost * call setpos(".", getpos("'\"")) augroup END " Plugins @@ -51,37 +53,39 @@ let pluginpath=$HOME.'/.vim/bundle' let &rtp.=','.deinpath if dein#load_state(pluginpath) - call dein#begin(pluginpath) + call dein#begin(pluginpath) - "call dein#add(deinpath) + "call dein#add(deinpath) - " Colorscheme - call dein#add('ajh17/Spacegray.vim.git') - - " Interface - call dein#add('itchyny/lightline.vim') - call dein#add('mgee/lightline-bufferline') - call dein#add('ryanoasis/vim-devicons') - call dein#add('airblade/vim-gitgutter') - call dein#add('christoomey/vim-tmux-navigator') - call dein#add('scrooloose/nerdtree') + " Colorscheme + call dein#add('ajh17/Spacegray.vim.git') - " Tools / Commands - call dein#add('tpope/vim-surround') - call dein#add('jiangmiao/auto-pairs') - call dein#add('tpope/vim-endwise') - call dein#add('chrisbra/unicode.vim') - call dein#add('ctrlpvim/ctrlp.vim') + " Interface + call dein#add('itchyny/lightline.vim') + call dein#add('mgee/lightline-bufferline') + call dein#add('ryanoasis/vim-devicons') + call dein#add('airblade/vim-gitgutter') + call dein#add('christoomey/vim-tmux-navigator') + call dein#add('scrooloose/nerdtree') + call dein#add('Yggdroot/indentLine') - " Linting / Completion - call dein#add('w0rp/ale') - call dein#add('maralla/completor.vim') + " Tools / Commands + call dein#add('tpope/vim-surround') + call dein#add('jiangmiao/auto-pairs') + call dein#add('tpope/vim-endwise') + call dein#add('chrisbra/unicode.vim') + call dein#add('ctrlpvim/ctrlp.vim') + call dein#add('easymotion/vim-easymotion') - " Language - call dein#add('sheerun/vim-polyglot') + " Linting / Completion + call dein#add('w0rp/ale') + call dein#add('maralla/completor.vim') - call dein#end() - call dein#save_state() + " Language + call dein#add('sheerun/vim-polyglot') + + call dein#end() + call dein#save_state() endif filetype plugin indent on @@ -94,9 +98,9 @@ endif " Completor " TAB to choose completion -inoremap pumvisible() ? '\' : '\' -inoremap pumvisible() ? '\' : '\' -"inoremap pumvisible() ? '\\' : '\' +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\\" : "\" let g:completor_python_binary = '/usr/bin/python' let g:completor_node_binary = '/usr/bin/node' let g:completor_clang_binary = '/usr/bin/clang' @@ -124,14 +128,25 @@ function! CtrlPStatusFunc_2(str) return lightline#statusline(0) endfunction +" easymotion +map (easymotion-prefix) + " gitgutter let g:gitgutter_realtime = 1 let g:gitgutter_eager = 0 -let g:gitgutter_sign_added = '' -let g:gitgutter_sign_modified = '' -let g:gitgutter_sign_removed = '' -let g:gitgutter_sign_removed_first_line = '' -let g:gitgutter_sign_modified_removed = '' +let g:gitgutter_grep = 'rg' +let g:gitgutter_sign_added = '+▐' +let g:gitgutter_sign_modified = '␢▐' +let g:gitgutter_sign_removed = '-▐' +let g:gitgutter_sign_removed_first_line = '-▐' +let g:gitgutter_sign_modified_removed = '␢▐' + +" indentLine +let g:indentLine_faster = 1 +let g:indentLine_color_term = 237 +let g:indentLine_leadingSpaceEnabled = 1 +let g:indentLine_char = '┆' +let g:indentLine_leadingSpaceChar = '·' " lightline set noshowmode @@ -176,49 +191,49 @@ let g:lightline.component_expand = {'buffers': 'lightline#bufferline#buffers'} let g:lightline.component_type = {'buffers': 'tabsel'} function! LightlineFilename() - let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]' - let modified = &modified ? ' +' : '' - return filename . modified + let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]' + let modified = &modified ? ' +' : '' + return filename . modified endfunction function! CtrlPMark() - if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item') - call lightline#link('iR'[g:lightline.ctrlp_regex]) - return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item - \ , g:lightline.ctrlp_next], 0) - else - return '' - endif + if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item') + call lightline#link('iR'[g:lightline.ctrlp_regex]) + return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item + \ , g:lightline.ctrlp_next], 0) + else + return '' + endif endfunction function! LightlineLinterWarnings() abort - let l:counts = ale#statusline#Count(bufnr('')) - let l:all_errors = l:counts.error + l:counts.style_error - let l:all_non_errors = l:counts.total - l:all_errors - return l:counts.total == 0 ? '' : printf('%d ', all_non_errors) + let l:counts = ale#statusline#Count(bufnr('')) + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + return l:counts.total == 0 ? '' : printf('%d ', all_non_errors) endfunction function! LightlineLinterErrors() abort - let l:counts = ale#statusline#Count(bufnr('')) - let l:all_errors = l:counts.error + l:counts.style_error - let l:all_non_errors = l:counts.total - l:all_errors - return l:counts.total == 0 ? '' : printf('%d ', all_errors) + let l:counts = ale#statusline#Count(bufnr('')) + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + return l:counts.total == 0 ? '' : printf('%d ', all_errors) endfunction function! LightlineLinterOK() abort - let l:counts = ale#statusline#Count(bufnr('')) - let l:all_errors = l:counts.error + l:counts.style_error - let l:all_non_errors = l:counts.total - l:all_errors - return l:counts.total == 0 ? '0 ' : '' + let l:counts = ale#statusline#Count(bufnr('')) + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors + return l:counts.total == 0 ? '0 ' : '' endfunction autocmd User ALELint call s:MaybeUpdateLightline() " Update and show lightline but only if it's visible (e.g., not in Goyo) function! s:MaybeUpdateLightline() - if exists('#lightline') - call lightline#update() - end + if exists('#lightline') + call lightline#update() + end endfunction " Color scheme @@ -236,4 +251,3 @@ hi Normal ctermbg=NONE highlight Comment cterm=italic set t_ZH= set t_ZR= -