@Waffelson@lemmy.world to linuxmemes@lemmy.world • 3 months agoWhen you realized you forgot sudolemmy.worldimagemessage-square43fedilinkarrow-up1373arrow-down117
arrow-up1356arrow-down1imageWhen you realized you forgot sudolemmy.world@Waffelson@lemmy.world to linuxmemes@lemmy.world • 3 months agomessage-square43fedilink
minus-square@huginn@feddit.itlinkfedilink26•3 months agoLazy vim way I do it: ggVG"wY:q! followed by sudo !! then VG"wp:x Grab entire file and stuff it in register W Exit file Reopen sudo Select all and replace with register W them write
minus-square@rtxn@lemmy.worldlinkfedilinkEnglish28•3 months agoNow I understand how the Adeptus Mechanicus feel when they perform a ritual power-on.
minus-square@huginn@feddit.itlinkfedilink10•3 months agoIt’s funny how years of use make that so intuitive but spelled out it’s a garbled mess
minus-square@huginn@feddit.itlinkfedilink2•3 months agoYeah learning about tee from this thread honestly. It’s been interesting realizing I had such a useful tool at my disposal but never knew
Lazy vim way I do it:
ggVG"wY:q!
followed bysudo !!
thenVG"wp:x
Grab entire file and stuff it in register W
Exit file
Reopen sudo
Select all and replace with register W them write
Now I understand how the Adeptus Mechanicus feel when they perform a ritual power-on.
It’s funny how years of use make that so intuitive but spelled out it’s a garbled mess
Lazier way:
:w !sudo tee %
Yeah learning about
tee
from this thread honestly.It’s been interesting realizing I had such a useful tool at my disposal but never knew