Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
better condition on recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
thaerkh committed May 29, 2023
1 parent a9ae9ce commit c0d1e43
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
```
```vim
" Feel free to use this alternative to the plugin's core autosave and session management features:
au BufLeave,CursorHold,CursorHoldi,FocusLost * if (&buftype == '') | do BufWritePre | silent! update | do BufWritePost | endif
au VimEnter * nested if (len(v:argv) == 1) | silent! source Session.vim | mksession! | endif
" Autosave
set noswapfile
au BufLeave,CursorHold,FocusLost * if(getbufinfo('%')[0].changed) | do BufWritePre | sil! up | do BufWritePost | endif
" Autosession
au VimEnter * nested if (len(v:argv) == 1) | silent! source Session.vim | endif
au VimLeave * if (len(v:argv) == 1) | mksession! | endif
" available since v8.1.2233 (2019-10-28), v:argv doubles for both stdin and argful cases (instead of argc() and a StdinReadPre autocmd flag)
" v:argv length check may need to be 2 if using Neovim since it includes an --embed argument on launch
" v:argv doubles for both stdin and argful cases (instead of argc() and a StdinReadPre autocmd flag)
```
---
<p align="center">
Expand Down

0 comments on commit c0d1e43

Please sign in to comment.