commands.lua 698 B

123456789101112131415161718192021222324252627
  1. local M = {}
  2. M.defaults = {
  3. [[
  4. function! QuickFixToggle()
  5. if empty(filter(getwininfo(), 'v:val.quickfix'))
  6. copen
  7. else
  8. cclose
  9. endif
  10. endfunction
  11. ]],
  12. -- :LvimInfo
  13. [[ command! LvimInfo lua require('lvim.core.info').toggle_popup(vim.bo.filetype) ]],
  14. [[ command! LvimCacheReset lua require('lvim.utils.hooks').reset_cache() ]],
  15. [[ command! LvimUpdate lua require('lvim.bootstrap').update() ]],
  16. [[ command! LvimSyncCorePlugins lua require('lvim.plugin-loader'):sync_core_plugins() ]],
  17. [[ command! LvimReload lua require('lvim.config'):reload() ]],
  18. }
  19. M.load = function(commands)
  20. for _, command in ipairs(commands) do
  21. vim.cmd(command)
  22. end
  23. end
  24. return M