Waffelson@lemmy.world to linuxmemes@lemmy.world · 9 months agoWhen you realized you forgot sudolemmy.worldimagemessage-square43fedilinkarrow-up1373
arrow-up1373imageWhen you realized you forgot sudolemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 9 months agomessage-square43fedilink
minus-squareѕєχυαℓ ρσℓутσρє@lemmy.sdf.orglinkfedilinkarrow-up4·edit-29 months agoUse suda.vim for automatically dealing with such cases. Works with neovim as well. I’ll also recommend adding the following to your init.lua or some config file because suda doesn’t play nicely with nvim -d or vimdiff. -- Disable Suda in diff views if not vim.api.nvim_win_get_option(0, 'diff') then vim.g.suda_smart_edit = 1 end The vimscript version of the same would be: " Disable Suda in diff views if ! &diff let g:suda_smart_edit = 1 endif
Use suda.vim for automatically dealing with such cases. Works with
neovim
as well.I’ll also recommend adding the following to your
init.lua
or some config file becausesuda
doesn’t play nicely withnvim -d
orvimdiff
.-- Disable Suda in diff views if not vim.api.nvim_win_get_option(0, 'diff') then vim.g.suda_smart_edit = 1 end
The
vimscript
version of the same would be: