|
|
- local function ToggleTabs()
- local options = { "tabstop", "softtabstop", "shiftwidth" }
-
- for _, option in ipairs(options) do
- local current_value = vim.opt[option]:get()
- vim.opt[option] = (current_value == 4) and 2 or 4
- end
- end
-
- vim.api.nvim_create_user_command("ToggleTabs", ToggleTabs, { nargs = 0 })
-
- vim.api.nvim_create_user_command("ToggleDiagnostics", function()
- if vim.g.diagnostics_enable == nil or vim.g.diagnostics_enable then
- vim.g.diagnostics_enable = false
- vim.diagnostic.enable(false)
- return
- end
-
- vim.g.diagnostics_enable = true
- vim.diagnostic.enable(true)
- end, {})
-
- vim.api.nvim_create_user_command("ClearBuffers", function()
- vim.cmd('%bd|e#|bd#')
- end, {})
-
|