aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua1
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins/nvim-bqf.lua70
2 files changed, 8 insertions, 63 deletions
diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua b/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua
index 1a84ac4..b6da8d8 100644
--- a/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua
+++ b/nvim/.config/nvim/lua/tobyvin/plugins/gruvbox.lua
@@ -31,6 +31,7 @@ M.setup = function()
StatusLineNC = { fg = colors.light4, bg = colors.dark1, reverse = false },
WinBar = { link = "StatusLineNC" },
WinBarNC = { fg = colors.light4, bg = "" },
+ QuickFixLine = { fg = "", bg = "" },
-- TODO: workaround for weird highlights in lsp hover/signature
-- SEE: https://github.com/neovim/neovim/issues/13746
diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/nvim-bqf.lua b/nvim/.config/nvim/lua/tobyvin/plugins/nvim-bqf.lua
index 9ce8ee4..af7da0d 100644
--- a/nvim/.config/nvim/lua/tobyvin/plugins/nvim-bqf.lua
+++ b/nvim/.config/nvim/lua/tobyvin/plugins/nvim-bqf.lua
@@ -1,55 +1,5 @@
local M = {}
-M.qftf = function(info)
- local items
- local ret = {}
- -- The name of item in list is based on the directory of quickfix window.
- -- Change the directory for quickfix window make the name of item shorter.
- -- It's a good opportunity to change current directory in quickfixtextfunc :)
- --
- -- local alterBufnr = fn.bufname('#') -- alternative buffer is the buffer before enter qf window
- -- local root = getRootByAlterBufnr(alterBufnr)
- -- vim.cmd(('noa lcd %s'):format(fn.fnameescape(root)))
- --
- if info.quickfix == 1 then
- items = vim.fn.getqflist({ id = info.id, items = 0 }).items
- else
- items = vim.fn.getloclist(info.winid, { id = info.id, items = 0 }).items
- end
- local limit = 31
- local fnameFmt1, fnameFmt2 = "%-" .. limit .. "s", "…%." .. (limit - 1) .. "s"
- local validFmt = "%s │%5d:%-3d│%s %s"
- for i = info.start_idx, info.end_idx do
- local e = items[i]
- local fname = ""
- local str
- if e.valid == 1 then
- if e.bufnr > 0 then
- fname = vim.fn.bufname(e.bufnr)
- if fname == "" then
- fname = "[No Name]"
- else
- fname = fname:gsub("^" .. vim.env.HOME, "~")
- end
- -- char in fname may occur more than 1 width, ignore this issue in order to keep performance
- if #fname <= limit then
- fname = fnameFmt1:format(fname)
- else
- fname = fnameFmt2:format(fname:sub(1 - limit))
- end
- end
- local lnum = e.lnum > 99999 and -1 or e.lnum
- local col = e.col > 999 and -1 or e.col
- local qtype = e.type == "" and "" or " " .. e.type:sub(1, 1):upper()
- str = validFmt:format(fname, lnum, col, qtype, e.text)
- else
- str = e.text
- end
- table.insert(ret, str)
- end
- return ret
-end
-
M.setup = function()
local status_ok, bqf = pcall(require, "bqf")
if not status_ok then
@@ -60,21 +10,15 @@ M.setup = function()
bqf.setup({
auto_resize_height = true,
preview = {
- border_chars = { "┃", "┃", "━", "━", "┏", "┓", "┗", "┛", "█" },
+ border_chars = { "│", "│", "─", "─", "┌", "┐", "└", "┘", "█" },
},
func_map = {
- drop = "o",
- openc = "O",
- split = "<C-s>",
- tabdrop = "<C-t>",
- tabc = "",
- ptogglemode = "z,",
- },
- filter = {
- fzf = {
- action_for = { ["ctrl-s"] = "split", ["ctrl-t"] = "tab drop" },
- extra_opts = { "--bind", "ctrl-o:toggle-all", "--prompt", "> " },
- },
+ open = "o",
+ openc = "<cr>",
+ tabc = "t",
+ tab = "<C-t>",
+ pscrollup = "<C-u>",
+ pscrolldown = "<C-d>",
},
})
end