> Is it possible to distinguish between "/" and ":" command-line modes
> in a function invoked from a cmap?
> I need to map a key in command-line mode (using cmap) that should=20
> work only in the "/" and "?" prompts.
> Currently the getcmdpos(), getcmdline() and setcmdpos() functions
> are available to manipulate the command-line. But a getcmdtype()
> function to get the current command-line type is not available.
No, this is not available. Adding getcmdtype() sounds like a good idea.
The patch you sent looks good, thanks!
GALAHAD: No look, really, this isn't nescess ...
PIGLET: We must examine you.
GALAHAD: There's nothing wrong with ... that.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
>> Is it possible to distinguish between "/" and ":"
>> command-line modes in a function invoked from a cmap?
While it's not available in vim-current, as Bram described, I've
done some hacking to get it to work via dark mapping magic :)
I map "/" to create the cnoremap that I want, and then have <cr>
(and/or <esc> and/or <c-c>) execute the search and then unmap
that command. Mappings that write mappings are bloody ugly. A
while back on the list, Eljay wanted to enter Insert mode upon
executing a search. I suggested something like the following: