lua format
This commit is contained in:
@ -3,7 +3,7 @@ function nvim_create_augroups(definitions)
|
||||
vim.cmd('augroup ' .. group_name)
|
||||
vim.cmd('autocmd!')
|
||||
for _, def in ipairs(definition) do
|
||||
local command = table.concat(vim.tbl_flatten{'autocmd', def}, ' ')
|
||||
local command = table.concat(vim.tbl_flatten({ 'autocmd', def }), ' ')
|
||||
vim.cmd(command)
|
||||
end
|
||||
vim.cmd('augroup END')
|
||||
@ -11,35 +11,34 @@ function nvim_create_augroups(definitions)
|
||||
end
|
||||
|
||||
local autocmds = {
|
||||
packer = {
|
||||
{ 'BufWritePost', 'plugins.lua', 'PackerCompile' };
|
||||
};
|
||||
restore_cursor = {
|
||||
{ 'BufRead', '*', [[call setpos(".", getpos("'\""))]] };
|
||||
};
|
||||
save_shada = {
|
||||
{'FocusGained,FocusLost', '*', 'rshada|wshada'};
|
||||
};
|
||||
resize_windows_proportionally = {
|
||||
{ 'VimResized', '*', ':wincmd =' };
|
||||
};
|
||||
lua_highlight = {
|
||||
{ 'TextYankPost', '*', [[silent! lua vim.highlight.on_yank() {higroup='IncSearch', timeout=400}]] };
|
||||
};
|
||||
file_type = {
|
||||
{'BufRead,BufNewFile', '*.simvis', 'set filetype=xml'};
|
||||
{'BufRead,BufNewFile', '*.simcfg,*.simcon,*.simudex', 'set filetype=cfg'};
|
||||
{'BufRead,BufNewFile', 'Jenkinsfile*', 'set filetype=groovy'};
|
||||
{'BufRead,BufNewFile', '*.manifest', 'set filetype=xml'};
|
||||
{'BufRead,BufNewFile', 'SConstruct,SConscript', 'set filetype=python'};
|
||||
};
|
||||
file_changed = {
|
||||
{'BufEnter,FocusGained', '*', 'checktime'};
|
||||
};
|
||||
no_auto_comment = {
|
||||
{'BufEnter', '*', 'set fo-=c fo-=r fo-=o'}
|
||||
}
|
||||
packer = {
|
||||
{ 'BufWritePost', 'plugins.lua', 'PackerCompile' },
|
||||
},
|
||||
restore_cursor = {
|
||||
{ 'BufRead', '*', [[call setpos(".", getpos("'\""))]] },
|
||||
},
|
||||
save_shada = {
|
||||
{ 'FocusGained,FocusLost', '*', 'rshada|wshada' },
|
||||
},
|
||||
resize_windows_proportionally = {
|
||||
{ 'VimResized', '*', ':wincmd =' },
|
||||
},
|
||||
lua_highlight = {
|
||||
{ 'TextYankPost', '*', [[silent! lua vim.highlight.on_yank() {higroup='IncSearch', timeout=400}]] },
|
||||
},
|
||||
file_type = {
|
||||
{ 'BufRead,BufNewFile', '*.simvis', 'set filetype=xml' },
|
||||
{ 'BufRead,BufNewFile', '*.simcfg,*.simcon,*.simudex', 'set filetype=cfg' },
|
||||
{ 'BufRead,BufNewFile', 'Jenkinsfile*', 'set filetype=groovy' },
|
||||
{ 'BufRead,BufNewFile', '*.manifest', 'set filetype=xml' },
|
||||
{ 'BufRead,BufNewFile', 'SConstruct,SConscript', 'set filetype=python' },
|
||||
},
|
||||
file_changed = {
|
||||
{ 'BufEnter,FocusGained', '*', 'checktime' },
|
||||
},
|
||||
no_auto_comment = {
|
||||
{ 'BufEnter', '*', 'set fo-=c fo-=r fo-=o' },
|
||||
},
|
||||
}
|
||||
|
||||
nvim_create_augroups(autocmds)
|
||||
|
||||
|
Reference in New Issue
Block a user