init.lua 3.2 KB

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