diff options
author | Andrew Fridley <[email protected]> | 2021-08-12 00:49:37 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-12 10:19:37 +0430 |
commit | a3344203818658441d176fe279e1978505940432 (patch) | |
tree | 845aa50b570acb67cb08891031d480b8a5a8b62e | |
parent | abf7fee04885befaf99eff6a62c8c5774df8613e (diff) |
Please... reverse history and cycle next telescope bindings (#1276)
-rw-r--r-- | lua/core/telescope.lua | 4 | ||||
-rw-r--r-- | utils/installer/config.example-no-ts.lua | 13 | ||||
-rw-r--r-- | utils/installer/config.example.lua | 13 |
3 files changed, 28 insertions, 2 deletions
diff --git a/lua/core/telescope.lua b/lua/core/telescope.lua index f4d154b0..f8862260 100644 --- a/lua/core/telescope.lua +++ b/lua/core/telescope.lua @@ -60,8 +60,8 @@ M.config = function() -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action, }, n = { - ["<C-j>"] = actions.move_selection_next, - ["<C-k>"] = actions.move_selection_previous, + ["<C-n>"] = actions.move_selection_next, + ["<C-p>"] = actions.move_selection_previous, ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, -- ["<c-t>"] = trouble.open_with_trouble, -- ["<C-i>"] = my_cool_custom_action, diff --git a/utils/installer/config.example-no-ts.lua b/utils/installer/config.example-no-ts.lua index 4303d264..b0de00f0 100644 --- a/utils/installer/config.example-no-ts.lua +++ b/utils/installer/config.example-no-ts.lua @@ -14,6 +14,19 @@ lvim.keys.normal_mode["<C-s>"] = ":w<cr>" -- edit a default keymapping -- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" +-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. +-- lvim.builtin.telescope.on_config_done = function() +-- local actions = require "telescope.actions" +-- -- for input mode +-- lvim.builtin.telescope.defaults.mappings.i["<C-j>"] = actions.move_selection_next +-- lvim.builtin.telescope.defaults.mappings.i["<C-k>"] = actions.move_selection_previous +-- lvim.builtin.telescope.defaults.mappings.i["<C-n>"] = actions.cycle_history_next +-- lvim.builtin.telescope.defaults.mappings.i["<C-p>"] = actions.cycle_history_prev +-- -- for normal mode +-- lvim.builtin.telescope.defaults.mappings.n["<C-j>"] = actions.move_selection_next +-- lvim.builtin.telescope.defaults.mappings.n["<C-k>"] = actions.move_selection_previous +-- end + -- Use which-key to add extra bindings with the leader-key prefix -- lvim.builtin.which_key.mappings["P"] = { "<cmd>lua require'telescope'.extensions.project.project{}<CR>", "Projects" } -- lvim.builtin.which_key.mappings["t"] = { diff --git a/utils/installer/config.example.lua b/utils/installer/config.example.lua index 0aee0275..1c39a571 100644 --- a/utils/installer/config.example.lua +++ b/utils/installer/config.example.lua @@ -23,6 +23,19 @@ lvim.keys.normal_mode["<C-s>"] = ":w<cr>" -- edit a default keymapping -- lvim.keys.normal_mode["<C-q>"] = ":q<cr>" +-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. +-- lvim.builtin.telescope.on_config_done = function() +-- local actions = require "telescope.actions" +-- -- for input mode +-- lvim.builtin.telescope.defaults.mappings.i["<C-j>"] = actions.move_selection_next +-- lvim.builtin.telescope.defaults.mappings.i["<C-k>"] = actions.move_selection_previous +-- lvim.builtin.telescope.defaults.mappings.i["<C-n>"] = actions.cycle_history_next +-- lvim.builtin.telescope.defaults.mappings.i["<C-p>"] = actions.cycle_history_prev +-- -- for normal mode +-- lvim.builtin.telescope.defaults.mappings.n["<C-j>"] = actions.move_selection_next +-- lvim.builtin.telescope.defaults.mappings.n["<C-k>"] = actions.move_selection_previous +-- end + -- Use which-key to add extra bindings with the leader-key prefix -- lvim.builtin.which_key.mappings["P"] = { "<cmd>lua require'telescope'.extensions.project.project{}<CR>", "Projects" } -- lvim.builtin.which_key.mappings["t"] = { |