diff options
Diffstat (limited to 'lua/telescope/config.lua')
| -rw-r--r-- | lua/telescope/config.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lua/telescope/config.lua b/lua/telescope/config.lua index 9b1677e..9c68d05 100644 --- a/lua/telescope/config.lua +++ b/lua/telescope/config.lua @@ -12,6 +12,8 @@ local function first_non_null(...) end end +local actions = require('telescope.actions') + -- TODO: Add other major configuration points here. -- selection_strategy @@ -42,6 +44,8 @@ function config.set_defaults(defaults) set("border", {}) set("borderchars", { '─', '│', '─', '│', '╭', '╮', '╯', '╰'}) + set("get_status_text", function(self) return string.format("%s / %s", self.stats.processed - self.stats.filtered, self.stats.processed) end) + -- Builtin configuration -- List that will be executed. @@ -51,6 +55,50 @@ function config.set_defaults(defaults) -- 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, + }, + }) + + -- NOT STABLE. DO NOT USE set("horizontal_config", { get_preview_width = function(columns, _) |
