summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/module/telescope.lua
blob: 21869d126305f48683ddcafa872257ac9cef8c02 (plain)
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
34
35
36
37
38
39
40
41
42
43
local telescope = require "telescope"
local builtin = require "telescope.builtin"
local actions = require "telescope.actions"

telescope.load_extension "fzf"
telescope.setup{
  defaults = {
    file_ignore_patterns = {
      ".git",
      "node_modules"
    },
    mappings = {
      i = {
        ["<C-j>"] = actions.move_selection_next,
        ["<C-k>"] = actions.move_selection_previous,
      }
    }
  },
  pickers = {
    find_files = {
      hidden = true
    },
    live_grep = {
      additional_args = { "--hidden" }
    },
    grep_string = {
      additional_args = { "--hidden" }
    },
    buffers = {
      previewer = false,
      mappings = {
        i = {
          ["<C-d>"] = actions.delete_buffer
        }
      }
    },
  }
}

vim.keymap.set("n", "<leader>ff", builtin.find_files, {})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
vim.keymap.set("n", "<leader>fb", builtin.buffers, {})
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})