From 739102e06df4fe5bca752d1163b954603912bc98 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 24 Oct 2020 17:32:39 +0200 Subject: Make editing same file in multiple vim instances seamless --- ftdetect/polyglot.vim | 10 ++++++++++ plugin/polyglot.vim | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 49b2c894..c2a6ae17 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -8,6 +8,7 @@ if exists("did_load_polyglot") finish endif + let did_load_polyglot = 1 " Switch to compatible mode for the time being @@ -3496,6 +3497,15 @@ if !has_key(s:disabled_packages, 'sensible') " Reload unchanged files automatically. set autoread + " Disable swap, it doesn't play well with autoread + set noswapfile + + " Auto reload if file was changed somewhere else (for autoread) + augroup polyglot-sensible + au! + au CursorHold * checktime + augroup END + " Enable highlighted case-insensitive incremential search. set incsearch diff --git a/plugin/polyglot.vim b/plugin/polyglot.vim index c5074088..7143043e 100644 --- a/plugin/polyglot.vim +++ b/plugin/polyglot.vim @@ -62,6 +62,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible') == - set tabpagemax=50 endif + " Reduce updatetime from 4000 to 300 to avoid issues with coc.nvim + if &updatetime == 4000 + set updatetime=300 + endif + " Always save upper case variables to viminfo file. if !empty(&viminfo) set viminfo^=! -- cgit v1.2.3