Pregunta:
Si ejecuto :cnext
cuando ya estoy al final de la lista de corrección rápida, aparece el mensaje de error
E553: No more items
y no pasa nada. En lugar de esto, cuando entro :cnext
al final de la lista, me gustaría que vim volviera a la primera entrada de corrección rápida. ¿Es posible configurar vim para este comportamiento?
Respuesta:
Puedes escribir algunos comandos:
command! Cnext try | cnext | catch | cfirst | catch | endtry
command! Cprev try | cprev | catch | clast | catch | endtry
command! Lnext try | lnext | catch | lfirst | catch | endtry
command! Lprev try | lprev | catch | llast | catch | endtry
Si se detecta la excepción, salta al primer / último elemento. Puede usar cabbrev
para no tener que usar los comandos en mayúsculas:
cabbrev cnext Cnext
cabbrev cprev CPrev
cabbrev lnext Lnext
cabbrev lprev Lprev