summaryrefslogtreecommitdiffstats
path: root/lua/core/overrides/telescope.lua
blob: 546a33c70f281d9f04bf0236794b28c3155db911 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local telescope = require('telescope')
local actions = require('telescope.actions')

telescope.load_extension('undo')
telescope.setup {
  defaults = {
    borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
    sorting_strategy = 'ascending',
    layout_config = {
      height = 0.9,
      prompt_position = 'top',
    },
    mappings = {
      i = {
        ['<C-h>'] = 'which_key',
        ['<C-j>'] = actions.move_selection_next,
        ['<C-k>'] = actions.move_selection_previous,
        ['<C-l>'] = actions.select_default,
        ['<C-u>'] = actions.preview_scrolling_up,
        ['<C-d>'] = actions.preview_scrolling_down,
      },
      n = {
        ["gg"] = actions.move_to_top,
        ["G"] = actions.move_to_bottom,
      },
    },
  }
}

a.nvim_create_autocmd('User', {
  pattern = 'TelescopePreviewerLoaded',
  command = 'setlocal number',
})