diff options
Diffstat (limited to '.config/nvim/lua/utils.lua')
-rw-r--r-- | .config/nvim/lua/utils.lua | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/.config/nvim/lua/utils.lua b/.config/nvim/lua/utils.lua deleted file mode 100644 index d892729..0000000 --- a/.config/nvim/lua/utils.lua +++ /dev/null @@ -1,38 +0,0 @@ -local function 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!') - - 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 - -define_augroups( - {_general_settings = { - {'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'IncSearch\', timeout = 200})'}, - {'BufWinEnter', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, - {'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, - {'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, - }, - } -) - -define_augroups({ - numbertoggle = { - {'BufEnter,FocusGained,InsertLeave', '*', 'set relativenumber'}, - {'BufLeave,FocusLost,InsertEnter', '*', 'set norelativenumber'}, - }, -}) |