sponsor Vim development Vim logo Vim Book Ad

basic Tip #302: Use gvim in kmail

 tip karma   Rating 49/22, Viewed by 2607 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   August 7, 2002 6:08      complexity:   basic
author:   Davide Patti      as of Vim:   6.0

To automatically open gvim to edit in kmail, "-f" command line option must be used .
In kmail configuration go to the composer settings , and write in the "use external editor" field the following
command :
"gvim -f %f"  
Without -f option gvim would work in background and editing would not have any effect on kmail.

 rate this tip  Life Changing Helpful Unfulfilling 

<< Edit files in path, or related. | Statusline Tab Level Function Ruler TVIM >>

Additional Notes

[email protected], August 8, 2002 16:02
See also http://freehackers.org/kvim/ - integrating Vim in KDE. It looks really nice! (I'm not sure of exactly what is needed to get it running i KMail though - but look at those nice screenshots..)
[email protected], August 9, 2002 6:51
This tip is basically true for every mua that allows integration of external editors, e.g. mutt
Anonymous, October 7, 2002 16:46
Thank you, thank you, thank you!  I've been trying to get this working for months!  It takes just one switch.  Amazing.
[email protected], January 3, 2003 16:03
Yes it works also with kvim (which is the KDE way ;)
just put "kvim -f %f"
and you're done, when you start typing, it fires up kvim, when leave with :x you get back to kmail
kinda like when you use vim with pine
[email protected], February 19, 2003 20:57
I have been looking for that commandline-switch too!

"gvim --help" just says:
   -f ... Foreground: Don't fork when starting GUI
which was not very helpful for me.

Thank you!
[email protected], June 15, 2004 21:45
is there anyway for it to set the file type automatically to mail?
[email protected], October 20, 2005 0:28
Thanks for the tip. I've been struggling with it as well. Next step would be to get kvim/gvim working inside the composer window. It still looks kind of funny to me to have 2 windows fired up after entering ctrl-N in Kmail
[email protected], June 8, 2006 15:40
You can set the filetype automaticall to mail by replacing "gvim -f %f" with "gvim "+set ft=mail" -f %f"
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Sponsored by Web Concept Group Inc. SourceForge.net Logo