vim-github-dashboard


Ⅰ. 插件描述

Browse GitHub events in Vim

Ⅱ. 基本信息

创建日期:  2013-06-23
使用用户:  14
Github星:  0
插件作者:  joe di castro

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'joedicastro/vim-github-dashboard-sweeter-than-fiction'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'joedicastro/vim-github-dashboard-sweeter-than-fiction'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'joedicastro/vim-github-dashboard-sweeter-than-fiction'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/joedicastro/vim-github-dashboard

Ⅳ. 文档说明

vim-github-dashboard

Browse GitHub events (user dashboard, user/repo activity) in Vim.

User dashboard: :GHD! matz

User activity: :GHA! matz

Repository activity: :GHA! mruby/mruby

(Color scheme used: seoul256-light)

Installation

Use Vundle (recommended)
or Pathogen.

With Vundle

Add the following line to your .vimrc,

Bundle 'junegunn/vim-github-dashboard'

then execute, :BundleInstall command.

With Pathogen

mkdir -p ~/.vim/bundle
cd ~/.vim/bundle
git clone git@github.com:junegunn/vim-github-dashboard.git

Requirements

  1. Your Vim must have Ruby support enabled. Check if :echo has('ruby') prints 1.
  2. If you see LoadError on :ruby require 'json/pure', you need to install json_pure gem.

Mac OS X

The current version of Mac OS X is shipped with a Ruby-enabled Vim.
However, by default it comes with an old Ruby (1.8.7),
so you still need to install json_pure (or json) gem.

sudo gem install json_pure

If your Vim crashes, try installing a newer version of Vim
with Homebrew.

Ubuntu

sudo apt-get install ruby rubygems vim-nox && sudo /usr/bin/gem install json_pure

(Reference: Installing vim with ruby support (+ruby))

Windows

  1. Download and install the official GVim
  2. Download a newer build of GVim executable from here and replace the existing one
  3. Download and install Ruby 1.9.3 using RubyInstaller. You must check Add Ruby executable to your PATH option.

Commands

With authentication

  • :GHDashboard
  • :GHDashboard USER
  • :GHActivity
  • :GHActivity USER
  • :GHActivity USER/REPO

Without authentication (60 calls/hour limit, only public activities)

  • :GHDashboard! USER
  • :GHActivity! USER
  • :GHActivity! USER/REPO

Navigation

Use Tab and Shift-Tab to navigate back and forth through the links.

Press Enter key or double-click on a link to open it in the browser.

Press R to refresh the window.

Press q to close the window.

Authentication

When you first run :GHDashboard or :GHActivity command,
you will be asked to enter your GitHub username and the password.
Once it is successfully authenticated, the Vim process will remember
the credentials and will no more ask for them.

If you don't want to be asked for username and password, you can set up
g:github_dashboard variable as follows.

let g:github_dashboard = { 'username': 'you', 'password': 'secret' }

Since having plain-text password in your .vimrc is not the most secure
thing you can do, it is strongly recommended that you don't put password in
your Vim configuration file.

let g:github_dashboard = { 'username': 'you' }

Without authentication

In fact, GitHub API allows you to browse dashboard or activity stream
without authentication, though the hourly rate is limited to 60.
Well, that's good enough as long as you don't check GitHub page every

  1. Use bang commands then: :GHDashboard! and :GHActivity!.

Optional configuration

" Dashboard window position
" - Options: tab, top, bottom, above, below, left, right
" - Default: tab
let g:github_dashboard['position'] = 'top'

" Disable Emoji output
" - Default: only enable on terminal Vim on Mac
let g:github_dashboard['emoji'] = 0

" Customize emoji (see http://www.emoji-cheat-sheet.com/)
let g:github_dashboard['emoji_map'] = {
\   'user_dashboard': 'blush',
\   'user_activity':  'smile',
\   'repo_activity':  'laughing',
\   'ForkEvent':      'fork_and_knife'
\ }

" Command to open link URLs
" - Default: auto-detect
let g:github_dashboard['open_command'] = 'open'

" API timeout in seconds
" - Default: 10, 20
let g:github_dashboard['api_open_timeout'] = 10
let g:github_dashboard['api_read_timeout'] = 20

Author

Junegunn Choi

License

MIT

"Why Ruby?"

  1. This is a personal fun project, and I like Ruby, so why not?
  2. Ruby allows me to access GitHub API without another Vim plugin or an external executable
  3. Mac OS X (which I use the most) is shipped with a Ruby-enabled Vim, so it's pretty easy to set up

添加新评论