# HG changeset patch # User Steve Losh # Date 1307923968 14400 # Node ID 0a0ec65f5e57086748e1f974aa609ef3eebcf59c # Parent ee71fd579f4f039921e07f9570d79ca77791eb9a Skeleton. diff -r ee71fd579f4f -r 0a0ec65f5e57 plugin/threesome.py --- a/plugin/threesome.py Sun Jun 12 19:51:53 2011 -0400 +++ b/plugin/threesome.py Sun Jun 12 20:12:48 2011 -0400 @@ -1,4 +1,13 @@ -import threesomelib +import vim, os, sys + +# Add the library to the Python path. +for p in vim.eval("&runtimepath").split(','): + plugin_dir = os.path.join(p, "plugin") + if os.path.exists(os.path.join(plugin_dir, "threesomelib")): + if plugin_dir not in sys.path: + sys.path.append(plugin_dir) + break def ThreesomeInit(): - threesomelib.init() + from threesomelib.init import init + init() diff -r ee71fd579f4f -r 0a0ec65f5e57 plugin/threesome.vim --- a/plugin/threesome.vim Sun Jun 12 19:51:53 2011 -0400 +++ b/plugin/threesome.vim Sun Jun 12 20:12:48 2011 -0400 @@ -66,7 +66,7 @@ function! s:ThreesomeInit()"{{{ let python_module = fnameescape(globpath(&runtimepath, 'plugin/threesome.py')) exe 'pyfile ' . python_module - python "ThreesomeInit()" + python ThreesomeInit() endfunction"}}} "}}} diff -r ee71fd579f4f -r 0a0ec65f5e57 plugin/threesomelib.py --- a/plugin/threesomelib.py Sun Jun 12 19:51:53 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -import vim - -vim.echo('lololol') diff -r ee71fd579f4f -r 0a0ec65f5e57 plugin/threesomelib/__init__.py diff -r ee71fd579f4f -r 0a0ec65f5e57 plugin/threesomelib/init.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin/threesomelib/init.py Sun Jun 12 20:12:48 2011 -0400 @@ -0,0 +1,2 @@ +def init(): + pass diff -r ee71fd579f4f -r 0a0ec65f5e57 plugin/threesomelib/modes.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin/threesomelib/modes.py Sun Jun 12 20:12:48 2011 -0400 @@ -0,0 +1,2 @@ + + diff -r ee71fd579f4f -r 0a0ec65f5e57 plugin/threesomelib/util.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin/threesomelib/util.py Sun Jun 12 20:12:48 2011 -0400 @@ -0,0 +1,4 @@ +import sys + +def error(m): + sys.stdout.write(m + '\n')