Monday, May 23, 2011

Re: make terminal VIM my default text editor Ubuntu 11.04

On 2011-05-23, Juan incaurgarat wrote:
> hi, ive spent the last two working days trying to make terminal VIM my default
> text editor with no luck.
> im using ubuntu 1104 and i dont like GVIM
>
> what ive done so far:
> created a vim.desktop file on ~/.local/share/applications with this lines
> inside
>
> [Desktop Entry]
> Version=1.0
> Type=Application
> Name=VIM
> #Exec=/usr/share/vim/vim73/tools/vimm
> Exec=gnome-terminal -e "vim \"$1\""
>
> after that, ive edited the mimeapps.list file
> and now it looks like this
>
> [Added Associations]
> text/csv=openoffice.org-calc.desktop;gedit.desktop;
> openoffice.org-writer.desktop;
> application/vnd.ms-powerpoint=evince.desktop;libreoffice-impress.desktop;
> application/illustrator=gimp.desktop;
> application/x-shockwave-flash=totem.desktop;vlc.desktop;firefox.desktop;
> text/plain=vim.desktop;userapp-vim-0QYSVV.desktop;
> userapp-vim.gnome-DY1RVV.desktop;
>
> [Default Applications]
> application/vnd.ms-powerpoint=libreoffice-impress.desktop
> text/plain=vim.desktop
>
> the bold line is the one ive added
>
> so, this changes makes VIM execute when i double click on a plain text file,
> but it doesnt open the file ive just clicked
> it seems to open a new file called $1
>
> this is the closest ive got
>
> any help please?

I don't know if this will help because I can't test it at the
moment, but I searched through some customizations I had made under
~/.local/share/applications and found this snippet:

[Desktop Entry]
Comment=Powerful text editor with scripting functions and macro recorder
Exec=/home/gajohnso/bin/gvim -f %f
...

Note that the name used by the shell for the file name is %f, not
$1.


Many people on this list read only the plain text part of messages
to the list, not the HTML part. Consequently, they won't see any
HTML embellishments such as bold. It's best to use some other means
such as as an ASCII arrow (<--) to point out specific lines.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: