• Stars
    star
    481
  • Rank 91,384 (Top 2 %)
  • Language
    Vim Script
  • Created over 11 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

:octocat: Browse GitHub events in Vim

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

Using vim-plug:

Plug 'junegunn/vim-github-dashboard'

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 CTRL-N and CTRL-P 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.

As a more secure alternative, create a Personal Access Token, export it as an environment variable and use it as a password.

# in some secure file sourced in your .bashrc, .bash_profile, .zshrc, etc.
export GITHUB_TOKEN="<your 40 char token>"
let g:github_dashboard = { 'username': 'you', 'password': $GITHUB_TOKEN }

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 minute. Use bang commands then: :GHDashboard! and :GHActivity!.

Caveat about GitHub Two-factor authentication

If you have enabled GitHub Two-factor authentication, you cannot login with your username and password. In that case, you can generate a Personal Access Token and use it as the password.

Optional configuration

let g:github_dashboard = {}

" 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

" Do not set statusline
" - Then you can customize your own statusline with github_dashboard#status()
let g:github_dashboard['statusline'] = 0

" GitHub Enterprise
let g:github_dashboard['api_endpoint'] = 'http://github.mycorp.com/api/v3'
let g:github_dashboard['web_endpoint'] = 'http://github.mycorp.com'

Profiles

In case you need access to GitHub Enterprise as well as the public GitHub, you might want to define multiple sets of configuration as profiles.

" Default configuration for public GitHub
let g:github_dashboard = {
\ 'username': 'kent'
\ }

" Profile named `ck`
let g:github_dashboard#ck = {
\ 'username':     'kent.clark',
\ 'api_endpoint': 'http://github.daily-planet.com/api/v3',
\ 'web_endpoint': 'http://github.daily-planet.com'
\ }

" Profile named `super`
let g:github_dashboard#super = {
\ 'username':     'superman',
\ 'api_endpoint': 'http://github.justice-league.org/api/v3',
\ 'web_endpoint': 'http://github.justice-league.org'
\ }

Then you can access each GitHub instance like so:

GHD!

" GitHub Enterprise requires authentication, so use non-bang versions
GHD -ck
GHA -ck lois

GHD -super
GHA -super batman/bmobile

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

More Repositories

1

fzf

🌸 A command-line fuzzy finder
Go
55,523
star
2

vim-plug

🌺 Minimalist Vim Plugin Manager
Vim Script
33,335
star
3

fzf.vim

fzf ❀️ vim
Vim Script
9,178
star
4

goyo.vim

🌷 Distraction-free writing in Vim
Vim Script
4,404
star
5

vim-easy-align

🌻 A Vim alignment plugin
Vim Script
3,981
star
6

limelight.vim

πŸ”¦ All the world's indeed a stage and we are merely players
Vim Script
2,290
star
7

redis-stat

(UNMAINTAINED) A real-time Redis monitoring tool
Ruby
2,014
star
8

seoul256.vim

🌳 Low-contrast Vim color scheme based on Seoul Colors
Vim Script
1,604
star
9

gv.vim

A git commit browser in Vim
Vim Script
1,286
star
10

vim-peekaboo

πŸ‘€ " / @ / CTRL-R
Vim Script
1,102
star
11

vim-emoji

πŸ˜ƒ Emoji in Vim
Vim Script
606
star
12

vader.vim

A simple Vimscript test framework
Vim Script
571
star
13

vim-slash

Enhancing in-buffer search experience
Vim Script
322
star
14

fzf-git.sh

bash and zsh key bindings for Git objects, powered by fzf
Shell
280
star
15

vim-journal

πŸ“
Vim Script
259
star
16

myvim

🍱 Script to create a portable bundle of Vim environment
Shell
252
star
17

heytmux

Tmux scripting made easy
Ruby
139
star
18

vim-xmark

Live markdown preview for Vim on macOS (UNMAINTAINED; see https://github.com/iamcco/markdown-preview.nvim)
CSS
135
star
19

fzf-bin

117
star
20

vim-after-object

πŸ‘‰ Target text *after* the designated characters
Vim Script
112
star
21

vim-oblique

DEPRECATED Improved /-search (experimental)
Vim Script
83
star
22

vim-startuptime-benchmark

Outdated information
Vim Script
69
star
23

tmux-fzf-url

πŸš€ Quickly open urls on screen from your browser!
Shell
45
star
24

perlin_noise

Perlin noise generator in Ruby
Ruby
43
star
25

gimchi

Gimchi reads Korean.
Ruby
40
star
26

hbase-jruby

A JRuby binding for HBase
Ruby
38
star
27

tmux-fzf-maccy

Tmux plugin for Maccy and fzf integration
Shell
34
star
28

blsd

List directories in breadth-first order
Go
33
star
29

mvmv

Simple batch renaming script (ruby)
Ruby
27
star
30

vim-fnr

🎭 Find-N-Replace helper free of regular expressions
Vim Script
25
star
31

jdbc-helper

Deprecated. Use Sequel.
Ruby
19
star
32

jruby-daemon-template

Turn a JRuby script into an init-d style daemon
Shell
18
star
33

tabularize

Formatting tabular data with paddings
Ruby
18
star
34

mini-file-server

A simple, insecure file server
Clojure
17
star
35

ansi256

A Rubygem for colorizing text with 256-color ANSI codes
Ruby
16
star
36

vim-pseudocl

Pseudo-command-line (experimental)
Vim Script
16
star
37

insensitive_hash

DEPRECATED: Use hashie
Ruby
15
star
38

pipe-logger

Log rotation of stdout & stderr
Ruby
14
star
39

grouper

A simple batch processing facility
Clojure
12
star
40

vim-redis

Experimental Redis plugin for Vim
Vim Script
12
star
41

lq

A simple HTTP server for queuing lines of text
Clojure
11
star
42

clj-inspector

Inspector helps debugging Clojure programs
Clojure
11
star
43

parallelize

Simple multi-threading for Ruby
Ruby
10
star
44

tre-ruby

Approximate regular expression matching using TRE
Ruby
10
star
45

treely

Library for generating tree diagram of nested data structure
Clojure
9
star
46

junegunn

8
star
47

coffee-processing

Helps writing Processing.js sketches in CoffeeScript
Ruby
8
star
48

ssh-copy-id.rb

Unmaintained
Ruby
7
star
49

agl

List files and directories using ag
Ruby
7
star
50

si

Human-readable numbers with SI prefix (metric prefix)
Ruby
6
star
51

evented-servers

experiments with libev
C
6
star
52

vim-ruby-x

if_ruby helper
Vim Script
6
star
53

microbe

A simple micro benchmark helper for Clojure
Clojure
5
star
54

vim-cfr

Decompile Java class files using CFR
Vim Script
5
star
55

each_line_reverse

Read lines of a file in reverse order
Ruby
4
star
56

shorten

Number shortener
Ruby
4
star
57

proco

experimental: a lightweight asynchronous task executor designed for efficient batch processing
Ruby
4
star
58

lps

lps: rate-controlled loop execution
Ruby
3
star
59

SuperCSV

A fork of SuperCSV project with a few fixes
Java
2
star
60

colored-not

Toggles methods from colored gem
Ruby
2
star
61

img2xterm-clj

img2xterm rewritten in clojure (for no good reason)
Clojure
2
star
62

jrubysql

SQL client for any JDBC-compliant database.
Ruby
2
star
63

linux-scripts

Ruby
2
star
64

zipfian

Zipfian distribution in Ruby
Ruby
2
star
65

rcron

A simple cron-like scheduler for Ruby
Ruby
2
star
66

option_initializer

Object construction with method chaining
Ruby
2
star
67

quote_unquote

Wraps (and unwraps) strings with quotes
Ruby
1
star
68

maven_dependency

A Ruby gem to resolve maven dependencies
Ruby
1
star
69

coffee-processing-live

coffee-processing demo app
JavaScript
1
star
70

tweet-backup-ruby

Ruby script for backing up tweets
Ruby
1
star
71

i

1
star
72

hbase-client-dep

Makefile
1
star
73

each_sql

Enumerate each SQL statement in SQL scripts
Ruby
1
star
74

srsly

SRSLY? NO!
Ruby
1
star
75

omniauth-nate

OmniAuth strategy for Nate.com (Nate/Cyworld)
Ruby
1
star
76

oxm

A tiny Object-XML-Mapper for Ruby
Ruby
1
star