• h3rm17
    link
    fedilink
    arrow-up
    11
    ·
    8 months ago

    In vim, in normal mode you can do: :w !sudo tee %

    • z3rOR0ne@lemmy.ml
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      8 months ago

      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.

      • dream_weasel
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        ??? I used this in neovim twice today

        :w !sudo tee % then reload when it asks.