require "nvchad.mappings" local map = vim.keymap.set -- remove nvim-tree mappings (nvim-tree disabled; using yazi instead, see plugins/yazi.lua) vim.keymap.del("n", "e") 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 map("n", "q", ":q") -- go back to normal mode map("i", "jj", "") map("i", "jk", "") --save file map("n", "", ":update") map("i", "", ":update") -- remove search highlight map("n", ",", ":noh")