From ce7fda37518dbb896184b142a7f22c246261437a Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 6 Aug 2024 17:53:21 +0300 Subject: feat(filetype): Further simplify terminal autoinsert Use pattern/command properties instead of manual callback --- lua/filetype.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lua/filetype.lua') diff --git a/lua/filetype.lua b/lua/filetype.lua index 9f7e2b3..c814a3b 100644 --- a/lua/filetype.lua +++ b/lua/filetype.lua @@ -1,11 +1,9 @@ --[=[ Terminal buffers ]=]-- -vim.api.nvim_create_autocmd({ "TermOpen", "BufEnter" }, { callback = function (ev) - if vim.bo.buftype == "terminal" then - vim.wo.number = false - vim.cmd("startinsert") - end -end }) +vim.api.nvim_create_autocmd({ "TermOpen", "BufEnter" }, { + pattern = "term://*", + command = "setlocal nonu | startinsert", +}) vim.api.nvim_create_autocmd("TermClose", { command = "quit!" }) -- cgit v1.3.1-23-gd82d