From 7810506cd25872acb74bf82ec57f2fdea17ace32 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Tue, 21 Feb 2023 19:24:26 +0100 Subject: [PATCH] remove obsolete files --- .config/nvim/lua/config/autocmdlist.lua | 120 ----------------------- .config/nvim/lua/config/filetypelist.lua | 28 ------ 2 files changed, 148 deletions(-) delete mode 100644 .config/nvim/lua/config/autocmdlist.lua delete mode 100644 .config/nvim/lua/config/filetypelist.lua diff --git a/.config/nvim/lua/config/autocmdlist.lua b/.config/nvim/lua/config/autocmdlist.lua deleted file mode 100644 index d2d2e039..00000000 --- a/.config/nvim/lua/config/autocmdlist.lua +++ /dev/null @@ -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 q :close - 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 | 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 diff --git a/.config/nvim/lua/config/filetypelist.lua b/.config/nvim/lua/config/filetypelist.lua deleted file mode 100644 index 37030a84..00000000 --- a/.config/nvim/lua/config/filetypelist.lua +++ /dev/null @@ -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