Wednesday, May 20, 2015

Re: :1,9000bd is giving 'E16 invalid range' after update

Jürgen Krämer <jottkaerr@googlemail.com> writes:

> Hi,
>
> Wael Nasreddine schrieb am 20.05.2015 um 10:42:
>>
>> I have this map in my vimrc:
>>
>> " Wipe out all buffers
>> nmap <silent> <leader>wa :1,9000bd<cr>
>>
>> and it used to work fine on Vim 7.4.488[0] but since I've updated Vim to
>> 7.4.712[1] it errors our with 'E16: Invalid range'. Is anyone else
>> experiencing the same issue?
>
> there have been some changes that allowed "$" to be used as a placeholder
> for the highest buffer number or tab number or whatever, depending on the
> command following the range. In the course of this changes Vim has become
> more strict in regard to numbers used in the range.
>
> You might want to try "$" instead of an arbitrary high number if you want
> to include the last buffer in a range, thus
>
> nmap <silent> <leader>wa :1,$bd<cr>
>
> should be the preferred way to wipe out all buffers.
>

Cool that works! Do you know as of what version this has started? I'd
like to do something like

if v:version < 747
nmap <silent> <leader>wa :1,$bd<cr>
else
nmap <silent> <leader>wa :1,9000bd<cr>
endif

Best,

Wael

> Regards,
> Jürgen
>
> --
> Sometimes I think the surest sign that intelligent life exists elsewhere
> in the universe is that none of it has tried to contact us. (Calvin)
>
> --
> --
> You received this message from the "vim_use" 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
Wael Nasreddine | Senior Full Stack Engineer at Dailymotion | (650) 933-3448

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment