commands.lua 797 B

12345678910111213141516171819202122232425262728
  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. [[ command! LvimToggleFormatOnSave lua require('lvim.core.autocmds').toggle_format_on_save() ]],
  19. }
  20. M.load = function(commands)
  21. for _, command in ipairs(commands) do
  22. vim.cmd(command)
  23. end
  24. end
  25. return M