mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-04 10:05:37 +02:00
start formatting rules
This commit is contained in:
parent
b461c878e6
commit
9f511bcb59
65 changed files with 2829 additions and 2812 deletions
|
@ -1,27 +1,25 @@
|
|||
local lv_utils = {}
|
||||
|
||||
function lv_utils.define_augroups(definitions) -- {{{1
|
||||
-- Create autocommand groups based on the passed definitions
|
||||
--
|
||||
-- The key will be the name of the group, and each definition
|
||||
-- within the group should have:
|
||||
-- 1. Trigger
|
||||
-- 2. Pattern
|
||||
-- 3. Text
|
||||
-- just like how they would normally be defined from Vim itself
|
||||
for group_name, definition in pairs(definitions) do
|
||||
vim.cmd('augroup ' .. group_name)
|
||||
vim.cmd('autocmd!')
|
||||
-- Create autocommand groups based on the passed definitions
|
||||
--
|
||||
-- The key will be the name of the group, and each definition
|
||||
-- within the group should have:
|
||||
-- 1. Trigger
|
||||
-- 2. Pattern
|
||||
-- 3. Text
|
||||
-- just like how they would normally be defined from Vim itself
|
||||
for group_name, definition in pairs(definitions) do
|
||||
vim.cmd("augroup " .. group_name)
|
||||
vim.cmd "autocmd!"
|
||||
|
||||
for _, def in pairs(definition) do
|
||||
local command = table.concat(vim.tbl_flatten {'autocmd', def}, ' ')
|
||||
vim.cmd(command)
|
||||
end
|
||||
|
||||
vim.cmd('augroup END')
|
||||
for _, def in pairs(definition) do
|
||||
local command = table.concat(vim.tbl_flatten { "autocmd", def }, " ")
|
||||
vim.cmd(command)
|
||||
end
|
||||
|
||||
vim.cmd "augroup END"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return lv_utils
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue