feat(nvim): add autocmd to set terminal opts
This commit is contained in:
parent
7fb445b742
commit
395bf77a2c
@ -1,8 +1,10 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.setup = function()
|
M.setup = function()
|
||||||
|
local augroup = vim.api.nvim_create_augroup("user-autocmds", { clear = true })
|
||||||
-- NOTE: Highlight text yanked
|
-- NOTE: Highlight text yanked
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
|
group = augroup,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank()
|
vim.highlight.on_yank()
|
||||||
end,
|
end,
|
||||||
@ -10,8 +12,22 @@ M.setup = function()
|
|||||||
|
|
||||||
-- NOTE: Remove trailing whitespace on save
|
-- NOTE: Remove trailing whitespace on save
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
group = augroup,
|
||||||
command = "%s/\\s\\+$//e",
|
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
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
Loading…
Reference in New Issue
Block a user