From f8060a72c84cc7e19874e6c9899ea5ba3418dbd3 Mon Sep 17 00:00:00 2001 From: ray-x Date: Thu, 8 Jul 2021 08:50:06 +1000 Subject: [PATCH] update keymapping override document and sample config --- README.md | 2 ++ lua/navigator.lua | 2 ++ lua/navigator/lspclient/mapping.lua | 1 + 3 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 9c2ef30..e9d237d 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,8 @@ require.'navigator'.setup({ default_mapping = true, -- set to false if you will remap every key keymaps = {{key = "gK", func = "declaration()"}}, -- a list of key maps + -- this kepmap gK will override "gD" mapping function declaration() in default kepmap + -- please check mapping.lua for all keymaps treesitter_analysis = true, -- treesitter variable context code_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, icons = { diff --git a/lua/navigator.lua b/lua/navigator.lua index 9ea328b..d993c1d 100644 --- a/lua/navigator.lua +++ b/lua/navigator.lua @@ -5,11 +5,13 @@ _NgConfigValues = { preview_height = 0.35, height = 0.35, default_mapping = true, + keymaps = {{key = "GR", func = "references()"}}, -- e.g keymaps={{key = "gr", func = "references()"}, } combined_attach = "both", -- both: use both customized attach and navigator default attach, mine: only use my attach defined in vimrc on_attach = nil, -- function(client, bufnr) -- -- your on_attach will be called at end of navigator on_attach -- end, + code_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, treesitter_analysis = true, -- treesitter variable context lsp = { diff --git a/lua/navigator/lspclient/mapping.lua b/lua/navigator/lspclient/mapping.lua index 43e8aa2..d2c5e33 100644 --- a/lua/navigator/lspclient/mapping.lua +++ b/lua/navigator/lspclient/mapping.lua @@ -76,6 +76,7 @@ local function set_mapping(user_opts) table.insert(key_maps, v) end end + -- log(key_maps) -- local key_opts = {vim.tbl_deep_extend("force", key_maps, unpack(result))} for _, value in pairs(key_maps) do