]> git.sev.monster Git - dotfiles.git/commitdiff
vimrc: suda settings can be buffer-local now
authorsev <git@sev.monster>
Thu, 5 Dec 2024 21:06:14 +0000 (15:06 -0600)
committersev <git@sev.monster>
Thu, 5 Dec 2024 21:06:14 +0000 (15:06 -0600)
etc/vim/.vimrc

index 9e1a6cdace1751b80af32d5a6cc5408d948e6126..b59d19e4f9bb37e2818d75376c40e958c722d98c 100644 (file)
@@ -184,21 +184,21 @@ endif
 " re-enable backup, swap, undo for suda buffers that we can read
 " https://github.com/lambdalisue/vim-suda/issues/25
 function s:SudaSettingsSave()
-    let g:sev_suda_backup = &backup
-    let g:sev_suda_swapfile = &swapfile
-    let g:sev_suda_undofile = &undofile
+    let b:sev_suda_backup = &backup
+    let b:sev_suda_swapfile = &swapfile
+    let b:sev_suda_undofile = &undofile
 endfunction
 function s:SudaSettingsRestore()
     if filereadable(expand('<afile>')[7:])
-        if exists('g:sev_suda_backup') && g:sev_suda_backup
+        if exists('b:sev_suda_backup') && b:sev_suda_backup
             " XXX: suda.vim uses setlocal for this, even though it's global...
             "      https://github.com/lambdalisue/vim-suda/issues/85
             setlocal backup
         endif
-        if exists('g:sev_suda_swapfile') && g:sev_suda_swapfile
+        if exists('b:sev_suda_swapfile') && b:sev_suda_swapfile
             setlocal swapfile
         endif
-        if exists('g:sev_suda_undofile') && g:sev_suda_undofile
+        if exists('b:sev_suda_undofile') && b:sev_suda_undofile
             setlocal undofile
         endif
     endif
This page took 0.062316 seconds and 4 git commands to generate.