diff options
Diffstat (limited to '.config/nvim/lua/config/autocmd.lua')
-rw-r--r-- | .config/nvim/lua/config/autocmd.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/.config/nvim/lua/config/autocmd.lua b/.config/nvim/lua/config/autocmd.lua new file mode 100644 index 0000000..b1facb8 --- /dev/null +++ b/.config/nvim/lua/config/autocmd.lua @@ -0,0 +1,31 @@ +local autocmd = vim.api.nvim_create_autocmd -- Create autocommand + +-- Remove end of buffer ~ on buffer enter +autocmd('BufEnter', { + pattern = '*', + command = "let &fcs='eob: '" +}) + +-- Turn off line numbers on entering terminal +autocmd('TermOpen', { + pattern = '*', + command = 'setlocal nonumber norelativenumber' +}) + +-- Insert mode on entering terminal +autocmd('TermOpen', { + pattern = '*', + command = 'startinsert' +}) + +-- Close terminal buffer on process exit +autocmd('BufLeave', { + pattern = 'term://*', + command = 'stopinsert' +}) + +-- Close terminal buffer on process exit +autocmd('TermClose', { + pattern = 'term://*', + command = 'call nvim_input("<CR>")' +}) |