summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/core/commands.lua
blob: bb22dea12ea58a385912fbaff859d1eddc0a8b5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local M = {}

M.defaults = {
  [[
  function! QuickFixToggle()
    if empty(filter(getwininfo(), 'v:val.quickfix'))
      copen
    else
      cclose
    endif
  endfunction
  ]],
  -- :NvimInfo
  [[ command! NvimInfo lua require('core.info').toggle_popup(vim.bo.filetype) ]],
  [[ command! NvimCacheReset lua require('utils.hooks').reset_cache() ]],
  [[ command! NvimUpdate lua require('bootstrap').update() ]],
  [[ command! NvimSyncCorePlugins lua require('plugin-loader'):sync_core_plugins() ]],
  [[ command! NvimReload lua require('config'):reload() ]],
  [[ command! NvimToggleFormatOnSave lua require('core.autocmds').toggle_format_on_save() ]],
}

M.load = function(commands)
  for _, command in ipairs(commands) do
    vim.cmd(command)
  end
end

return M