Régis B. wrote:
Hello there,
I use gVim on a Linux computer (KUbuntu), and I am trying to launch a
program from inside gvim with the !start command, so for instance:

:!start kdvi
or
:!start /usr/bin/kdvi

But I get the following error:
start: need to be root
shell returned 1

So obviously I need to be root to execute commands from inside gvim, which
is extremely weird.

You guys have any idea how to solve this?

Thanks
Régis B.
From my help files, (:help :!start) I see that :!start is an MS Windows-specific command. Check out

:help :!

for unix-specific alternatives. You will probably have to set 'shellcmdflag' to -ic in order to get an asyncronous shell.

Now, assuming you actually want to execute the "start" linux command:

If you have sudo installed on your system, you can execute commands as a different user. So you would go:

:!sudo start kdvi

in order to run kdvi as root. You will be prompted for the root password, after which kdvi will run as root. Note that this probably requires running Vim in a terminal of some sort. Remember to set 'shellcmdflag' as needed.

You could also use an X sudo program like kdesu (more fitting, since you're running KDE) or gksudo, both of which use a popup dialog to prompt for the password. This you can then couple with Gvim.

See

http://en.wikipedia.org/wiki/Sudo

for more detail about sudo. Also note that an incorrectly configured sudo setup could be insecure.

There should also be a way, probably using piped commands, to do something similar with su, but I can not confirm that right now (sending from an XP box).

HTH

--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | <http://counter.li.org>

Reply via email to