plugins.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. -- file/buffer/etc picker
  2. require('telescope').setup({
  3. defaults = {
  4. mappings = {
  5. i = {
  6. ['jj'] = 'close',
  7. ['<C-j>'] = 'move_selection_next',
  8. ['<C-k>'] = 'move_selection_previous',
  9. },
  10. },
  11. layout_config = {
  12. prompt_position = 'top',
  13. },
  14. sorting_strategy = 'ascending',
  15. },
  16. pickers = {
  17. buffers = {
  18. sort_lastused = true,
  19. sort_mru = true,
  20. },
  21. find_files = {
  22. find_command = { "fd", "--type", "f", "--strip-cwd-prefix" }
  23. },
  24. },
  25. })
  26. -- use native sorter for better performance
  27. require('telescope').load_extension('fzf')
  28. -- shows added/removed/changed lines
  29. require('gitsigns').setup()
  30. require('mini.statusline').setup({
  31. content = {
  32. -- copy-pasted from default, we just want to remove the icon
  33. active = function()
  34. local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
  35. local git = MiniStatusline.section_git({ trunc_width = 75, icon = '' })
  36. local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75, icon = '' })
  37. local filename = MiniStatusline.section_filename({ trunc_width = 140 })
  38. local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
  39. local location = MiniStatusline.section_location({ trunc_width = 75 })
  40. return MiniStatusline.combine_groups({
  41. { hl = mode_hl, strings = { mode } },
  42. { hl = 'MiniStatuslineDevinfo', strings = { git, diagnostics } },
  43. '%<', -- Mark general truncate point
  44. { hl = 'MiniStatuslineFilename', strings = { filename } },
  45. '%=', -- End left alignment
  46. { hl = 'MiniStatuslineFileinfo', strings = { fileinfo } },
  47. { hl = mode_hl, strings = { location } },
  48. })
  49. end
  50. },
  51. })
  52. -- delete buffer while preserving layout
  53. require('mini.bufremove').setup()
  54. -- shows a line indicating the current indentation scope
  55. require('mini.indentscope').setup()
  56. -- comment actions
  57. require('mini.comment').setup()
  58. -- LSP completion and function signature display
  59. require('mini.completion').setup({
  60. delay = {
  61. -- disable autocomplete
  62. completion = 100000000,
  63. info = 100,
  64. signature = 50,
  65. },
  66. lsp_completion = {
  67. source_func = 'omnifunc',
  68. auto_setup = false,
  69. },
  70. });
  71. -- Use Treesitter for syntax highlighting
  72. require('nvim-treesitter.configs').setup({
  73. highlight = {
  74. enable = true,
  75. },
  76. textobjects = {
  77. select = {
  78. enable = true,
  79. keymaps = {
  80. ['i,'] = '@parameter.inner',
  81. ['a,'] = '@parameter.outer',
  82. },
  83. },
  84. swap = {
  85. enable = true,
  86. swap_next = {
  87. ['>,'] = '@parameter.inner',
  88. },
  89. swap_previous = {
  90. ['<,'] = '@parameter.inner',
  91. },
  92. },
  93. },
  94. })