Is there a way to copy the error message that YCM shows at the bottom of vim?
For example in the above image, it says:
unused parameter 'sortFunction'
I had an idea of using "howdoi [paste]" in another terminal and get a solution easily :)
If YCM uses the proper mechanisms, that message should be in either v:statusmsg
or v:errmsg
. You can put those values into the system clipboard via:
:let @+ = v:statusmsg
:! howdoi <C-R>=v:statusmsg<CR><CR>
then.
Commented
Mar 22, 2015 at 9:52
+
in front. Is the message in one of those variables; have you checked that? Getting it out there is just secondary to your original question.
Commented
Mar 22, 2015 at 10:02
:echo v:statusmsg
or :echo v:errmsg
. If one of them contains the message you're looking for, use that variable. If both of them are empty, then YCM is not using these variables to store the error messages. Also, make sure you get the error message with YCM again as v:errmsg
may get overwritten with newer error messages.
:echo
. You could raise an issue at YCM's issue tracker to have that (trivially) changed to :echomsg
.
Commented
Mar 22, 2015 at 10:49
$ howdoi
won't help. You only need basic logic: you have an unused parameter so you have two solutions: remove it or use it.