From P J, 9 Months ago, written in Lua.
Embed
  1. require('plugin') -- packer plugin-manager
  2.  
  3. local plugins = {
  4.         'cmp',             -- lsp setup
  5.         'mason',           -- lsp installer
  6.         'mason.tools',     -- auto lsp installer
  7.         'symbols-outline', -- symbols
  8.         'colorizer',       -- render colors
  9.         'lualine',         -- status line
  10.         'treesitter',      -- treesitter settings
  11.         'which-key',       -- show keybinds
  12.         'gitsigns',        -- show `git diff` in line-number
  13.         'telescope',       -- Telescope
  14.         'undotree',        -- undotree
  15.         'venn',            -- draw ascii diagram
  16.         'truezen',         -- zen-mode: focus
  17.         'autopairs',
  18. -- tmp {{{
  19. --      'lsp',             -- lsp usage configs
  20. --      'null-ls',         -- null-ls
  21. --      'cmp.bashls',
  22. --      'cmp.clangd',
  23. --      'cmp.gopls',
  24. --      'cmp.html-css',
  25. --      'cmp.lua_ls',
  26. --      'cmp.pyright',
  27. --      'cmp.texlab',
  28. --      'nvimtree',        -- nvim-tree
  29. --      'toggleterm',      -- ToggleTerm
  30. --      'alpha',           -- greetings at empty buffers
  31. --      'comment',         -- comment handler config
  32. ---- these modules are in `lua/module/.tmp/`
  33. --      'trouble',      -- debug adapter protocol
  34. --      'harpoon',      -- new filebuffer
  35. --      'git-worktree', -- git worktree
  36. --      'neotree',      -- NeoTree
  37. --      'notify',       -- notification manager
  38. -- }}}
  39. }
  40.  
  41.  
  42. local function plugthem(pluglist)
  43.         for _,name in ipairs(pluglist) do
  44.                 local plugname = 'plugin.'..name
  45.                 local stat = pcall(require, plugname)
  46.                 if stat == false then
  47.                         vim.notify(name..' is not installed or has a syntax error',
  48.                                    3, {title = 'plugthem()'})
  49. --                      vim.cmd ':PackerInstall'{{{
  50. --                      if name == 'mason' then
  51. --                              vim.cmd ':MasonUpdate'
  52. --                      elseif name == 'treesitter' then
  53. --                              vim.cmd ':TSUpdate'
  54. --                      end}}}
  55.                 else
  56.                         require(plugname)
  57.                 end
  58.         end
  59. end
  60.  
  61. plugthem(plugins)
captcha