Using terminal Vim as an external editor

This tip shows how to use Vim from within a pop-up gnome terminal as an alternative to using gvim. Because most graphical terminals accept a "command string" that is executed when they start running, the technique shown here is easily generalized to other terminal types.

vim-gnome

Many applications can be configured with an external pop-up editor, but require "popping up" to be the editor's default mode (for example, File Roller, the GNOME desktop archive editor). This is a problem when you do not have gvim installed, or when you simply prefer to use "normal" Vim from within your preferred terminal (for example, gnome-terminal).

Create a file named vim-gnome with the following contents, and place it on your execution PATH (and use chmod +x vim-gnome to make vim-gnome executable):

#!/bin/shARGS="$@"
gnome-terminal -e"vim $ARGS"

This wrapper handles passing extra arguments to Vim, so you can enter things like vim-gnome myfile.txt +42 to edit myfile.txt and jump to line 42.

Now you can use vim-gnome everywhere that you could have used gvim, or any other pop-up editor.