¿Qué hace el comando 'cs' en vim y por qué no puedo asignarlo para hacer otras cosas?

I have the ConqueTerm plugin installed in my vim so that I can run bash commands without leaving my editing environment. It's cool when you can run Python scripts while seeing you code within the same screen.

I wanted to be more convenient to toggle ConqueTerm, so I added these two lines in my .vimrc

" quick access to ConqueTerm
nnoremap cv :ConqueTermVSplit bash<CR>
nnoremap cs :ConqueTermSplit bash<CR>

I have experimented these two commands before so that I can be sure I won't overwrite existing commands. 'cv' does absolutely nothing since after I typed these two characters in normal mode, they appear in the bottom-right corner of my vim window, still listening for my next stroke. But 'cs' is a different story, since the letters don't appear where 'cv' would, and my cursor would move to the status area, where we run commands such as ':wqa!', only I can't do anything there. Whatever key I press I go back to the editing area. And after I edited my .vimrc, my 'cv' works like a charm whereas my 'cs' still does the same thing I don't understand.

So, as the title says, what exactly does 'cs' do, and why I failed to map it to other command? Thanks!

preguntado el 05 de mayo de 13 a las 15:05

2 Respuestas

Puedes emitir :map cs to see what it maps to.

cs is not mapped by default in Vim, but I have a hunch you have installed the plugin called surround. That reserves normal mode bindings cs, ds and a couple others. Check the link for behaviour.

contestado el 05 de mayo de 13 a las 15:05

utilizan el :verbose map cs to print out what cs es vinculante para.

contestado el 05 de mayo de 13 a las 15:05

Great idea! turns out @progo is right. It's because of the surround plugin - alxyzc

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.