augroup benieAugroup autocmd! if $TMUX !=# '' " Set tmux window option to detect when to change pane. let s:tmux_option = '@vim'.substitute($TMUX_PANE, '%', '\\%', 'g') call system('tmux set-window-option '.s:tmux_option.' 1') au VimLeave * call system('tmux set-window-option -u '.s:tmux_option) endif " Reopening a file at last curson position au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") \ | exe "normal! g'\"" | endif " Highlight conflict markers in any filetype au FileType * call matchadd('Todo', '^\(<<<<<<<\s.*\||||||||\|=======\|>>>>>>>\s.*\)$') " Update `Last change: ` on write & go back previous cursor position au FileType help au BufWritePre \ 1s/Last change: \zs.*$/\=strftime('%Y %b %d')/e|norm!`` " Read template into buffer then send line 1 to the black hold register au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _ " Attempt to expand snippet named `_template` if it exists au BufNewFile * silent! call snippet#template() " Do the same when filetype changes to help au FileType help silent! call snippet#template() augroup END