nvim: Rename helpers module to util module

This commit is contained in:
Marty Oehme 2023-02-28 11:26:51 +01:00
parent 3d4199d743
commit 8d40fd843e
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
3 changed files with 2 additions and 29 deletions

View file

@ -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

View file

@ -1,8 +1,8 @@
local b = require('base16') local b = require('base16')
-- italic comments if supported -- italic comments if supported
local set_hl = require("helpers.highlight") local set_hl = require("util.highlight")
set_hl("Comment", {gui = "italic"}) set_hl("Comment", { gui = "italic" })
vim.api.nvim_set_var('gruvbox_italic', 1) vim.api.nvim_set_var('gruvbox_italic', 1)
vim.api.nvim_set_var('one_allow_italics', 1) vim.api.nvim_set_var('one_allow_italics', 1)
vim.api.nvim_set_var('pencil_terminal_italics', 1) vim.api.nvim_set_var('pencil_terminal_italics', 1)