浏览代码

nixpkgs/neovim: prevent terminal window from closing automatically

Thomas Dy 2 年之前
父节点
当前提交
419a606212
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      .config/nixpkgs/neovim/autocmd.lua

+ 6 - 0
.config/nixpkgs/neovim/autocmd.lua

@@ -7,6 +7,12 @@ vim.api.nvim_create_autocmd('TermOpen', {
   end
 })
 
+-- leave insert when terminal process exits
+-- this prevents the window from closing
+vim.api.nvim_create_autocmd('TermClose', {
+  command = 'stopinsert',
+})
+
 -- automatically enter/leave terminal mode
 vim.api.nvim_create_autocmd('TermOpen', { command = 'startinsert' })
 vim.api.nvim_create_autocmd({'WinEnter','BufWinEnter'}, {