On 10/01/09 03:49, Tony Mechelynck wrote:
> On 10/01/09 03:40, Tony Mechelynck wrote:
> [...]
>> Oh, but you can set up mappings for search commands as distinct from
>> mappings for ex-commands. Here's an example:
>>
>> :cnoremap<expr> <CR> ((getcmdtype == '/'<Bar><Bar> getcmdtype ==
>> '?')?"<Bslash>CR>:set fdm=expr":'')
>
> Oops!
>
> :cnoremap<expr> <CR> ((getcmdtype() == '/'<Bar><Bar> getcmdtype() ==
> '?')?"<Bslash>r:set fdm=expr":"<Bslash>r")
Better yet:
:cnoremap <buffer> <expr> <CR> ((getcmdtype() == '/' <Bar><Bar>
getcmdtype() == '?')?"<Bslash>r:setlocal fdm=expr":"<Bslash>r")
>
>> The above requires Vim 7.0 or later, and of course with expression
>> evaluation compiled-in.
>>
>> Best regards,
>> Tony.
--
f y cn rd ths thn y cn hv grt jb n cmptr prgrmmng
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---