neoclide/coc-git

Feature request: support toggle git blame virtual text on/off

yaocccc opened this issue · 7 comments

是否可以给 gitBlameVirtualText是否显示加一个开关命令,有时侯只是临时想要查看一下,某某文件的行的提交记录,但目前只能通过看 coc-git-commit, 相对不太方便

Use :call coc#config('git.addGBlameToVirtualText', v:true)

thanks

huyz commented

I need to toggle it off before I can copy from a terminal to the clipboard.

After calling:

:call coc#config('git.addGBlameToVirtualText', v:true)

how do I refresh/redraw the screen/line so that the virtual text is cleared?

:call coc#config('git.addGBlameToVirtualText', !get(g:coc_user_config, 'git.addGBlameToVirtualText', 0)) | call nvim_buf_clear_namespace(bufnr(), -1, line('.') - 1, line('.'))

you can try my map. It can toggle addGBlameToVirtualText and clear visual text.

huyz commented

Nice, thanks @yaocccc !

Use let g:coc_git_hide_blame_virtual_text = !get(g:, 'coc_git_hide_blame_virtual_text', 0) instead.

huyz commented

Will do, thanks @chemzqm !