added easymotion, indentline plugins
This commit is contained in:
parent
3e9e02732f
commit
695acf2d71
138
files/.vim/vimrc
138
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 <expr> <Tab> pumvisible() ? '\<C-n>' : '\<Tab>'
|
||||
inoremap <expr> <S-Tab> pumvisible() ? '\<C-p>' : '\<S-Tab>'
|
||||
"inoremap <expr> <cr> pumvisible() ? '\<C-y>\<cr>' : '\<cr>'
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
"inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>"
|
||||
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 <Leader> <Plug>(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=[3m
|
||||
set t_ZR=[23m
|
||||
|
||||
|
|
Loading…
Reference in New Issue