neoclide / coc-python

Python extension for coc.nvim, fork of vscode-python
574 stars 51 forks source link

coc status #138

Open kthenrique opened 4 years ago

kthenrique commented 4 years ago

Is there a way to hide the "Python \ \" 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

Gee19 commented 4 years ago

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

kthenrique commented 4 years ago

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.

Ch00k commented 4 years ago

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.