Waffelson@lemmy.world to linuxmemes@lemmy.world · 8 months agoWhen you realized you forgot sudolemmy.worldimagemessage-square43fedilinkarrow-up1373arrow-down117
arrow-up1356arrow-down1imageWhen you realized you forgot sudolemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 8 months agomessage-square43fedilink
minus-squareѕєχυαℓ ρσℓутσρє@lemmy.sdf.orglinkfedilinkarrow-up4·edit-28 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: