mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:10:04 +08:00
Updated for remove username in github layer & doc.
This commit is contained in:
parent
e04c2cdb05
commit
6164828e63
@ -47,7 +47,8 @@ function! SpaceVim#layers#github#config() abort
|
||||
let g:_spacevim_mappings_space.g.g = { 'name': '+Gist' }
|
||||
|
||||
" @todo remove the username
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'g', 'l'], 'Gista list -u wsdjeg',
|
||||
" autoload to set default username
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'g', 'l'], 'Gista list',
|
||||
\ 'list gist', 1)
|
||||
call SpaceVim#mapping#space#def('nnoremap', ['g', 'g', 'p'], 'Gista post',
|
||||
\ 'post selection or current file', 1, 1)
|
||||
|
@ -10,6 +10,7 @@ description: "This layer provides GitHub integration for SpaceVim"
|
||||
- [Description](#description)
|
||||
- [Install](#install)
|
||||
- [Key bindings](#key-bindings)
|
||||
- [Extra configuration for GitHub and Gist](#extra-configuration-for-github-and-gist)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
@ -38,3 +39,20 @@ To use this configuration layer, add following snippet to your custom configurat
|
||||
| `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
|
||||
|
||||
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
|
||||
```
|
||||
Refer [github dashboar](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>"
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user