2

I have recently installed COC extension to vim and I am enjoying so far, but I started to have a problem once I had installed the COC extension for java and clang.

So after the very moment after I typed :CocInstall coc-java coc-clangd as a command, every window that I opened inside vim started to show some strange name at the bottom of each window that I opened. And that used to be where the filename appears! Now I cannot easily check which window is showing which file. An illustration is shown below. The part where red arrow points at used to show the actual file names. Now it displays JDT.LS, which is what I have no idea about. Any help would be grateful. Thank you! enter image description here

3
  • 1
    It looks like your statusline is being overridden with the name of the installed Java language server. Can you edit your post with the output of :verbose set statusline? and :scriptnames? Those will tell you from which script 'statusline' was last set, and what scripts have been loaded, respectively. Sep 11, 2021 at 14:51
  • 1
    Thank you so much! It printed the following lines statusline=%{coc#status()}%{get(b:, 'coc_current_function','')} Last set from ~/.vimrc line 240 So I went to see the following lines which was set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} After commenting it, the file name shows as expected! TQSM!
    – B1LLP4RK
    Sep 11, 2021 at 15:52
  • You should post your diagnosis and solution steps as a self answer so that others might benefit from your solution. Welcome to the site! :) Sep 11, 2021 at 18:39

1 Answer 1

4

A friendly commenter suggested using :verbose set statusline?, so that I can find what line of my .vimrc was making this change. The response from vim was statusline=%{coc#status()}%{get(b:, 'coc_current_function','')} Last set from ~/.vimrc line 240.

So I went to check line 240. It turned out that a line from the example settings at COC github page's readme section that I just copy and pasted was causing the problem. Erasing that line resolved my issue. Hope this helps if there is someone else who has similar issue!

BTW JDT.LS that I was seeing instead of the filenames turned out to be the language server that I was using for autocompletion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.