vimrc plugin tweaks

This commit is contained in:
2021-10-14 14:20:40 -04:00
parent 9ae1fcb852
commit 9142991143
2 changed files with 23 additions and 11 deletions

26
vimrc
View File

@@ -70,8 +70,11 @@ endif
"################################################################
"################################################################
let s:max_line_length = 100
let g:quickfix_window_height = 16 " in rows
let s:max_line_length = 100 " Display a vertical bar at x=<n>.
" Set the row height of the quickfix pane, which is used to display results from various plugins (like ctrl-p, ripgrep, compilation errors, etc), in rows
let g:quickfix_pane_height = 20
" Start vim with the dark theme. Set to 'light' for the light theme.
" To change the themes see `g:campo_dark_theme` and `g:campo_light_theme`.
let s:default_bg = 'dark'
@@ -756,7 +759,7 @@ let g:syntastic_check_on_wq = 0
" RIPGREP
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:rg_highlight = 1
let g:rg_window_height = g:quickfix_window_height
let g:rg_window_height = g:quickfix_pane_height
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTRL-P
@@ -781,10 +784,13 @@ map <leader>g :CtrlP<cr>
let g:ctrlp_map = '<leader>f'
let g:ctrlp_cmd = 'CtrlPTag' " Search tags by default.
let g:ctrlp_by_filename = 1 " File search by filename as opposed to full path.
let g:ctrlp_match_window = 'bottom,order:ttb,min:10,max:20,results:20' " Keep results synced with max height.
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files'] " If a git repo, use checked in files; fallback to globpath()
let g:ctrlp_match_window = 'bottom,order:ttb,min:10,max:'.g:quickfix_pane_height.',results:'.g:quickfix_pane_height
let g:ctrlp_use_caching = 1
let g:ctrlp_clear_cache_on_exit = 1 " No need to keep cache for now since I mostly work in git repos. Press F5 inside CtrlP to rebuild the cache.
let g:ctrlp_working_path_mode = 'ra' " Search from nearest ancestor of the current file that contains .git OR directory of the current file unless it's a subdirectory of the cwd
let g:ctrlp_switch_buffer = 'et' " If a file is already open, open it again in a new pane instead of switching to the existing pane
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] " If a git repo, use checked in files (ignore things in .gitignore); fallback to globpath()
" @fixme Not sure why I can't get these new mappings (c-m, c-cr) to register...
"let g:ctrlp_prompt_mappings = {
@@ -1035,15 +1041,15 @@ set errorformat+=\\\ %#%f(%l\\\,%c-%*[0-9]):\ %#%t%[A-z]%#\ %m
function! HideBuildResultsAndClearErrors()
RemoveErrorMarkers
call asyncrun#quickfix_toggle(g:quickfix_window_height, 0)
call asyncrun#quickfix_toggle(g:quickfix_pane_height, 0)
endfunction
function! HideAsyncResults()
call asyncrun#quickfix_toggle(g:quickfix_window_height, 0)
call asyncrun#quickfix_toggle(g:quickfix_pane_height, 0)
endfunction
function! ToggleBuildResults()
call asyncrun#quickfix_toggle(g:quickfix_window_height)
call asyncrun#quickfix_toggle(g:quickfix_pane_height)
endfunction
function! StopRunTask()
@@ -1063,7 +1069,7 @@ endfunction
" Show results window the moment the async job starts
augroup asyncPluginCmds
autocmd!
autocmd User AsyncRunStart call asyncrun#quickfix_toggle(g:quickfix_window_height, 1)
autocmd User AsyncRunStart call asyncrun#quickfix_toggle(g:quickfix_pane_height, 1)
augroup END
" Toggle build results