Compare commits

..

No commits in common. "50cc8ae3abb21ba9bd87ca6fe271cd1d22f3b655" and "b9be6fba5a624c04878b9ff70b67a699e7710c6d" have entirely different histories.

2 changed files with 0 additions and 46 deletions

View File

@ -1,3 +0,0 @@
vim.opt.number = false
vim.opt.relativenumber = false
vim.opt.signcolumn = 'no'

View File

@ -22,46 +22,3 @@ vim.api.nvim_create_autocmd('BufRead', {
}) })
end end
}) })
-- Start terminals in insert mode
vim.api.nvim_create_autocmd('TermOpen', {
group = group, pattern = 'term://*',
callback = function()
vim.cmd [[ startinsert ]]
end
})
-- Don't show the line number column in terminal-insert mode
vim.api.nvim_create_autocmd('TermEnter', {
group = group, pattern = 'term://*',
callback = function()
vim.opt.number = false
vim.opt.relativenumber = false
vim.opt.signcolumn = 'no'
end
})
-- But do show the line number column in terminal-normal mode
vim.api.nvim_create_autocmd('TermLeave', {
group = group, pattern = 'term://*',
callback = function()
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.signcolumn = 'yes'
end
})
-- Automatically press enter when the terminal process exit successfully
vim.api.nvim_create_autocmd('TermClose', {
group = group,
pattern = 'term://*',
callback = function()
if vim.v.event.status == 0 then
-- Exit success, send enter to close the buffer
vim.api.nvim_input('<CR>')
else
-- Exit failure, enter normal mode for inspection
vim.api.nvim_input('<C-\\><C-n>')
end
end
})