diff --git a/lua/mappings.lua b/lua/mappings.lua index efed688..9a24979 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -8,6 +8,35 @@ vim.keymap.del("n", "") vim.keymap.del("n", "rn") map("n", "rn", vim.lsp.buf.rename, { desc = "LSP Rename" }) +-- NvChad binds these to telescope, which is not installed (fzf-lua is the picker). +-- Drop them all, then restore the ones fzf.lua does not already cover. +for _, lhs in ipairs { + "ff", + "fw", + "fb", + "fh", + "fo", + "fz", + "ma", + "cm", + "gt", + "pt", +} do + pcall(vim.keymap.del, "n", lhs) +end + +local function fzf(picker) + return function() + require("fzf-lua")[picker]() + end +end + +map("n", "fo", fzf "oldfiles", { desc = "Old files" }) +map("n", "fh", fzf "helptags", { desc = "Help tags" }) +map("n", "fz", fzf "blines", { desc = "Find in current buffer" }) +map("n", "ma", fzf "marks", { desc = "Marks" }) +map("n", "cm", fzf "git_commits", { desc = "Git commits" }) + map("n", ";", ":", { desc = "CMD enter command mode" }) -- close current buffer diff --git a/lua/plugins/fzf.lua b/lua/plugins/fzf.lua index 12e6d47..0fab734 100644 --- a/lua/plugins/fzf.lua +++ b/lua/plugins/fzf.lua @@ -1,4 +1,11 @@ return { + -- shipped by NvChad; fzf-lua is the picker, and its telescope-based mappings + -- are replaced in lua/mappings.lua + { + "nvim-telescope/telescope.nvim", + enabled = false, + }, + { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" },