fix diagnostics and add nvim_tree

This commit is contained in:
Barak Michener 2021-07-08 11:49:12 -07:00
parent 86669142bf
commit 8aeae726ed

31
.vimrc
View file

@ -206,9 +206,12 @@ Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'kyazdani42/nvim-web-devicons' " for file icons
Plug 'kyazdani42/nvim-tree.lua'
" Plugins that do specific things
Plug 'Shougo/vimproc.vim'
Plug 'Shougo/vimfiler.vim'
"Plug 'Shougo/vimproc.vim'
"Plug 'Shougo/vimfiler.vim'
Plug 'Shougo/unite.vim'
" TODO: Look into Coqtail, same author
Plug 'whonore/coquille', {'branch': 'pathogen-bundle', 'for': 'coq'}
@ -283,13 +286,13 @@ nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
"nnoremap <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <silent> ga <cmd>lua vim.lsp.buf.code_action()<CR>
nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>
nnoremap <silent> ge <cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})<CR>
" Set updatetime for CursorHold
" 300ms of no cursor movement to trigger CursorHold
set updatetime=500
" Show diagnostic popup on cursor hold
autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics()
autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false})
" Goto previous/next diagnostic warning/error
nnoremap <silent> g[ <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
@ -448,8 +451,11 @@ let g:signify_sign_changedelete = g:signify_sign_change
let g:signify_sign_show_count = 0
let g:signify_priority = 5
" * VimFiler
let g:vimfiler_tree_indentation = 2
" * Nvim Tree
let g:nvim_tree_add_trailing = 1
let g:nvim_tree_side = 'right'
let g:nvim_tree_width = 40
let g:nvim_tree_quit_on_open = 1
" * Tagbar plugin settings
let g:tagbar_width = 40
@ -513,14 +519,14 @@ let g:rg_command = '
"\ -g "*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf}"
command! -bang -nargs=* RipGrep call fzf#vim#grep(g:rg_command .shellescape(<q-args>), 1, <bang>0)
command! -bang -nargs=* RipGrepCword call fzf#vim#grep(g:rg_command . "-q " . expand('<cword>'), 1, <bang>0)
"command! -bang -nargs=* RipGrep call fzf#vim#grep(g:rg_command .shellescape(<q-args>), 1, <bang>0)
"command! -bang -nargs=* RipGrepCword call fzf#vim#grep(g:rg_command . "-q " . expand('<cword>'), 1, <bang>0)
command! -bang -nargs=* RgRoot call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case " . shellescape(<q-args>), 1, {"dir": FindRootDirectory()})
"command! -bang -nargs=* RgRoot call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case " . shellescape(<q-args>), 1, {"dir": FindRootDirectory()})
let g:fzf_buffers_jump = 1
"let g:fzf_buffers_jump = 1
" Empty value to disable preview window altogether
let g:fzf_preview_window = ''
"let g:fzf_preview_window = ''
" * VimOrganizer
" default Tag list. Will be changed in near future so
@ -792,7 +798,8 @@ command CocReinstall :CocInstall coc-json coc-pyright coc-rust-analyzer coc-snip
" I don't know how I came up with gt for opening the tree, but it stuck.
"nmap gt :NERDTreeToggle<CR>
"nmap <silent> gt :VimFilerExplorer -winwidth=40 -toggle -direction=rightbelow -parent -status -force-hide<CR>
nmap <silent> gt :VimFiler -status -auto-cd -parent -force-quit<CR>
"nmap <silent> gt :VimFiler -status -auto-cd -parent -force-quit<CR>
nnoremap <silent> gt :NvimTreeToggle<CR>
" The same for the TagList, useful for large C files.
"nmap gb :TlistToggle<CR>
nmap gb :TagbarToggle<CR>