aboutsummaryrefslogblamecommitdiff
path: root/.config/nvim/lua/config/autocmd.lua
blob: b1facb82fe6e0cd9e5cbf3e28b981bd24f51b3df (plain) (tree)






























                                                                   
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>")'
})