fix(vim): formatting
This commit is contained in:
@@ -173,9 +173,9 @@ autocmd BufReadPost * silent! normal! g`"zv
|
|||||||
" Filetype specific config
|
" Filetype specific config
|
||||||
autocmd FileType go setlocal noexpandtab
|
autocmd FileType go setlocal noexpandtab
|
||||||
autocmd FileType c,cpp
|
autocmd FileType c,cpp
|
||||||
\ setlocal tabstop=2 |
|
\ setlocal tabstop=2 |
|
||||||
\ setlocal softtabstop=2 |
|
\ setlocal softtabstop=2 |
|
||||||
\ setlocal shiftwidth=2
|
\ setlocal shiftwidth=2
|
||||||
autocmd FileType netrw nmap <buffer> <C-h> -
|
autocmd FileType netrw nmap <buffer> <C-h> -
|
||||||
autocmd FileType netrw nmap <buffer> <C-l> <CR>
|
autocmd FileType netrw nmap <buffer> <C-l> <CR>
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@ let g:undotree_DiffpanelHeight = 20
|
|||||||
let s:plug_file = expand('$HOME/.vim/autoload/plug.vim')
|
let s:plug_file = expand('$HOME/.vim/autoload/plug.vim')
|
||||||
if !filereadable(s:plug_file)
|
if !filereadable(s:plug_file)
|
||||||
silent execute '!curl -fkLo ' . s:plug_file ' --create-dirs'
|
silent execute '!curl -fkLo ' . s:plug_file ' --create-dirs'
|
||||||
\ ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
\ ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||||
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -331,32 +331,32 @@ Plug 'ryanoasis/vim-devicons'
|
|||||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||||
Plug 'mbbill/undotree'
|
Plug 'mbbill/undotree'
|
||||||
|
|
||||||
" Plug 'prabirshrestha/vim-lsp'
|
" Plug 'prabirshrestha/vim-lsp'
|
||||||
" Plug 'dense-analysis/ale'
|
" Plug 'dense-analysis/ale'
|
||||||
" Plug 'prabirshrestha/asyncomplete.vim'
|
" Plug 'prabirshrestha/asyncomplete.vim'
|
||||||
" Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
" Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||||
|
|
||||||
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
|
|
||||||
" Plug 'https://github.com/yegappan/lsp'
|
" Plug 'https://github.com/yegappan/lsp'
|
||||||
|
|
||||||
" Some notes:
|
" Some notes:
|
||||||
" * ALE doesn't support semantic highlighting
|
" * ALE doesn't support semantic highlighting
|
||||||
" * vim-lsp doesn't support clangd switch to header/source or request document
|
" * vim-lsp doesn't support clangd switch to header/source or request document
|
||||||
" highlight on cursor or request diagnostic float on cursor
|
" highlight on cursor or request diagnostic float on cursor
|
||||||
" * CoC flickers in C++/clangd when semanticTokens is enabled
|
" * CoC flickers in C++/clangd when semanticTokens is enabled
|
||||||
" * lsp slow loading new buffers
|
" * lsp slow loading new buffers
|
||||||
" * YouCompleteMe ??? haven't tried but supports semantic highlighting
|
" * YouCompleteMe ??? haven't tried but supports semantic highlighting
|
||||||
"
|
"
|
||||||
" To conclude, vim-lsp + asynccomplete + ALE seems to be the best stack.
|
" To conclude, vim-lsp + asynccomplete + ALE seems to be the best stack.
|
||||||
" Disabling LSP stuff for now.
|
" Disabling LSP stuff for now.
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" {{{2 Setup
|
" {{{2 Setup
|
||||||
" {{{3 Colorscheme
|
" {{{3 Colorscheme
|
||||||
|
|
||||||
silent! colorscheme onedark
|
silent! colorscheme onedark
|
||||||
|
|
||||||
" {{{3 GitGutter
|
" {{{3 GitGutter
|
||||||
|
|
||||||
function! s:SetupGitGutter()
|
function! s:SetupGitGutter()
|
||||||
@@ -367,29 +367,29 @@ function! s:SetupGitGutter()
|
|||||||
highlight GitGutterChange guifg=#4fa6ed
|
highlight GitGutterChange guifg=#4fa6ed
|
||||||
|
|
||||||
execute 'highlight default GitStatusAdd guifg='
|
execute 'highlight default GitStatusAdd guifg='
|
||||||
\ . synIDattr(synIDtrans(hlID('GitGutterAdd')), 'fg')
|
\ . synIDattr(synIDtrans(hlID('GitGutterAdd')), 'fg')
|
||||||
\ . ' guibg='
|
\ . ' guibg='
|
||||||
\ . synIDattr(synIDtrans(hlID('StatusLine')), 'bg')
|
\ . synIDattr(synIDtrans(hlID('StatusLine')), 'bg')
|
||||||
execute 'highlight GitStatusChange guifg='
|
execute 'highlight GitStatusChange guifg='
|
||||||
\ . synIDattr(synIDtrans(hlID('GitGutterChange')), 'fg')
|
\ . synIDattr(synIDtrans(hlID('GitGutterChange')), 'fg')
|
||||||
\ . ' guibg='
|
\ . ' guibg='
|
||||||
\ . synIDattr(synIDtrans(hlID('StatusLine')), 'bg')
|
\ . synIDattr(synIDtrans(hlID('StatusLine')), 'bg')
|
||||||
execute 'highlight GitStatusDelete guifg='
|
execute 'highlight GitStatusDelete guifg='
|
||||||
\ . synIDattr(synIDtrans(hlID('GitGutterDelete')), 'fg')
|
\ . synIDattr(synIDtrans(hlID('GitGutterDelete')), 'fg')
|
||||||
\ . ' guibg='
|
\ . ' guibg='
|
||||||
\ . synIDattr(synIDtrans(hlID('StatusLine')), 'bg')
|
\ . synIDattr(synIDtrans(hlID('StatusLine')), 'bg')
|
||||||
execute 'highlight default GitStatusAddNC guifg='
|
execute 'highlight default GitStatusAddNC guifg='
|
||||||
\ . synIDattr(synIDtrans(hlID('GitGutterAdd')), 'fg')
|
\ . synIDattr(synIDtrans(hlID('GitGutterAdd')), 'fg')
|
||||||
\ . ' guibg='
|
\ . ' guibg='
|
||||||
\ . synIDattr(synIDtrans(hlID('StatusLineNC')), 'bg')
|
\ . synIDattr(synIDtrans(hlID('StatusLineNC')), 'bg')
|
||||||
execute 'highlight GitStatusChangeNC guifg='
|
execute 'highlight GitStatusChangeNC guifg='
|
||||||
\ . synIDattr(synIDtrans(hlID('GitGutterChange')), 'fg')
|
\ . synIDattr(synIDtrans(hlID('GitGutterChange')), 'fg')
|
||||||
\ . ' guibg='
|
\ . ' guibg='
|
||||||
\ . synIDattr(synIDtrans(hlID('StatusLineNC')), 'bg')
|
\ . synIDattr(synIDtrans(hlID('StatusLineNC')), 'bg')
|
||||||
execute 'highlight GitStatusDeleteNC guifg='
|
execute 'highlight GitStatusDeleteNC guifg='
|
||||||
\ . synIDattr(synIDtrans(hlID('GitGutterDelete')), 'fg')
|
\ . synIDattr(synIDtrans(hlID('GitGutterDelete')), 'fg')
|
||||||
\ . ' guibg='
|
\ . ' guibg='
|
||||||
\ . synIDattr(synIDtrans(hlID('StatusLineNC')), 'bg')
|
\ . synIDattr(synIDtrans(hlID('StatusLineNC')), 'bg')
|
||||||
|
|
||||||
nmap ]g <Plug>(GitGutterNextHunk)
|
nmap ]g <Plug>(GitGutterNextHunk)
|
||||||
nmap [g <Plug>(GitGutterPrevHunk)
|
nmap [g <Plug>(GitGutterPrevHunk)
|
||||||
@@ -450,27 +450,27 @@ autocmd! FileType fzf tnoremap <buffer> <C-l> <CR>
|
|||||||
|
|
||||||
" To match exact, prefix word with `'`
|
" To match exact, prefix word with `'`
|
||||||
command! -bang -nargs=* Rg call fzf#vim#grep(
|
command! -bang -nargs=* Rg call fzf#vim#grep(
|
||||||
\ "rg"
|
\ "rg"
|
||||||
\ . " --column"
|
\ . " --column"
|
||||||
\ . " --line-number"
|
\ . " --line-number"
|
||||||
\ . " --no-heading"
|
\ . " --no-heading"
|
||||||
\ . " --color=always"
|
\ . " --color=always"
|
||||||
\ . " --smart-case"
|
\ . " --smart-case"
|
||||||
\ . " --iglob=!.git"
|
\ . " --iglob=!.git"
|
||||||
\ . " --hidden"
|
\ . " --hidden"
|
||||||
\ . " --no-ignore-vcs " .<q-args>, 1, <bang>0)
|
\ . " --no-ignore-vcs " .<q-args>, 1, <bang>0)
|
||||||
|
|
||||||
command! -bang CwdHistory call fzf#run(fzf#wrap({
|
command! -bang CwdHistory call fzf#run(fzf#wrap({
|
||||||
\ 'source': filter(
|
\ 'source': filter(
|
||||||
\ fzf#vim#_recent_files(),
|
\ fzf#vim#_recent_files(),
|
||||||
\ 'v:val !~ "^\\~\\?/"'
|
\ 'v:val !~ "^\\~\\?/"'
|
||||||
\ ),
|
\ ),
|
||||||
\ 'options': [
|
\ 'options': [
|
||||||
\ '-m',
|
\ '-m',
|
||||||
\ '--header-lines', !empty(expand('%')),
|
\ '--header-lines', !empty(expand('%')),
|
||||||
\ '--prompt', 'CwdHist> '
|
\ '--prompt', 'CwdHist> '
|
||||||
\ ]},
|
\ ]},
|
||||||
\ <bang>0))
|
\ <bang>0))
|
||||||
|
|
||||||
nmap <Leader>ff :Files<CR>
|
nmap <Leader>ff :Files<CR>
|
||||||
nmap <Leader>fr :CwdHistory<CR>
|
nmap <Leader>fr :CwdHistory<CR>
|
||||||
|
|||||||
Reference in New Issue
Block a user