feat: add back autocmd insert mode on terminal open

This commit is contained in:
Simon Lasbrugnas 2024-12-09 22:04:06 +01:00
parent ac0200734b
commit 2d648650d0
Signed by untrusted user who does not match committer: simon
GPG key ID: 86039876BA6ED8DE
2 changed files with 10 additions and 0 deletions

View file

@ -1,5 +1,6 @@
require("config.options") require("config.options")
require("config.keymaps") require("config.keymaps")
require("config.autocmds")
-- Boostrap lazy.nvim -- Boostrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

9
lua/config/autocmds.lua Normal file
View file

@ -0,0 +1,9 @@
-- Auto insert mode on TermOpen
vim.api.nvim_create_autocmd({ "TermOpen", "BufEnter" }, {
pattern = { "*" },
callback = function()
if vim.opt.buftype:get() == "terminal" then
vim.cmd(":startinsert")
end
end
})