Questions tagged [sudo]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
60 views

Debugging a program that requires escalated privileges

I have written a program in C that needs to access /dev/input/eventX programmatically. Running it as sudo ./a.out works well, but I am not sure how to debug it (using nvim-dap & cpptools). Here is ...
0 votes
1 answer
129 views

Color line numbers RED with SUDOEDIT

I want to have a visual feedback when editing files with root privileges. I had in my .vimrc this config " Color line numbers RED with root if $USER == 'root' highlight LineNr ctermfg=red ...
1 vote
0 answers
40 views

Can I edit compressed files using sudo?

Vim has the ability to transparently decompress files while editing them. The way I understand it, it copies the file to a temporary directory, decompresses it there, and opens the decompressed ...
2 votes
4 answers
10k views

Saving a non user file with NeoVim, eg root owned /etc/pulse/default.pa

I am using NeoVim v0.4.3. This is the latest version available in repository. I have an Arch build with the most up to date packages and kernel 5.6.4-arch1-1. Occasionally I edit a file with nvim ...
0 votes
0 answers
57 views

nvi: how to define a new command to write using sudo

In Vim, I can define the following command for writing a file using sudo: command! W :execute ':silent w !sudo tee % > /dev/null' | :edit! How do I define a similar command in nvi for saving using ...
6 votes
2 answers
10k views

How to open a file as sudo from within vim?

After opening vim as normal user. Is it possible to open a new file as sudo user? like for example in :e file.
7 votes
1 answer
1k views

How can I automate filetype detection when using sudoedit?

sudoedit/sudo -e is often used for safely editing files as root. The way it works: sudoedit copies the named files to temporary files Then it opens the temporary files using the commands specified by ...
2 votes
1 answer
1k views

How do I preserve my colorscheme when I sudo to root?

I have many users who sudo to root to edit certain files. How can I allow each of them to use their own ~/.vimrc file once they have sudo'd to root? In other words. they each want to use their own ...