summaryrefslogtreecommitdiff
path: root/config/essentials/nvim/lua/tlast/aucommands.vim
blob: 732985fa4df7e85e89e635dfe24925e746b3b38f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
" Absolute numbers if window isn't focused
augroup numbertoggle
  autocmd!
  autocmd BufEnter,FocusGained,WinEnter * if &nu | set rnu   | endif
  autocmd BufLeave,FocusLost,WinLeave   * if &nu | set nornu | endif
augroup END

" terminal specific layout
augroup neovim_terminal autocmd! 
	autocmd TermOpen * startinsert 
	autocmd TermOpen * :GitGutterBufferDisable
	autocmd TermOpen * :set nonumber norelativenumber signcolumn=no
	autocmd TermOpen * nnoremap <buffer> <C-c> i<C-c> 
augroup END

" Return to last edit position
autocmd BufReadPost *
  \ if line("'\"") > 1 && line("'\"") <= line("$") |
  \   exe "normal! g`\"" |
  \ endif