2

While trying to make vim default instead of gedit, I found this could be done two ways:

Use defaults.list and make text/plain (and others) point to vim.desktop (what is the format for creating .desktop files?)

Use update-alternatives and change gnome-text-editor (right now it has only one alternative, so I guess I have to install one more. How to do that?)

and which is the better way to do it?

Jorge Castro
  • 73,717
N 1.1
  • 643

2 Answers2

4

OP fixed the problem here:

Ok, I have created vim.desktop in ~/.local/share/applications and modified defaults.list (in the same dir) to include

text/plain=vim.desktop

After that, sudo update-mime and its working! (I am not sure whether this step is require)

Clicking on a text file opens vim, not gvim, in terminal and :q closes the terminal too.

Jorge Castro
  • 73,717
-1

For a graphical environment I use something like this:

Open Nautilus-RightClick on desired File-Properties-Open with...-Select

Then point to a simple wrapper, e.g.

#!/bin/bash
gnome-terminal.wrapper -e vim $*

It's not a global solution, though.

Clausi
  • 5,057