https://github.com/4513echo/ddc-github
:octocat: GitHub completion for ddc.vim via gh
https://github.com/4513echo/ddc-github
ddc-source ddc-vim
Last synced: 10 months ago
JSON representation
:octocat: GitHub completion for ddc.vim via gh
- Host: GitHub
- URL: https://github.com/4513echo/ddc-github
- Owner: 4513ECHO
- License: mit
- Created: 2022-04-24T05:40:38.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-16T07:48:38.000Z (about 3 years ago)
- Last Synced: 2024-04-22T05:10:05.428Z (about 2 years ago)
- Topics: ddc-source, ddc-vim
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ddc-github
GitHub completion for ddc.vim via gh
These sources collect something related to GitHub (e.g. issues, pull requests)
via gh, which is GitHub’s official command line tool.
Now ddc-github provides below sources:
- `github_issue`
- `github_pull_request`
Please read [help](doc/ddc-github.txt) for details.
## Requirements
- [gh](https://github.com/cli/cli)
- [denops.vim](https://github.com/vim-denops/denops.vim)
- [ddc.vim](https://github.com/Shougo/ddc.vim)
## Configuration
```vim
" Use github sources
call ddc#custom#patch_global('sources', ['github_issue', 'github_pull_request'])
" Change source options
call ddc#custom#patch_global('souceOptions', {
\ 'github_issue': {
\ 'mark': 'issue',
\ 'forceCompletionPattern': '#\d*',
\ },
\ })
" Use on specific filetype
call ddc#custom#patch_filetype(['gitcommit'], {
\ 'sources': ['github_issue', 'github_pull_request'],
\ 'keywordPattern': '[a-zA-Z_:#]\k*',
\ })
" Use on `gh (issue|pr) create` buffer
function! s:on_gh() abort
" Check whether the file is gh's buffer
let tmpdir = empty($TMPDIR) ? '/tmp' : expand('$TMPDIR')
if fnamemodify(bufname(), ':h') != tmpdir || getcwd() == tmpdir
return
endif
" Over sources
call ddc#custom#patch_buffer({
\ 'sources': ['github_issue', 'github_pull_request'],
\ 'keywordPattern': '[a-zA-Z_:#]\k*',
\ })
inoremap
\ ddc#map#manual_complete('github_issue', 'github_pull_request')
endfunction
autocmd FileType markdown call on_gh()
```