From 8d40fd843e741223ccefe16975319092461a7705 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 28 Feb 2023 11:26:51 +0100 Subject: [PATCH] nvim: Rename helpers module to util module --- nvim/.config/nvim/lua/helpers/augroup.lua | 27 ------------------- nvim/.config/nvim/lua/look.lua | 4 +-- .../nvim/lua/{helpers => util}/highlight.lua | 0 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 nvim/.config/nvim/lua/helpers/augroup.lua rename nvim/.config/nvim/lua/{helpers => util}/highlight.lua (100%) diff --git a/nvim/.config/nvim/lua/helpers/augroup.lua b/nvim/.config/nvim/lua/helpers/augroup.lua deleted file mode 100644 index b0ea4cb..0000000 --- a/nvim/.config/nvim/lua/helpers/augroup.lua +++ /dev/null @@ -1,27 +0,0 @@ --- augroup utility function --- --- Let's you create and use autogroups through lua --- which (as of now) is not possible through official nvim api --- --- Cribbed from the very helpful https://icyphox.sh/blog/nvim-lua - Thank you! --- --- Example usage settings.lua --- local cmd = vim.cmd --- local u = require('utils') --- u.create_augroup({ --- { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' }, --- { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' }, --- }, 'ftmail') --- cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif') - -local cmd = vim.cmd - - -return function(cmds, groupname) - cmd('augroup ' .. groupname) - cmd('autocmd!') - for _, autocmd in ipairs(cmds) do - cmd('autocmd ' .. table.concat(autocmd, ' ')) - end - cmd('augroup END') -end diff --git a/nvim/.config/nvim/lua/look.lua b/nvim/.config/nvim/lua/look.lua index 5ed11d2..88c94fb 100644 --- a/nvim/.config/nvim/lua/look.lua +++ b/nvim/.config/nvim/lua/look.lua @@ -1,8 +1,8 @@ local b = require('base16') -- italic comments if supported -local set_hl = require("helpers.highlight") -set_hl("Comment", {gui = "italic"}) +local set_hl = require("util.highlight") +set_hl("Comment", { gui = "italic" }) vim.api.nvim_set_var('gruvbox_italic', 1) vim.api.nvim_set_var('one_allow_italics', 1) vim.api.nvim_set_var('pencil_terminal_italics', 1) diff --git a/nvim/.config/nvim/lua/helpers/highlight.lua b/nvim/.config/nvim/lua/util/highlight.lua similarity index 100% rename from nvim/.config/nvim/lua/helpers/highlight.lua rename to nvim/.config/nvim/lua/util/highlight.lua