From 395bf77a2c502d6a677fa4af945b802e61380d88 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Thu, 31 Aug 2023 21:36:22 -0500 Subject: [PATCH] feat(nvim): add autocmd to set terminal opts --- dots/.config/nvim/lua/core/autocmds.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dots/.config/nvim/lua/core/autocmds.lua b/dots/.config/nvim/lua/core/autocmds.lua index 4ad4797c..02d5ae85 100644 --- a/dots/.config/nvim/lua/core/autocmds.lua +++ b/dots/.config/nvim/lua/core/autocmds.lua @@ -1,8 +1,10 @@ local M = {} M.setup = function() + local augroup = vim.api.nvim_create_augroup("user-autocmds", { clear = true }) -- NOTE: Highlight text yanked vim.api.nvim_create_autocmd("TextYankPost", { + group = augroup, callback = function() vim.highlight.on_yank() end, @@ -10,8 +12,22 @@ M.setup = function() -- NOTE: Remove trailing whitespace on save vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, command = "%s/\\s\\+$//e", }) + + + -- NOTE: Disables status column elements in Terminal buffer + vim.api.nvim_create_autocmd("TermOpen", { + group = augroup, + callback = function() + vim.api.nvim_set_option_value("statuscolumn", "", { scope = "local" }) + vim.api.nvim_set_option_value("signcolumn", "no", { scope = "local" }) + vim.api.nvim_set_option_value("number", false, { scope = "local" }) + vim.api.nvim_set_option_value("relativenumber", false, { scope = "local" }) + vim.cmd.startinsert() + end + }) end return M