diff options
author | Justine Smithies <justine@smithies.me.uk> | 2025-02-01 15:54:42 +0000 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2025-02-01 15:54:42 +0000 |
commit | 6fe6bd334f8c006e6fc8fdf0c8a9a4181000be13 (patch) | |
tree | 4c91fcc95664ff640b6b926b7b0cbc9258f9ca7a /.config/nvim/lua/config/autocmd.lua | |
parent | 3fe8cfadba3c095565d30710be5e281780966e78 (diff) |
Initial commit of my revamped Neovim config
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>")' +}) |