#@+leo
#@+node:0::@file plugins/mod_vim.py
#@+body
"""vim handler"""

# Contributed by Andrea Galimberti.


#@<< about this plugin >>
#@+node:1::<< about this plugin >>
#@+body
#@+at
#  To use this plugin do the following:
# 
# - Start VIM as server: vim --servername "VIM"
#   The name of the server *must* be "VIM".
# 
# - Single-click on a node's icon to open that node in VIM.
# 
# - Leo will update the node in the outline when you save the file in VIM.

#@-at
#@-body
#@-node:1::<< about this plugin >>


from leoPlugins import *
from leoGlobals import *

def open_in_vim (tag,keywords):
	if top():
		top().frame.OnOpenWith(("os.system", "/usr/local/bin/vim --remote ", None))

if 1: # Register the handlers...
	registerHandler("iconclick2", open_in_vim)
	
	import mod_vim
	es("...vim v1.1: " + plugin_date(mod_vim))

#@-body
#@-node:0::@file plugins/mod_vim.py
#@-leo
