summary refs log tree commit diff
path: root/.vim/lua/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to '.vim/lua/utils.lua')
-rw-r--r--.vim/lua/utils.lua50
1 files changed, 25 insertions, 25 deletions
diff --git a/.vim/lua/utils.lua b/.vim/lua/utils.lua
index 271d593..1141e8d 100644
--- a/.vim/lua/utils.lua
+++ b/.vim/lua/utils.lua
@@ -4,42 +4,42 @@ local M = {}
 
 -- crutch until https://github.com/neovim/neovim/pull/13479
 M.opt = function(scope, key, val)
-	local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
-	if not ( scope and key and val ) then return end
-	scopes[scope][key] = val
-	if scope ~= 'o' then scopes['o'][key] = val end
+  local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
+  if not ( scope and key and val ) then return end
+  scopes[scope][key] = val
+  if scope ~= 'o' then scopes['o'][key] = val end
 end
 
 M.map = function(mode, lhs, rhs, opts)
-	if not ( mode and lhs and rhs ) then return end
-	local o = {noremap = true, silent = true}
-	if opts then o = vim.tbl_extend('force', o, opts) end
-	vim.api.nvim_set_keymap(mode, lhs, rhs, o)
+  if not ( mode and lhs and rhs ) then return end
+  local o = {noremap = true, silent = true}
+  if opts then o = vim.tbl_extend('force', o, opts) end
+  vim.api.nvim_set_keymap(mode, lhs, rhs, o)
 end
 
 M.augroup = function(name, autocmds)
-	if not ( name and autocmds ) then return end
-	vim.cmd('augroup ' .. name)
-	vim.cmd('autocmd!')
-	for _, au in ipairs(autocmds) do
-		vim.cmd('autocmd ' .. table.concat(au, ' '))
-	end
-	vim.cmd('augroup END')
+  if not ( name and autocmds ) then return end
+  vim.cmd('augroup ' .. name)
+  vim.cmd('autocmd!')
+  for _, au in ipairs(autocmds) do
+    vim.cmd('autocmd ' .. table.concat(au, ' '))
+  end
+  vim.cmd('augroup END')
 end
 M.augroup2 = function(tbl)
-	for name, autocmds in pairs(tbl) do
-		vim.cmd('augroup ' .. name)
-		vim.cmd('autocmd!')
-		for _, au in ipairs(autocmds) do
-			vim.cmd('autocmd ' .. table.concat(au, ' '))
-		end
-		vim.cmd('augroup END')
-	end
+  for name, autocmds in pairs(tbl) do
+    vim.cmd('augroup ' .. name)
+    vim.cmd('autocmd!')
+    for _, au in ipairs(autocmds) do
+      vim.cmd('autocmd ' .. table.concat(au, ' '))
+    end
+    vim.cmd('augroup END')
+  end
 end
 
 M.def = function(name, cmd, ...)
-	local opts = table.concat((... or {}), ' ')
-	vim.cmd('command! ' .. opts .. ' ' .. name .. ' ' .. cmd)
+  local opts = table.concat((... or {}), ' ')
+  vim.cmd('command! ' .. opts .. ' ' .. name .. ' ' .. cmd)
 end
 
 return M