mirror of
https://github.com/andwati/dotfiles.git
synced 2026-10-18 02:52:52 +00:00
feat(nvim): auto-enter terminal mode on terminal focus
This commit is contained in:
@@ -6,3 +6,12 @@
|
||||
--
|
||||
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")
|
||||
|
||||
-- enter terminal mode whenever a terminal buffer is focused
|
||||
vim.api.nvim_create_autocmd({ "TermOpen", "BufEnter", "WinEnter" }, {
|
||||
group = vim.api.nvim_create_augroup("term_autoinsert", { clear = true }),
|
||||
pattern = "term://*",
|
||||
callback = function()
|
||||
vim.cmd("startinsert")
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user