Ⅰ. 插件描述
Browse Hacker News inside VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ryanss/vim-hackernews'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ryanss/vim-hackernews'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ryanss/vim-hackernews'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ryanss/vim-hackernews
Ⅳ. 文档说明
vim-hackernews
Browse Hacker News inside Vim.
Uses cheeaun's Unofficial Hacker News API
to retrieve home page stories and comments and
FUCK YEAH MARKDOWN for rendering HTML articles
as text.
Basic Usage
- Open the Hacker News front page in Vim by executing the
:HackerNews
command - The HackerNews command takes an optional parameter to view items other
than the top stories on the front page:ask
,show
,shownew
,jobs
,
best
, active
, newest
, noobstories
, <item id>
, or <search query>
- Press lowercase
o
to open links in Vim - Press uppercase
O
to open links in default web browser - Numbered lines with story titles on the front page link to the story url
- Comment lines on the front page link to the comments url
- Press uppercase
F
to fold current comment thread - Press lowercase
u
to go back - Press
Ctrl+r
to go forward - Execute the
:bd
command to close and remove the Hacker News buffer
Enhanced Motions
Uppercase J
and K
are mapped to helpful new motions based on what type of
content is on the screen:
- Move to next/prev item when viewing the front page. (If the cursor is on a
numbered line with story title the cursor will move to the next/prev numbered
line with story title. If the cursor is on a comment line it will move to the
next/prev comment line.)
- Move to next/prev comment when viewing comments.
- Move to next/prev paragraph when viewing the text version of articles.
Installation
Pathogen (https://github.com/tpope/vim-pathogen)
git clone https://github.com/ryanss/vim-hackernews ~/.vim/bundle/vim-hackernews
Vundle (https://github.com/gmarik/vundle)
Plugin 'ryanss/vim-hackernews'
NeoBundle (https://github.com/Shougo/neobundle.vim)
NeoBundle 'ryanss/vim-hackernews'
Running Tests
$ vim -c Vader! tests.vader
Contributions
Issues and
Pull Requests are always
welcome!
License
Code is available according to the MIT License
(see LICENSE).