4

On Kubuntu 11.04 I just installed gvim, which magically added an "open with gvim" for a bunch of text files. Great, but I would like to add another one in order to start gvim on the given file and change current working directory to the file location:

gvim -f %F -c "cd %d"

The command above works fine, but I have no idea how to make another "open with" to use the command. I don't want to make this the default, just an option. The file manager I'm using is dolphin, if that matters.

4 Answers 4

5

The KDE is using the desktop files to add the "open with" options. To add or edit the desktop files use the KDE Menu Editor.

The default application and the order of the applications is set with the File Associations. System Settings > File Associations.

1

(Comment: silly spam prevent system -> splitting the answer)

An image: http://imageshack.us/photo/my-images/3/gvim.png/.

Another option is to use the context menus. With the KDE the context menus are called service menus /3/. Both the Konqueror and the Dolphin are using the same service menus.

  1. http://techbase.kde.org/Development/Tutorials/Creating_Konqueror_Service_Menus
0

i'm not usin kde, but maybe it does the job if you select the other file-FORMAT you want gvim to open automatically, and select "open with different application" [ or at least something that sounds similar ] then select gvim, aand, at least under nautilus and thunar it does, the next time you're klickin on it, it should provide you the gvim option.

hope to help you somehow!

1
  • Unless I'm mistaking, that would allow me to change the default open with action, which I specified that I do not want. Oct 11, 2011 at 9:09
0

This one is quick and dirty, but it works for me 100%. The .desktop files are everywhere and I usually don't get them work so I've given up and do it like this:

  1. In Dolphin, right click the file you want to have a new "open with" option.
  2. Select "Open with" and "other..." from the submenu
  3. Find the program you want to have from the "open with" list
  4. Check the box "Remember application association for this type of file" and click ok.
  5. Dont' worry. When it's done, do the same, but now selecting the original default program, and make it to be remembered again. Then everything is back how it was, plus you have a new "open with " option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .