summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/hackernews.py4
-rw-r--r--plugin/hackernews.vim3
2 files changed, 5 insertions, 2 deletions
diff --git a/plugin/hackernews.py b/plugin/hackernews.py
index e3a85fe..b924468 100644
--- a/plugin/hackernews.py
+++ b/plugin/hackernews.py
@@ -10,7 +10,7 @@ API_URL = "http://node-hnapi.herokuapp.com"
def hacker_news():
- vim.command("edit -HackerNews-")
+ vim.command("edit .hackernews")
vim.command("setlocal noswapfile")
vim.command("setlocal buftype=nofile")
@@ -38,7 +38,7 @@ def hacker_news_item():
item = json.loads(urllib2.urlopen(API_URL+"/item/"+id).read())
- vim.command("edit -HackerNews-")
+ vim.command("edit .hackernews")
b = vim.current.buffer
b[0] = item['title']
b.append("Posted %s by %s" % (item['time_ago'], item['user']))
diff --git a/plugin/hackernews.vim b/plugin/hackernews.vim
index 90d8b81..b405253 100644
--- a/plugin/hackernews.vim
+++ b/plugin/hackernews.vim
@@ -12,3 +12,6 @@ execute "pyfile " . s:path . "/hackernews.py"
command! HackerNews python hacker_news()
map <return> :python hacker_news_item()<cr>
+
+
+au! BufRead,BufNewFile *.hackernews set filetype=hackernews