Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
feat(session): automatically open as read only if session is duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
LER0ever committed May 23, 2017
1 parent e735596 commit 384deee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/core.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
source $evervim_root/core/functions.vim
" }

" Use before config if available {
" Use config if available {
if filereadable(expand("~/.EverVim.vimrc"))
source ~/.EverVim.vimrc
endif
Expand All @@ -44,6 +44,10 @@
source $evervim_root/core/formatting.vim
" }

" Session {
source $evervim_root/core/session.vim
" }

" Key (re)Mappings {
source $evervim_root/core/keymap.vim
" }
Expand Down
8 changes: 8 additions & 0 deletions core/session.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
augroup NoSimultaneousEdits
autocmd!
autocmd SwapExists * let v:swapchoice = 'o'
autocmd SwapExists * echomsg ErrorMsg
autocmd SwapExists * echo 'EverVim: Duplicate session, opening read-only ...'
autocmd SwapExists * echohl None
autocmd SwapExists * sleep 2
augroup END

0 comments on commit 384deee

Please sign in to comment.