1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-28 01:10:05 +08:00
SpaceVim/docs/layers/github.md

59 lines
1.8 KiB
Markdown
Raw Normal View History

---
title: "SpaceVim github layer"
description: "This layer provides GitHub integration for SpaceVim"
---
2018-06-23 14:37:41 +08:00
# [Available Layers](../) >> github
<!-- vim-markdown-toc GFM -->
- [Description](#description)
2018-06-23 14:37:41 +08:00
- [Install](#install)
- [Key bindings](#key-bindings)
- [Extra configuration for GitHub and Gist](#extra-configuration-for-github-and-gist)
<!-- vim-markdown-toc -->
## Description
This layer provides GitHub integration for SpaceVim.
2018-06-23 14:37:41 +08:00
## Install
2018-06-23 14:37:41 +08:00
To use this configuration layer, add following snippet to your custom configuration file.
2018-06-23 14:37:41 +08:00
```toml
[[layers]]
name = "github"
```
## Key bindings
| Key Binding | Description |
| ----------- | ---------------------------- |
| `SPC g h i` | show issues |
| `SPC g h a` | show activities |
| `SPC g h d` | show dashboard |
| `SPC g h f` | show current file in browser |
| `SPC g h I` | show issues in browser |
| `SPC g h p` | show PRs in browser |
| `SPC g g l` | list all gist |
| `SPC g g p` | post gist |
## Extra configuration for GitHub and Gist
2019-01-07 21:15:22 +08:00
For avoid repeating input the account name and passwrod, you need to add the belowing contennt for auto .SpaceVim.d/autoload/myspacevim.vim [Bootstrap Functions](https://spacevim.org/documentation/#bootstrap-functions).
```vim
func! myspacevim#before() abort
"other configs
let g:github_dashboard = { 'username': 'yourgithubuser', 'password': $GITHUB_TOKEN }
let g:gista#client#default_username = 'monkeyxite'
endf
```
2019-01-21 16:39:33 +08:00
Refer [github dashboard](https://github.com/junegunn/vim-github-dashboard), for security concerns you could create a Personal Access Token, export it as an environment variable and use it as a password.
```shell
# in some secure file sourced in your .bashrc, .bash_profile, .zshrc, etc.
export GITHUB_TOKEN="<your 40 char token>"
```