config-telescope.lua 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. local actions = require('telescope.actions')
  2. -- Global remapping
  3. ------------------------------
  4. -- '--color=never',
  5. require('telescope').setup{
  6. defaults = {
  7. vimgrep_arguments = {
  8. 'rg',
  9. '--no-heading',
  10. '--with-filename',
  11. '--line-number',
  12. '--column',
  13. '--smart-case'
  14. },
  15. prompt_position = "bottom",
  16. prompt_prefix = " ",
  17. selection_caret = " ",
  18. entry_prefix = " ",
  19. initial_mode = "insert",
  20. selection_strategy = "reset",
  21. sorting_strategy = "descending",
  22. layout_strategy = "horizontal",
  23. layout_defaults = {
  24. horizontal = {
  25. mirror = false,
  26. },
  27. vertical = {
  28. mirror = false,
  29. },
  30. },
  31. file_sorter = require'telescope.sorters'.get_fuzzy_file,
  32. file_ignore_patterns = {},
  33. generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
  34. shorten_path = true,
  35. winblend = 0,
  36. width = 0.75,
  37. preview_cutoff = 120,
  38. results_height = 1,
  39. results_width = 0.8,
  40. border = {},
  41. borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
  42. color_devicons = true,
  43. use_less = true,
  44. set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
  45. file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
  46. grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
  47. qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
  48. -- Developer configurations: Not meant for general override
  49. buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
  50. mappings = {
  51. i = {
  52. ["<C-j>"] = actions.move_selection_next,
  53. ["<C-k>"] = actions.move_selection_previous,
  54. -- To disable a keymap, put [map] = false
  55. -- So, to not map "<C-n>", just put
  56. -- ["<c-x>"] = false,
  57. -- Otherwise, just set the mapping to the function that you want it to be.
  58. -- ["<C-i>"] = actions.select_horizontal,
  59. -- Add up multiple actions
  60. ["<CR>"] = actions.select_default + actions.center,
  61. -- You can perform as many actions in a row as you like
  62. -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
  63. },
  64. n = {
  65. ["<C-j>"] = actions.move_selection_next,
  66. ["<C-k>"] = actions.move_selection_previous,
  67. -- ["<esc>"] = actions.close,
  68. -- ["<C-i>"] = my_cool_custom_action,
  69. },
  70. },
  71. }
  72. }