1
0
Fork 0

remove obsolete files

This commit is contained in:
Luca Bilke 2023-02-21 19:24:26 +01:00
parent a1177eafcd
commit 7810506cd2
2 changed files with 0 additions and 148 deletions

View File

@ -1,120 +0,0 @@
local cmds = {
{ -- Handles the automatic line numeration changes
{ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" },
{
pattern = "*",
command = "if &nu && mode() != \"i\" | set rnu | endif"
}
},
{ -- Handles the automatic line numeration changes
{ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" },
{
pattern = "*",
command = "if &nu | set nornu | endif"
}
},
{
"BufWritePost",
{
pattern = { "bm-files", "bm-dirs" },
command = "!shortcuts"
}
},
{
{ "BufRead", "BufNewFile" },
{
pattern = { "Xresources", "Xdefaults", "xresources", "xdefaults" },
command = "set filetype=xdefaults"
}
},
{
"BufWritePost",
{
pattern = { "Xresources", "Xdefaults", "xresources", "xdefaults" },
command = "!xrdb %"
}
},
{
"BufWritePost",
{
pattern = "~/.local/src/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',
{
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" },
callback = function()
vim.cmd [[
nnoremap <silent> <buffer> q :close<CR>
set nobuflisted
]]
end
}
},
{
'Filetype',
{
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
}
},
{ -- Automatically apply changes to plugins.lua
'BufWritePost',
{
group = 'packer_user_config',
pattern = { "plugins.lua", "pluginlist.lua" },
command = "source <afile> | PackerCompile"
}
},
{ -- Fix auto comment
'BufWinEnter',
{
callback = function()
vim.cmd("set formatoptions-=cro")
end
}
},
{ -- Highlight yanked text
'TextYankPost',
{
callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
end
}
}
}
vim.api.nvim_create_augroup('packer_user_config', { clear = true })
for _, entry in ipairs(cmds) do
local event = entry[1]
local opts = entry[2]
if type(opts.group) == "string" and opts.group ~= "" then
local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group })
if not exists then
vim.api.nvim_create_augroup(opts.group, {})
end
end
vim.api.nvim_create_autocmd(event, opts)
end

View File

@ -1,28 +0,0 @@
local filetypes = {
{
extension = {
yml = function(path, bufnr)
if vim.fs.find({ 'tasks', 'roles', 'handlers', 'group_vars', 'host_vars' },
{ type = 'directory', upward = true }) and
vim.fs.find({ 'ansible.cfg', '.ansible-lint' }, { upward = true }) then
return 'yaml.ansible'
else
return 'yaml'
end
end,
yaml = function(path, bufnr)
if vim.fs.find({ 'tasks', 'roles', 'handlers', 'group_vars', 'host_vars' },
{ type = 'directory', upward = true }) and
vim.fs.find({ 'ansible.cfg', '.ansible-lint' }, { upward = true }) then
return 'yaml.ansible'
else
return 'yaml'
end
end
}
}
}
for _, entry in pairs(filetypes) do
vim.filetype.add(entry)
end