From 10627e889e82a82560b6fc48ea0ca20e1963d07f Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Wed, 24 Feb 2021 02:41:00 +0100 Subject: feat: advanced normal mode (#463) Add j and k to normal mode and H and L to jump at top and bottom of displayed results --- lua/telescope/mappings.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lua/telescope/mappings.lua') diff --git a/lua/telescope/mappings.lua b/lua/telescope/mappings.lua index efc833e..95ce279 100644 --- a/lua/telescope/mappings.lua +++ b/lua/telescope/mappings.lua @@ -38,6 +38,8 @@ mappings.default_mappings = config.values.default_mappings or { -- TODO: This would be weird if we switch the ordering. ["j"] = actions.move_selection_next, ["k"] = actions.move_selection_previous, + ["H"] = actions.move_to_top, + ["L"] = actions.move_to_bottom, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, @@ -110,7 +112,7 @@ local telescope_map = function(prompt_bufnr, mode, key_bind, key_func, opts) ) else local key_id = assign_function(prompt_bufnr, key_func) - local prefix = "" + local prefix local map_string if opts.expr then @@ -122,10 +124,14 @@ local telescope_map = function(prompt_bufnr, mode, key_bind, key_func, opts) else if mode == "i" and not opts.expr then prefix = "" + elseif mode == "n" then + prefix = ":" + else + prefix = ":" end map_string = string.format( - "%s:lua require('telescope.mappings').execute_keymap(%s, %s)", + "%slua require('telescope.mappings').execute_keymap(%s, %s)", prefix, prompt_bufnr, key_id -- cgit v1.2.3