Waffelson@lemmy.world to linuxmemes@lemmy.world · 8 months agoWhen you realized you forgot sudolemmy.worldimagemessage-square43fedilinkarrow-up1370arrow-down118
arrow-up1352arrow-down1imageWhen you realized you forgot sudolemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 8 months agomessage-square43fedilink
minus-squareBjörn Tantau@swg-empire.delinkfedilinkarrow-up15·8 months agoIs there an editor that can request root privileges without restarting it? That would be quite useful.
minus-squareh3rm17@sh.itjust.workslinkfedilinkarrow-up11·8 months agoIn vim, in normal mode you can do: :w !sudo tee %
minus-squarez3rOR0ne@lemmy.mllinkfedilinkarrow-up3arrow-down1·8 months agoApparently that doesn’t work in NeoVim, so recently I installed the suda plugin. Personally, I just doas nvim and then the file name that needs root access, but it’s a handy plugin in case I forget.
minus-squaredream_weasel@sh.itjust.workslinkfedilinkarrow-up1·7 months ago??? I used this in neovim twice today :w !sudo tee % then reload when it asks.
minus-squaredjango@discuss.tchncs.delinkfedilinkEnglisharrow-up5·8 months agoSure, you can do this in emacs: https://fuco1.github.io/2017-04-20-Save-write-protected-files-with-sudo-automatically.html
minus-squareBotzo@lemmy.worldlinkfedilinkarrow-up5·8 months agoIt’s a simple trick in Vim: https://stackoverflow.com/a/7078429 For the lazy: :w !sudo tee > /dev/null %
minus-squarehex_m_hell@slrpnk.netlinkfedilinkarrow-up4·edit-28 months agoYeah, in emacs you use tramp to open the file with /sudo::
minus-squareYodaDaCoda@sh.itjust.workslinkfedilinkEnglisharrow-up4·8 months agokate does this in KDE, but it’s not cli.
minus-squareEager Eagle@lemmy.worldlinkfedilinkEnglisharrow-up4·edit-28 months agomicro ftw, no need to even memorize a command, it’ll just ask if you want to use sudo
Is there an editor that can request root privileges without restarting it? That would be quite useful.
In vim, in normal mode you can do:
:w !sudo tee %
Apparently that doesn’t work in NeoVim, so recently I installed the suda plugin.
Personally, I just doas nvim and then the file name that needs root access, but it’s a handy plugin in case I forget.
??? I used this in neovim twice today
:w !sudo tee %
then reload when it asks.i use micro
Sure, you can do this in emacs: https://fuco1.github.io/2017-04-20-Save-write-protected-files-with-sudo-automatically.html
It’s a simple trick in Vim:
https://stackoverflow.com/a/7078429
For the lazy:
:w !sudo tee > /dev/null %
Yeah, in emacs you use
tramp
to open the file with/sudo::
kate
does this in KDE, but it’s not cli.micro ftw, no need to even memorize a command, it’ll just ask if you want to use sudo
(n)vim + suda.vim.