summaryrefslogtreecommitdiff
path: root/plugin/hackernews.vim
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/hackernews.vim')
-rw-r--r--plugin/hackernews.vim7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugin/hackernews.vim b/plugin/hackernews.vim
index b405253..f73512a 100644
--- a/plugin/hackernews.vim
+++ b/plugin/hackernews.vim
@@ -5,13 +5,14 @@ endif
" Import Python code
-let s:path = expand("<sfile>:p:h")
-execute "pyfile " . s:path . "/hackernews.py"
+execute "python import sys"
+execute "python sys.path.append('" . expand("<sfile>:p:h") . "')"
+execute "python from hackernews import hacker_news, hacker_news_link"
command! HackerNews python hacker_news()
-map <return> :python hacker_news_item()<cr>
+map <return> :python hacker_news_link()<cr>
au! BufRead,BufNewFile *.hackernews set filetype=hackernews