let s:plugin_path = expand(':p:h') function pad#on_open() if !exists('g:pad_loaded') exe 'py3 sys.path.insert(1, "' . s:plugin_path . '/../python/")' py3 import pad let g:pad_loaded = 1 endif setl noswapfile py3 pad.on_open() endfunction function pad#on_channel(buffer, channel, msg) exe 'py3 pad.on_channel(' . a:buffer . ', "' . escape(a:msg, '"\\') . '")' endfunction