Waffelson@lemmy.world to linuxmemes@lemmy.world · 1 year agoWhen you realized you forgot sudolemmy.worldimagemessage-square39fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageWhen you realized you forgot sudolemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 1 year agomessage-square39fedilink
minus-squareBjörn Tantau@swg-empire.delinkfedilinkarrow-up0·1 year agoIs there an editor that can request root privileges without restarting it? That would be quite useful.
minus-squareBotzo@lemmy.worldlinkfedilinkarrow-up0·1 year agoIt’s a simple trick in Vim: https://stackoverflow.com/a/7078429 For the lazy: :w !sudo tee > /dev/null %
minus-squareEager Eagle@lemmy.worldlinkfedilinkEnglisharrow-up0·edit-21 year agomicro ftw, no need to even memorize a command, it’ll just ask if you want to use sudo
minus-squareh3rm17@sh.itjust.workslinkfedilinkarrow-up0·1 year agoIn vim, in normal mode you can do: :w !sudo tee %
minus-squarez3rOR0ne@lemmy.mllinkfedilinkarrow-up0·1 year 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-squaredjango@discuss.tchncs.delinkfedilinkEnglisharrow-up0·1 year agoSure, you can do this in emacs: https://fuco1.github.io/2017-04-20-Save-write-protected-files-with-sudo-automatically.html
minus-squarehex_m_hell@slrpnk.netlinkfedilinkarrow-up0·1 year agoYeah, in emacs you use tramp to open the file with /sudo:
minus-squareYodaDaCoda@sh.itjust.workslinkfedilinkEnglisharrow-up0·1 year agokate does this in KDE, but it’s not cli.
Is there an editor that can request root privileges without restarting it? That would be quite useful.
(n)vim + suda.vim.
It’s a simple trick in Vim:
https://stackoverflow.com/a/7078429
For the lazy:
:w !sudo tee > /dev/null %
micro ftw, no need to even memorize a command, it’ll just ask if you want to use sudo
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.
Sure, you can do this in emacs: https://fuco1.github.io/2017-04-20-Save-write-protected-files-with-sudo-automatically.html
i use micro
Yeah, in emacs you use
tramp
to open the file with/sudo:
kate
does this in KDE, but it’s not cli.