commands.lua 978 B

123456789101112131415161718192021222324252627282930
  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. [[ command! BufferKill lua require('user.bufferline').buf_kill('bd') ]],
  13. -- :LvimInfo
  14. [[ command! LvimInfo lua require('lvim.core.info').toggle_popup(vim.bo.filetype) ]],
  15. [[ command! LvimCacheReset lua require('lvim.utils.hooks').reset_cache() ]],
  16. [[ command! LvimUpdate lua require('lvim.bootstrap').update() ]],
  17. [[ command! LvimSyncCorePlugins lua require('lvim.plugin-loader'):sync_core_plugins() ]],
  18. [[ command! LvimReload lua require('lvim.config'):reload() ]],
  19. [[ command! LvimToggleFormatOnSave lua require('lvim.core.autocmds').toggle_format_on_save() ]],
  20. [[ command! LvimVersion lua require('lvim.core.telescope.custom-finders').view_lunarvim_changelog() ]],
  21. }
  22. M.load = function(commands)
  23. for _, command in ipairs(commands) do
  24. vim.cmd(command)
  25. end
  26. end
  27. return M