1
0
Fork 0

cleanup nvim autocmds

This commit is contained in:
Luca Bilke 2023-12-14 13:36:19 +01:00
parent 44ff37ce34
commit 6f12e93999
2 changed files with 12 additions and 54 deletions

View File

@ -13,50 +13,6 @@ local autocmds = {
command = "if &nu | set nornu | endif"
}
},
{
"BufWritePost",
{
pattern = { "*/bookmarks/files", "*/bookmarks/directories" },
command = "!shortcuts"
}
},
{
{ "BufRead", "BufNewFile" },
{
pattern = { "Xresources", "Xdefaults", "xresources", "xdefaults" },
command = "set filetype=xdefaults"
}
},
{
"BufWritePost",
{
pattern = { "Xresources", "Xdefaults", "xresources", "xdefaults" },
command = "!xrdb %"
}
},
{
"BufWritePost",
{
pattern = "*/dwmblocks/config.h",
command = "!cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks }"
}
},
{
"BufWritePost",
{
pattern = "*.java",
callback = function()
vim.lsp.codelens.refresh()
end
}
},
-- {
-- { "BufDelete", "VimLeave" },
-- {
-- pattern = "*.tex",
-- command = "!texclear \"%:p\""
-- }
-- },
{ -- Use 'q' to quit from common plugins
'FileType',
{
@ -74,7 +30,6 @@ local autocmds = {
{
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
}

View File

@ -7,15 +7,18 @@ local ansible_test = function(path, bufnr)
return 'yaml'
end
end
local filetypes = {
{
extension = {
yml = ansible_test,
yaml = ansible_test
}
}
extension = {
yml = ansible_test,
yaml = ansible_test,
},
filename = {
["Xresources"] = "xdefaults",
["Xdefaults"] = "xdefaults",
["xresources"] = "xdefaults",
["xdefaults"] = "xdefaults",
},
}
for _, entry in pairs(filetypes) do
vim.filetype.add(entry)
end
vim.filetype.add(filetypes)