I want to set vim (not gvim, not vi) as standard text editor. In the net there are the following suggestions to associate programs with file types.
- use sudo update-alternatives --config editor link
- doing something with .desktop files link
- use mimeopen -d vim link
I am using Ubuntu 14.04 and nemo as file manager. When I tried update-alternatives I got the following prompt:
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/vim.gnome 60 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
* 3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.gnome 60 manual mode
5 /usr/bin/vim.tiny 10 manual mode
Press enter to keep the current choice[*], or type selection number:
Unfortunately nothing changed after I selected option 3. Then I tried the second method with the desktop-files. It works great for txt-files, but not for .tex files. Then I tried to associate .tex files via
mimeopen -d *.tex
Please choose a default application for files of type text/x-tex
1) vim (vim-usercreated-1)
2) Texmaker (texmaker)
3) SecureDownloadManager (wine-extension-sdx)
4) notepad (wine-extension-txt)
5) LibreOffice Writer (libreoffice-writer)
6) gedit (gedit)
7) Geany (geany)
8) GVim (gvim)
9) Other...
The prompt I answered simple with "vim" as you can see in the first item of the list. Since then everytime a .swp file is created after opening the .tex-file in nemo, without showing me anything of the vim terminal. So it is kind of running but it does not show up on screen. When I open the tex file with a command like xdg-open I get a warning "Vim: Warning: Input is not from a terminal".
On the net I could not find any more options to accomplish this file association. Please help me :)