commands.lua 903 B

1234567891011121314151617181920212223242526272829
  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. [[ command! LvimVersion lua require('lvim.core.telescope.custom-finders').view_lunarvim_changelog() ]],
  20. }
  21. M.load = function(commands)
  22. for _, command in ipairs(commands) do
  23. vim.cmd(command)
  24. end
  25. end
  26. return M