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

Commit c0d1e43

Browse files
committed
better condition on recommendation
1 parent a9ae9ce commit c0d1e43

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
```
44
```vim
55
" Feel free to use this alternative to the plugin's core autosave and session management features:
6-
au BufLeave,CursorHold,CursorHoldi,FocusLost * if (&buftype == '') | do BufWritePre | silent! update | do BufWritePost | endif
7-
au VimEnter * nested if (len(v:argv) == 1) | silent! source Session.vim | mksession! | endif
6+
7+
" Autosave
8+
set noswapfile
9+
au BufLeave,CursorHold,FocusLost * if(getbufinfo('%')[0].changed) | do BufWritePre | sil! up | do BufWritePost | endif
10+
11+
" Autosession
12+
au VimEnter * nested if (len(v:argv) == 1) | silent! source Session.vim | endif
813
au VimLeave * if (len(v:argv) == 1) | mksession! | endif
14+
" 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)
915
" v:argv length check may need to be 2 if using Neovim since it includes an --embed argument on launch
10-
" v:argv doubles for both stdin and argful cases (instead of argc() and a StdinReadPre autocmd flag)
1116
```
1217
---
1318
<p align="center">

0 commit comments

Comments
 (0)