added easymotion, indentline plugins
This commit is contained in:
parent
3e9e02732f
commit
695acf2d71
136
files/.vim/vimrc
136
files/.vim/vimrc
|
@ -3,6 +3,8 @@ set nocompatible
|
||||||
syntax on
|
syntax on
|
||||||
" Line numbering
|
" Line numbering
|
||||||
set number
|
set number
|
||||||
|
" Always show the signcolumn
|
||||||
|
set signcolumn=yes
|
||||||
" highlight
|
" highlight
|
||||||
set cursorline
|
set cursorline
|
||||||
" Encoding
|
" Encoding
|
||||||
|
@ -24,7 +26,7 @@ set ttimeoutlen=50
|
||||||
" Shut the annoying bell
|
" Shut the annoying bell
|
||||||
set novisualbell
|
set novisualbell
|
||||||
" Set the updatetime
|
" Set the updatetime
|
||||||
set updatetime=750
|
set updatetime=500
|
||||||
" Ignore case for ex command completion
|
" Ignore case for ex command completion
|
||||||
set smartcase
|
set smartcase
|
||||||
nnoremap / /\C
|
nnoremap / /\C
|
||||||
|
@ -41,8 +43,8 @@ cmap w!! w !sudo tee % > /dev/null
|
||||||
|
|
||||||
" Remember mouse cursor position
|
" Remember mouse cursor position
|
||||||
augroup resCur
|
augroup resCur
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufReadPost * call setpos(".", getpos("'\""))
|
autocmd BufReadPost * call setpos(".", getpos("'\""))
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Plugins
|
" Plugins
|
||||||
|
@ -51,37 +53,39 @@ let pluginpath=$HOME.'/.vim/bundle'
|
||||||
let &rtp.=','.deinpath
|
let &rtp.=','.deinpath
|
||||||
|
|
||||||
if dein#load_state(pluginpath)
|
if dein#load_state(pluginpath)
|
||||||
call dein#begin(pluginpath)
|
call dein#begin(pluginpath)
|
||||||
|
|
||||||
"call dein#add(deinpath)
|
"call dein#add(deinpath)
|
||||||
|
|
||||||
" Colorscheme
|
" Colorscheme
|
||||||
call dein#add('ajh17/Spacegray.vim.git')
|
call dein#add('ajh17/Spacegray.vim.git')
|
||||||
|
|
||||||
" Interface
|
" Interface
|
||||||
call dein#add('itchyny/lightline.vim')
|
call dein#add('itchyny/lightline.vim')
|
||||||
call dein#add('mgee/lightline-bufferline')
|
call dein#add('mgee/lightline-bufferline')
|
||||||
call dein#add('ryanoasis/vim-devicons')
|
call dein#add('ryanoasis/vim-devicons')
|
||||||
call dein#add('airblade/vim-gitgutter')
|
call dein#add('airblade/vim-gitgutter')
|
||||||
call dein#add('christoomey/vim-tmux-navigator')
|
call dein#add('christoomey/vim-tmux-navigator')
|
||||||
call dein#add('scrooloose/nerdtree')
|
call dein#add('scrooloose/nerdtree')
|
||||||
|
call dein#add('Yggdroot/indentLine')
|
||||||
|
|
||||||
" Tools / Commands
|
" Tools / Commands
|
||||||
call dein#add('tpope/vim-surround')
|
call dein#add('tpope/vim-surround')
|
||||||
call dein#add('jiangmiao/auto-pairs')
|
call dein#add('jiangmiao/auto-pairs')
|
||||||
call dein#add('tpope/vim-endwise')
|
call dein#add('tpope/vim-endwise')
|
||||||
call dein#add('chrisbra/unicode.vim')
|
call dein#add('chrisbra/unicode.vim')
|
||||||
call dein#add('ctrlpvim/ctrlp.vim')
|
call dein#add('ctrlpvim/ctrlp.vim')
|
||||||
|
call dein#add('easymotion/vim-easymotion')
|
||||||
|
|
||||||
" Linting / Completion
|
" Linting / Completion
|
||||||
call dein#add('w0rp/ale')
|
call dein#add('w0rp/ale')
|
||||||
call dein#add('maralla/completor.vim')
|
call dein#add('maralla/completor.vim')
|
||||||
|
|
||||||
" Language
|
" Language
|
||||||
call dein#add('sheerun/vim-polyglot')
|
call dein#add('sheerun/vim-polyglot')
|
||||||
|
|
||||||
call dein#end()
|
call dein#end()
|
||||||
call dein#save_state()
|
call dein#save_state()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
@ -94,9 +98,9 @@ endif
|
||||||
|
|
||||||
" Completor
|
" Completor
|
||||||
" TAB to choose completion
|
" TAB to choose completion
|
||||||
inoremap <expr> <Tab> pumvisible() ? '\<C-n>' : '\<Tab>'
|
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
inoremap <expr> <S-Tab> pumvisible() ? '\<C-p>' : '\<S-Tab>'
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||||
"inoremap <expr> <cr> pumvisible() ? '\<C-y>\<cr>' : '\<cr>'
|
"inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>"
|
||||||
let g:completor_python_binary = '/usr/bin/python'
|
let g:completor_python_binary = '/usr/bin/python'
|
||||||
let g:completor_node_binary = '/usr/bin/node'
|
let g:completor_node_binary = '/usr/bin/node'
|
||||||
let g:completor_clang_binary = '/usr/bin/clang'
|
let g:completor_clang_binary = '/usr/bin/clang'
|
||||||
|
@ -124,14 +128,25 @@ function! CtrlPStatusFunc_2(str)
|
||||||
return lightline#statusline(0)
|
return lightline#statusline(0)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" easymotion
|
||||||
|
map <Leader> <Plug>(easymotion-prefix)
|
||||||
|
|
||||||
" gitgutter
|
" gitgutter
|
||||||
let g:gitgutter_realtime = 1
|
let g:gitgutter_realtime = 1
|
||||||
let g:gitgutter_eager = 0
|
let g:gitgutter_eager = 0
|
||||||
let g:gitgutter_sign_added = ''
|
let g:gitgutter_grep = 'rg'
|
||||||
let g:gitgutter_sign_modified = ''
|
let g:gitgutter_sign_added = '+▐'
|
||||||
let g:gitgutter_sign_removed = ''
|
let g:gitgutter_sign_modified = '␢▐'
|
||||||
let g:gitgutter_sign_removed_first_line = ''
|
let g:gitgutter_sign_removed = '-▐'
|
||||||
let g:gitgutter_sign_modified_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
|
" lightline
|
||||||
set noshowmode
|
set noshowmode
|
||||||
|
@ -176,49 +191,49 @@ let g:lightline.component_expand = {'buffers': 'lightline#bufferline#buffers'}
|
||||||
let g:lightline.component_type = {'buffers': 'tabsel'}
|
let g:lightline.component_type = {'buffers': 'tabsel'}
|
||||||
|
|
||||||
function! LightlineFilename()
|
function! LightlineFilename()
|
||||||
let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]'
|
let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]'
|
||||||
let modified = &modified ? ' +' : ''
|
let modified = &modified ? ' +' : ''
|
||||||
return filename . modified
|
return filename . modified
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! CtrlPMark()
|
function! CtrlPMark()
|
||||||
if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item')
|
if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item')
|
||||||
call lightline#link('iR'[g:lightline.ctrlp_regex])
|
call lightline#link('iR'[g:lightline.ctrlp_regex])
|
||||||
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
|
return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
|
||||||
\ , g:lightline.ctrlp_next], 0)
|
\ , g:lightline.ctrlp_next], 0)
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightlineLinterWarnings() abort
|
function! LightlineLinterWarnings() abort
|
||||||
let l:counts = ale#statusline#Count(bufnr(''))
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
let l:all_errors = l:counts.error + l:counts.style_error
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
let l:all_non_errors = l:counts.total - l:all_errors
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
return l:counts.total == 0 ? '' : printf('%d ', all_non_errors)
|
return l:counts.total == 0 ? '' : printf('%d ', all_non_errors)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightlineLinterErrors() abort
|
function! LightlineLinterErrors() abort
|
||||||
let l:counts = ale#statusline#Count(bufnr(''))
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
let l:all_errors = l:counts.error + l:counts.style_error
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
let l:all_non_errors = l:counts.total - l:all_errors
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
return l:counts.total == 0 ? '' : printf('%d ', all_errors)
|
return l:counts.total == 0 ? '' : printf('%d ', all_errors)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightlineLinterOK() abort
|
function! LightlineLinterOK() abort
|
||||||
let l:counts = ale#statusline#Count(bufnr(''))
|
let l:counts = ale#statusline#Count(bufnr(''))
|
||||||
let l:all_errors = l:counts.error + l:counts.style_error
|
let l:all_errors = l:counts.error + l:counts.style_error
|
||||||
let l:all_non_errors = l:counts.total - l:all_errors
|
let l:all_non_errors = l:counts.total - l:all_errors
|
||||||
return l:counts.total == 0 ? '0 ' : ''
|
return l:counts.total == 0 ? '0 ' : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
autocmd User ALELint call s:MaybeUpdateLightline()
|
autocmd User ALELint call s:MaybeUpdateLightline()
|
||||||
|
|
||||||
" Update and show lightline but only if it's visible (e.g., not in Goyo)
|
" Update and show lightline but only if it's visible (e.g., not in Goyo)
|
||||||
function! s:MaybeUpdateLightline()
|
function! s:MaybeUpdateLightline()
|
||||||
if exists('#lightline')
|
if exists('#lightline')
|
||||||
call lightline#update()
|
call lightline#update()
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Color scheme
|
" Color scheme
|
||||||
|
@ -236,4 +251,3 @@ hi Normal ctermbg=NONE
|
||||||
highlight Comment cterm=italic
|
highlight Comment cterm=italic
|
||||||
set t_ZH=[3m
|
set t_ZH=[3m
|
||||||
set t_ZR=[23m
|
set t_ZR=[23m
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue