Skip to content

Commit

Permalink
.vimrc: auto save every 5 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
jduan committed Sep 24, 2024
1 parent a837a7b commit ccdee49
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dotfiles/.config/jgit/config
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[filesystem "Azul Systems, Inc.|21.0.3|/dev/disk3s1"]
timestampResolution = 3000 nanoseconds
minRacyThreshold = 0 nanoseconds
[filesystem "Azul Systems, Inc.|21.0.4|/dev/disk3s1"]
timestampResolution = 8000 nanoseconds
minRacyThreshold = 0 nanoseconds
13 changes: 13 additions & 0 deletions dotfiles/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,16 @@ nnoremap <leader>d "=strftime("%Y/%m/%d")<CR>P
" execute bash script
nnoremap <leader>r :!bash %<CR>
"""" autosave all buffers periodically """"
function! AutosaveAllBuffers(timer)
" Check if the buffer is modified, and if so, write it
silent! wa
endfunction

" Autosave every 5 minutes (300000 milliseconds)
let g:autosave_interval = 300 * 1000

" Start the timer to periodically autosave
autocmd VimEnter * let g:autosave_timer = timer_start(g:autosave_interval, 'AutosaveAllBuffers', {'repeat': -1})
"""" autosave all buffers periodically """"

0 comments on commit ccdee49

Please sign in to comment.