NvChad / NvChad

Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.

Home Page:https://nvchad.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to unmap default mappings for Telescope plugin?

LinuxIsCool opened this issue · comments

How can I unmap these keys?

map("n", "<leader>fw", "<cmd>Telescope live_grep<CR>", { desc = "telescope live grep" })

In previous nvchad I had in mappings.lua:

---@type MappingsTable
local M = {}

M.disabled = {
  n = {
    ["<leader>f"] = "",
    ["<leader>ff"] = "",
    ["<leader>fg"] = "",
    ["<leader>fb"] = "",
    ["<leader>fh"] = "",
    ["<leader>fa"] = "",
    ["<leader>fm"] = "",
    ["<leader>fo"] = "",
    ["<leader>fw"] = "",
    ["<leader>fz"] = "",
  },
}
return M

Now I'm trying in mappings.lua:

require "nvchad.mappings"

-- Disable mappings
local nomap = vim.keymap.del

nomap("n", "<leader>f")
nomap("n", "<leader>fa")
nomap("n", "<leader>fb")
nomap("n", "<leader>ff")
nomap("n", "<leader>fh")
nomap("n", "<leader>fm")
nomap("n", "<leader>fo")
nomap("n", "<leader>fw")
nomap("n", "<leader>fz")

But getting error:

Error executing vim.schedule lua callback: vim/keymap.lua:0: E31: No such mapping
stack traceback:
        [C]: in function 'nvim_del_keymap'
        vim/keymap.lua: in function 'nomap'
        /home/ygg/.config/nvim/lua/mappings.lua:6: in main chunk
        [C]: in function 'require'
        /home/ygg/.config/nvim/init.lua:38: in function </home/ygg/.config/nvim/init.l
ua:37>

Furthermore, how can I simply disable Telescope?

check the list of mappins in nvchad first, there is no such mapping as leader f

I don't understand your answer. I linked directly to the mapping.

It's in NvChad/lua/nvchad/mappings.lua

And you can see it with whichkey as well.

image

there is no leader f here?

I would like to unmap <leader>f as a prefix, thus I would like to unmap all those mappings that begin with <leader>f.

Vim.keymap.Del has nothing to do with prefixes , its which key stuff