config.lua 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. local status_ok, actions = pcall(require, "telescope.actions")
  2. if not status_ok then
  3. return
  4. end
  5. O.plugin.telescope = {
  6. active = false,
  7. defaults = {
  8. find_command = {
  9. "rg",
  10. "--no-heading",
  11. "--with-filename",
  12. "--line-number",
  13. "--column",
  14. "--smart-case",
  15. },
  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_config = {
  24. width = 0.75,
  25. prompt_position = "bottom",
  26. preview_cutoff = 120,
  27. horizontal = { mirror = false },
  28. vertical = { mirror = false },
  29. },
  30. file_sorter = require("telescope.sorters").get_fzy_sorter,
  31. file_ignore_patterns = {},
  32. generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
  33. path_display = { "shorten" },
  34. winblend = 0,
  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. }