init.lua 2.9 KB

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