From 272074255abd6ce5467d69564e1103d5a1ebf1a6 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 17 Apr 2024 15:49:34 -0400 Subject: [PATCH] Disable qf.lua's active configuration (we'll still use it to toggle the list) and add an autocmd that closes quickfix if it's the last window --- vim/config/after.vim | 3 +++ vim/config/plugins/qf.lua | 39 --------------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 vim/config/plugins/qf.lua diff --git a/vim/config/after.vim b/vim/config/after.vim index 6e7667c..c739881 100644 --- a/vim/config/after.vim +++ b/vim/config/after.vim @@ -64,4 +64,7 @@ autocmd FileChangedRO * nested set noreadonly "disable the whitespace plugin for mail autocmd BufEnter,FileType mail hi ExtraWhitespace ctermbg=NONE guibg=NONE + + "close the quickfix if it's the last window + autocmd WinEnter * if winnr("$") == 1 && &buftype == "quickfix"|q|endif "}}} diff --git a/vim/config/plugins/qf.lua b/vim/config/plugins/qf.lua deleted file mode 100644 index 0e028e4..0000000 --- a/vim/config/plugins/qf.lua +++ /dev/null @@ -1,39 +0,0 @@ -require("qf").setup { - -- Location list configuration - l = { - auto_close = true, -- Automatically close location/quickfix list if empty - auto_follow = 'prev', -- Follow current entry, possible values: prev,next,nearest, or false to disable - auto_follow_limit = 8, -- Do not follow if entry is further away than x lines - follow_slow = true, -- Only follow on CursorHold - auto_open = false, -- Automatically open list on QuickFixCmdPost - auto_resize = true, -- Auto resize and shrink location list if less than `max_height` - max_height = 12, -- Maximum height of location/quickfix list - min_height = 5, -- Minimum height of location/quickfix list - wide = true, -- Open list at the very bottom of the screen, stretching the whole width. - number = false, -- Show line numbers in list - relativenumber = false, -- Show relative line numbers in list - unfocus_close = false, -- Close list when window loses focus - focus_open = false, -- Auto open list on window focus if it contains items - }, - - -- Quickfix list configuration - c = { - auto_close = true, -- Automatically close location/quickfix list if empty - auto_follow = 'prev', -- Follow current entry, possible values: prev,next,nearest, or false to disable - auto_follow_limit = 8, -- Do not follow if entry is further away than x lines - follow_slow = true, -- Only follow on CursorHold - auto_open = false, -- Automatically open list on QuickFixCmdPost - auto_resize = true, -- Auto resize and shrink location list if less than `max_height` - max_height = 12, -- Maximum height of location/quickfix list - min_height = 5, -- Minimum height of location/quickfix list - wide = true, -- Open list at the very bottom of the screen, stretching the whole width. - number = false, -- Show line numbers in list - relativenumber = false, -- Show relative line numbers in list - unfocus_close = false, -- Close list when window loses focus - focus_open = false, -- Auto open list on window focus if it contains items - }, - - close_other = false, -- Close location list when quickfix list opens - pretty = false, -- Pretty print quickfix lists - silent = true, -- Suppress messages like "(1 of 3): *line content*" on jump -}