nixpkgs/home/programs/neovim/plugins/telescope.lua
Daniel Siepmann 774e4f8555
Rename Neovim custom telescope
The keyboard shortcut was already in use.
I therefore renamed custom_functions into custom runs.
That way I can add multiple things in the future.
E.g. the items to select can also be a table which defines the name as
well as what to execute. That way I could add functions, commands and
other things.
2022-03-23 16:37:26 +01:00

31 lines
941 B
Lua

local telescopeActions = require "telescope.actions"
local telescopeActionsLayout = require "telescope.actions.layout"
require('telescope').setup({
defaults = {
layout_strategy = 'center',
layout_config = {
width = 0.6,
},
sorting_strategy = 'ascending',
default_mappings = {
i = {
["<C-j>"] = telescopeActions.move_selection_next,
["<C-k>"] = telescopeActions.move_selection_previous,
["<C-c>"] = telescopeActions.close,
["<CR>"] = telescopeActions.select_default,
["<C-h>"] = telescopeActions.which_key,
["<C-v>"] = telescopeActions.select_vertical,
["<C-p>"] = telescopeActionsLayout.toggle_preview,
},
},
preview = {
hide_on_startup = true,
},
},
})
require('telescope').load_extension('custom_runs')