init.lua 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 = "top",
  9. prompt_prefix = " ",
  10. selection_caret = " ",
  11. entry_prefix = " ",
  12. initial_mode = "insert",
  13. selection_strategy = "reset",
  14. sorting_strategy = "descending",
  15. layout_strategy = "horizontal",
  16. layout_defaults = {horizontal = {mirror = false}, vertical = {mirror = false}},
  17. file_sorter = require'telescope.sorters'.get_fuzzy_file,
  18. file_ignore_patterns = {},
  19. generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
  20. shorten_path = true,
  21. winblend = 0,
  22. width = 0.75,
  23. preview_cutoff = 120,
  24. results_height = 1,
  25. results_width = 0.8,
  26. border = {},
  27. borderchars = {'─', '│', '─', '│', '╭', '╮', '╯', '╰'},
  28. color_devicons = true,
  29. use_less = true,
  30. set_env = {['COLORTERM'] = 'truecolor'}, -- default = nil,
  31. file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
  32. grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
  33. qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
  34. -- Developer configurations: Not meant for general override
  35. buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
  36. mappings = {
  37. i = {
  38. ["<C-j>"] = actions.move_selection_next,
  39. ["<C-k>"] = actions.move_selection_previous,
  40. ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
  41. -- To disable a keymap, put [map] = false
  42. -- So, to not map "<C-n>", just put
  43. -- ["<c-x>"] = false,
  44. ["<esc>"] = actions.close,
  45. -- Otherwise, just set the mapping to the function that you want it to be.
  46. -- ["<C-i>"] = actions.select_horizontal,
  47. -- Add up multiple actions
  48. ["<CR>"] = actions.select_default + actions.center
  49. -- You can perform as many actions in a row as you like
  50. -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action,
  51. },
  52. n = {
  53. ["<C-j>"] = actions.move_selection_next,
  54. ["<C-k>"] = actions.move_selection_previous,
  55. ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
  56. -- ["<C-i>"] = my_cool_custom_action,
  57. }
  58. }
  59. }
  60. }