Waffelson@lemmy.world to linuxmemes@lemmy.world · 2 years agoWhen you realized you forgot sudolemmy.worldimagemessage-square42fedilinkarrow-up1373
arrow-up1373imageWhen you realized you forgot sudolemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 2 years agomessage-square42fedilink
minus-squareѕєχυαℓ ρσℓутσρє@lemmy.sdf.orglinkfedilinkarrow-up4·edit-22 years 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
neovimas well.I’ll also recommend adding the following to your
init.luaor some config file becausesudadoesn’t play nicely withnvim -dorvimdiff.-- Disable Suda in diff views if not vim.api.nvim_win_get_option(0, 'diff') then vim.g.suda_smart_edit = 1 endThe
vimscriptversion of the same would be: