From 6fe6bd334f8c006e6fc8fdf0c8a9a4181000be13 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Sat, 1 Feb 2025 15:54:42 +0000 Subject: Initial commit of my revamped Neovim config --- .config/nvim/lua/config/autocmd.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .config/nvim/lua/config/autocmd.lua (limited to '.config/nvim/lua/config/autocmd.lua') 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("")' +}) -- cgit v1.2.3