A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neoclide/coc-git below:

neoclide/coc-git: Git integration of coc.nvim

Git integration of coc.nvim.

Note: many useful features not implemented, it's recommended to use plugin like vim-fugitive at the same time.

In your vim/neovim, run command:

Note for GitHub issues completion support:

Note for GitLab issues completion support:

more information, see package.json

Note for user from vim-gitgutter, if your have highlight groups defined for vim-gitgutter, you can use:

"git.addedSign.hlGroup": "GitGutterAdd",
"git.changedSign.hlGroup": "GitGutterChange",
"git.removedSign.hlGroup": "GitGutterDelete",
"git.topRemovedSign.hlGroup": "GitGutterDelete",
"git.changeRemovedSign.hlGroup": "GitGutterChangeDelete",

When you have git.addGBlameToVirtualText enabled, use command let g:coc_git_hide_blame_virtual_text = !get(g:, 'coc_git_hide_blame_virtual_text', 0) to dynamic toggle virtual text.

Example for lightline user:

" lightline
let g:lightline = {
  \ 'active': {
  \   'left': [
  \     [ 'mode', 'paste' ],
  \     [ 'ctrlpmark', 'git', 'diagnostic', 'cocstatus', 'filename', 'method' ]
  \   ],
  \   'right':[
  \     [ 'filetype', 'fileencoding', 'lineinfo', 'percent' ],
  \     [ 'blame' ]
  \   ],
  \ },
  \ 'component_function': {
  \   'blame': 'LightlineGitBlame',
  \ }
\ }

function! LightlineGitBlame() abort
  let blame = get(b:, 'coc_git_blame', '')
  " return blame
  return winwidth(0) > 120 ? blame : ''
endfunction

If you're not using statusline plugin, you can add them to statusline by:

set statusline^=%{get(g:,'coc_git_status','')}%{get(b:,'coc_git_status','')}%{get(b:,'coc_git_blame','')}
autocmd User CocGitStatusChange {command}

Triggered after the g:coc_git_status b:coc_git_status b:coc_git_blame has changed.

Could be used for update the statusline.

Create keymappings like:

" navigate chunks of current buffer
nmap [g <Plug>(coc-git-prevchunk)
nmap ]g <Plug>(coc-git-nextchunk)
" navigate conflicts of current buffer
nmap [c <Plug>(coc-git-prevconflict)
nmap ]c <Plug>(coc-git-nextconflict)
" show chunk diff at current position
nmap gs <Plug>(coc-git-chunkinfo)
" show commit contains current position
nmap gc <Plug>(coc-git-commit)
" create text object for git chunks
omap ig <Plug>(coc-git-chunk-inner)
xmap ig <Plug>(coc-git-chunk-inner)
omap ag <Plug>(coc-git-chunk-outer)
xmap ag <Plug>(coc-git-chunk-outer)

Use command :CocCommand to open commands and type git. to get all git related commands.

To open a specified coc list, you have different ways:

To toggle list mode, use <C-o> and i.

To move up&down on insertmode, use <C-j> and <C-k>

To run a action, press <tab> and select the action.

For more advance usage, checkout :h coc-list.

Issue autocomplete from multiple GitHub repositories

To enable autocompletion of issues from multiple GitHub repositories, put a comma-separated list of issue repository specifiers in the git config variable coc-git.issuesources. An issue repository specifier looks like this: github/neoclide/coc-git.

Multiple repositories can be specified using comma separation, like this: github/neoclide/coc-git,github/neoclide/coc.nvim

Q: Virtual text not working.

A: Make sure your neovim/vim support virtual text by command :echo has('nvim-0.5.0') || has('patch-9.0.0067').

If you like my extension, consider supporting me on Patreon or PayPal:

MIT


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4