diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-10-08 21:39:43 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-10-08 21:39:43 -0400 |
| commit | c2c4626c3d3816586014b505c10b249cf2514005 (patch) | |
| tree | 8345ff06300f165f96124197b5a30a936b92e24e /lua/telescope/config.lua | |
| parent | fa17b37dad05a2928ee64bb53a8be8a36ee2de14 (diff) | |
feat: Add more easily customizable mappings.
Closes: #131
Diffstat (limited to 'lua/telescope/config.lua')
| -rw-r--r-- | lua/telescope/config.lua | 60 |
1 files changed, 16 insertions, 44 deletions
diff --git a/lua/telescope/config.lua b/lua/telescope/config.lua index 9e1ba25..82cd158 100644 --- a/lua/telescope/config.lua +++ b/lua/telescope/config.lua @@ -59,52 +59,24 @@ function config.set_defaults(defaults) -- Last argument will be the search term (passed in during execution) set("vimgrep_arguments", {'rg', '--color=never', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case'}) - -- TODO: Shortenpath - -- Decide how to propagate that to all the opts everywhere. - -- TODO: Add motions to keybindings - -- TODO: Add relative line numbers? - set("default_mappings", { - i = { - ["<C-n>"] = actions.move_selection_next, - ["<C-p>"] = actions.move_selection_previous, - - ["<C-c>"] = actions.close, - - ["<Down>"] = actions.move_selection_next, - ["<Up>"] = actions.move_selection_previous, - - ["<CR>"] = actions.goto_file_selection_edit, - ["<C-x>"] = actions.goto_file_selection_split, - ["<C-v>"] = actions.goto_file_selection_vsplit, - ["<C-t>"] = actions.goto_file_selection_tabedit, - - ["<C-u>"] = actions.preview_scrolling_up, - ["<C-d>"] = actions.preview_scrolling_down, - - -- TODO: When we implement multi-select, you can turn this back on :) - -- ["<Tab>"] = actions.add_selection, - }, - - n = { - ["<esc>"] = actions.close, - ["<CR>"] = actions.goto_file_selection_edit, - ["<C-x>"] = actions.goto_file_selection_split, - ["<C-v>"] = actions.goto_file_selection_vsplit, - ["<C-t>"] = actions.goto_file_selection_tabedit, - - -- TODO: This would be weird if we switch the ordering. - ["j"] = actions.move_selection_next, - ["k"] = actions.move_selection_previous, - - ["<Down>"] = actions.move_selection_next, - ["<Up>"] = actions.move_selection_previous, - - ["<C-u>"] = actions.preview_scrolling_up, - ["<C-d>"] = actions.preview_scrolling_down, - }, - }) + -- To disable a keymap, put [map] = false + -- So, to not map "<C-n>", just put + -- + -- ..., + -- ["<C-n>"] = false, + -- ..., + -- + -- Into your config. + -- + -- Otherwise, just set the mapping to the function that you want it to be. + -- + -- ..., + -- ["<C-i>"] = actions.goto_file_selection_split + -- ..., + -- + set("mappings", {}) -- NOT STABLE. DO NOT USE set("horizontal_config", { |
