plugins.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. })
  17. -- use native sorter for better performance
  18. require('telescope').load_extension('fzf')
  19. -- shows added/removed/changed lines
  20. require('gitsigns').setup()
  21. require('mini.statusline').setup({
  22. content = {
  23. -- copy-pasted from default, we just want to remove the icon
  24. active = function()
  25. local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
  26. local git = MiniStatusline.section_git({ trunc_width = 75, icon = '' })
  27. local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75, icon = '' })
  28. local filename = MiniStatusline.section_filename({ trunc_width = 140 })
  29. local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
  30. local location = MiniStatusline.section_location({ trunc_width = 75 })
  31. return MiniStatusline.combine_groups({
  32. { hl = mode_hl, strings = { mode } },
  33. { hl = 'MiniStatuslineDevinfo', strings = { git, diagnostics } },
  34. '%<', -- Mark general truncate point
  35. { hl = 'MiniStatuslineFilename', strings = { filename } },
  36. '%=', -- End left alignment
  37. { hl = 'MiniStatuslineFileinfo', strings = { fileinfo } },
  38. { hl = mode_hl, strings = { location } },
  39. })
  40. end
  41. },
  42. })
  43. -- delete buffer while preserving layout
  44. require('mini.bufremove').setup()
  45. -- shows a line indicating the current indentation scope
  46. require('mini.indentscope').setup()
  47. -- LSP completion and function signature display
  48. require('mini.completion').setup({
  49. delay = {
  50. -- disable autocomplete
  51. completion = 100000000,
  52. info = 100,
  53. signature = 50,
  54. },
  55. lsp_completion = {
  56. source_func = 'omnifunc',
  57. auto_setup = false,
  58. },
  59. });
  60. -- Use Treesitter for syntax highlighting
  61. require('nvim-treesitter.configs').setup({
  62. highlight = {
  63. enable = true,
  64. },
  65. })