On 4 January 2013 14:34, Andy Wokula <[email protected]> wrote: > Am 03.01.2013 09:51, schrieb martinwguy: >>> Is it a bug that '\' after '-' in a collection is taken literally? >> No, that's normal vi behaviour. > The context is Vim, not Vi: > :set nocp cpo&vim
Er, I thought vim was a reimplementation of vi. >> \ is not special in a character range (it stands for itself) and to >> include ] you need to specify it as the first character in the range. > > Even with set 'cp', `\]' is still special. See: > :h cpo-\ Mmm, sorry, I don't know what :se cp/nocp is. > Do you actually use Vi? Hum, it sounds like you're putting your fists up. Bad sign. Yes, since 1982 for all my work. I am also the maintainer for another vi clone, "xvi". Is that enough for you? >> In the example you give >> /[]@-\] >> (knowing that \ is the character previous to ]) > > (my pattern `[@-\\]]' also made use of it) > > So far, it looks like if Vim just forgot to implement a certain case. > There is no apparent reason why `\]' is allowed for X but not for Y in > a [X-Y] collection. No, you're thinking that vi should do as you would expect according to your own thinking. That may be reasonable if we were designing a new editor, but vim is a vi clone, so needs to implement what vi, and the other dozen vi clones, do, so as not to break people's scripts. That said, it is open source, so you are free to take it, make the change you desire and suse your own version. Or take it up with Bill Joy in the 1970s, but fr that you will need a time machine... M -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
