coc-python icon indicating copy to clipboard operation
coc-python copied to clipboard

coc status

Open kthenrique opened this issue 4 years ago • 3 comments

Is there a way to hide the "Python <version> <arch>" line from the statusbar when using coc#status? It would be nice to have this as a json config like coc-spell-checker has:

    "cSpell.showStatus": {
      "type": "boolean",
      "scope": "resource",
      "default": true,
      "description": "Display the spell checker status on the status bar."
    },

[Neo]vim already can recognize file formats and many people already has it on their statusbar. It's a duplicity for me to have it switched on.

statusbar

kthenrique avatar Jan 24 '20 18:01 kthenrique

Not exactly the ideal fix but I dropped coc status from my statusline and created a custom function:

function! StatusDiagnostic() abort
  let info = get(b:, 'coc_diagnostic_info', {})
  if empty(info) | return '' | endif
  let msgs = []
  if get(info, 'error', 0)
    call add(msgs, 'E' . info['error'])
  endif
  if get(info, 'warning', 0)
    call add(msgs, 'W' . info['warning'])
  endif
  return join(msgs, ' ')
endfunction

" Lightline + Tabline
let g:lightline = {
      \ 'colorscheme': 'onedark',
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'readonly', 'filename', 'modified', 'statusdiag'] ]
      \ },
      \ 'component_function': {
      \   'statusdiag': 'StatusDiagnostic'
      \ },
      \ }

Screen Shot 2020-01-29 at 1 49 28 AM

Gee19 avatar Jan 29 '20 06:01 Gee19

Not exactly the ideal fix but I dropped coc status from my statusline and created a custom function:

function! StatusDiagnostic() abort
  let info = get(b:, 'coc_diagnostic_info', {})
  if empty(info) | return '' | endif
  let msgs = []
  if get(info, 'error', 0)
    call add(msgs, 'E' . info['error'])
  endif
  if get(info, 'warning', 0)
    call add(msgs, 'W' . info['warning'])
  endif
  return join(msgs, ' ')
endfunction

" Lightline + Tabline
let g:lightline = {
      \ 'colorscheme': 'onedark',
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'readonly', 'filename', 'modified', 'statusdiag'] ]
      \ },
      \ 'component_function': {
      \   'statusdiag': 'StatusDiagnostic'
      \ },
      \ }

Screen Shot 2020-01-29 at 1 49 28 AM

yeah, but I still wanna be able to see transient status info, like "searching for interpreter" or "Updating extensions" etc.

Thanks for the suggestion tho.

kthenrique avatar Feb 03 '20 19:02 kthenrique

I believe this is where the interpreter name gets added to the statusline: https://github.com/neoclide/coc-python/blob/master/src/interpreter/display/index.ts#L69 I don't know (yet) how to make that configurable, or if it is at all possible.

Ch00k avatar Sep 02 '20 13:09 Ch00k