aboutsummaryrefslogtreecommitdiff
path: root/vim.dot.link/plugin/auto_file.vim
blob: 2d46efcb0aeeea3f6c942ac3e404ac6210a3c217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
" auto_file.vim - Automatically file reading, saving; directory change {{{

" Autoread {{{
"
" http://vim.wikia.com/wiki/Have_Vim_check_automatically_if_the_file_has_changed_externally
" http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work
" http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work
"au FocusGained,BufEnter * :silent! !
"au FocusLost,WinLeave * :silent! w
" }}}

" Autosave {{{
" See https://github.com/vim-scripts/vim-auto-save
"let g:auto_save = 1
" }}}

" Auto change dir {{{
"
" Automatically set the current working directory to the current buffer file's
" directory
"
" See http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
"set autochdir
augroup changedir
  autocmd!
  autocmd BufEnter * silent! lcd %:p:h
augroup END
" }}}