nvim-telescope / telescope-live-grep-args.nvim

Live grep with args
727 stars 40 forks source link

Disable default mappings #34

Closed oriming closed 2 years ago

oriming commented 2 years ago

Can't close even if default mapping is overridden. Below is my configuration:

local telescope = require("telescope")
local lga_actions = require("telescope-live-grep-args.actions")

telescope.setup {
  extensions = {
    live_grep_args = {
      auto_quoting = true, -- enable/disable auto-quoting
      mappings = {
        i = {
          ["<C-l>"] = lga_actions.quote_prompt(),
        }
      }
    }
  }
}
weeman1337 commented 2 years ago

Hi @matrix-f . If you don't want to use the default mappings, you have to override them:

local telescope = require("telescope")
local lga_actions = require("telescope-live-grep-args.actions")

telescope.setup {
  extensions = {
    live_grep_args = {
      auto_quoting = true, -- enable/disable auto-quoting
      default_mappings = {
        i = {
          ["<C-l>"] = lga_actions.quote_prompt(),
        }
      }
    }
  }
}

mappingsdefault_mappings as mentioned in the configuration section.

Can you give it a try and report back if it works for you?

oriming commented 2 years ago

@weeman1337 Sorry, even as you mean, the default map key (<C-k>) still works, and the custom shortcut<C-l> doesn't work.

weeman1337 commented 2 years ago

I gave this a fresh test this morning and it is working fine. Did you call telescope.load_extension("live_grep_args") after setup @matrix-f ? And please verify you have the latest version.

oriming commented 2 years ago

@weeman1337 Thanks a lot, it's really a version issue. After the version update, the problem is solved, thank you again!

fzhzhen1987 commented 2 years ago

i get the same problem. Changing the default keymap,but not work.

Snipaste_2022-11-04_15-26-21

fzhzhen1987 commented 2 years ago

Just a little advise: 1 why not disable by default 2 change the default keybind ,contradicted with the default keybind of telescope

weeman1337 commented 2 years ago

Hi @fzhzhen1987 looks like you missed default_mappings = {}. Anyway this issue is still open because I am going to remove all default mappings soon.

fzhzhen1987 commented 2 years ago

Thank u for ur answer.

>looks like you missed default_mappings = {}. I tested bind ctrl-l for default_mappings = {}.But Ctrl-k and Ctrl-l get the same func. Ctrl-k still works.....

>Anyway this issue is still open because I am going to remove all default mappings soon. waiting for that commit. Telescope is very gooood. By the way do u have the plan to build gtags pickers? Thank u again.

weeman1337 commented 2 years ago

By the way do u have the plan to build gtags pickers?

That would be a question to be asked in the main Telescope tracker.

weeman1337 commented 2 years ago

@fzhzhen1987 can you give this branch a try? https://github.com/nvim-telescope/telescope-live-grep-args.nvim/pull/38

fzhzhen1987 commented 2 years ago

@weeman1337 good morning. I tested commit 1d2137a1ad Remove default mappings. Default keybind is gone. Thank u.