init.lua 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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_prefix = " ",
  15. selection_caret = " ",
  16. entry_prefix = " ",
  17. initial_mode = "insert",
  18. selection_strategy = "reset",
  19. sorting_strategy = "descending",
  20. layout_strategy = "horizontal",
  21. layout_config = {
  22. width = 0.75,
  23. prompt_position = "bottom",
  24. preview_cutoff = 120,
  25. horizontal = {mirror = false},
  26. vertical = {mirror = false}
  27. },
  28. file_sorter = require'telescope.sorters'.get_fzy_sorter,
  29. file_ignore_patterns = {},
  30. generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
  31. shorten_path = true,
  32. winblend = 0,
  33. border = {},
  34. borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'},
  35. color_devicons = true,
  36. use_less = true,
  37. set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil,
  38. file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
  39. grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
  40. qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
  41. -- Developer configurations: Not meant for general override
  42. buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
  43. mappings = {
  44. i = {
  45. ["<C-c>"] = actions.close,
  46. ["<C-j>"] = actions.move_selection_next,
  47. ["<C-k>"] = actions.move_selection_previous,
  48. -- ["<c-t>"] = trouble.open_with_trouble,
  49. ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
  50. -- To disable a keymap, put [map] = false
  51. -- So, to not map "<C-n>", just put
  52. -- ["<c-x>"] = false,
  53. -- ["<esc>"] = actions.close,
  54. -- Otherwise, just set the mapping to the function that you want it to be.
  55. -- ["<C-i>"] = actions.select_horizontal,
  56. -- Add up multiple actions
  57. ["<CR>"] = actions.select_default + actions.center
  58. -- You can perform as many actions in a row as you like
  59. -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
  60. },
  61. n = {
  62. ["<C-j>"] = actions.move_selection_next,
  63. ["<C-k>"] = actions.move_selection_previous,
  64. -- ["<c-t>"] = trouble.open_with_trouble,
  65. ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist
  66. -- ["<C-i>"] = my_cool_custom_action,
  67. }
  68. }
  69. },
  70. extensions = {
  71. fzy_native = {
  72. override_generic_sorter = false,
  73. override_file_sorter = true
  74. }
  75. }
  76. }
  77. -- require'telescope'.load_extension('project')