I am using :cn in Evil's Ex command line and would like to use :cnf as well, but it is not there, and I don't know what function to bind it to.


As a former Vim user who is slowly coming to see the light, I am using :cnext in Evil's Ex command line in Spacemacs to navigate errors from the Scala compiler/SBT. I am currently fixing errors caused by missing imports: thus, I can add one line at the top of the file and fix numerous errors. As such, I would like to skip straight to the next file with problems, i.e. Vim's :cnfile. :cnf is not bound, and I cannot find something appropriate to bind it to.

I did find that :cn is bound to next-error, which seems to be associated with Compilation Mode. However that seems to be misdirection as compilation-next-file gives "Not in a compilation buffer".

Even more Details

My setup includes the following, and I'm not entirely clear how much of this is relevant, so I'll list it all:


It's a minor glitch/bug in the Emacs error interface, compilation-next-file only works (at least as of Emacs 25) if you are in the buffer showing the error messages, not in the source file with the error. Do something like other-window to get your cursor into error message buffer and compilation-next-file will work (and then you probably need to hit something like enter to take you back to the relevant source file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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