diff options
| Commit | a6d084fe44090fd32e33ab828aae6c8198cfdd8c (patch) | |
|---|---|---|
| Author | 2024-08-06 16:41:25 +0300 | |
| Committer | 2024-08-06 16:41:25 +0300 | |
| Files | bc02346a52bb29dc83086ce88aaeee1ebe5b198a /lua/filetype.lua | |
| anderson-a6d084fe44090fd32e33ab828aae6c8198cfdd8c.tar anderson-a6d084fe44090fd32e33ab828aae6c8198cfdd8c.tar.gz anderson-a6d084fe44090fd32e33ab828aae6c8198cfdd8c.zip | ||
| Parent | 29e8d258719ab47cf79ad881a8292c846d7a5d4f (diff) | |
feat(filetype): Move and improve terminal mode autoinsert
1 files changed, 6 insertions, 3 deletions
| -rw-r--r-- | lua/filetype.lua | 9 |
diff --git a/lua/filetype.lua b/lua/filetype.lua index 9e83e0c..9f7e2b3 100644 --- a/lua/filetype.lua +++ b/lua/filetype.lua @@ -1,8 +1,11 @@ --[=[ Terminal buffers ]=]-- -vim.api.nvim_create_autocmd("TermOpen", { - command = "setlocal nonu | startinsert" -}) +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("TermClose", { command = "quit!" }) |
