Monday, May 7, 2012

Expanding a range of characters

Vim 7.3.1-514

iskeyword contains values like this:

38,47-58,-

I can use nr2char(38) to get &.
- can be used as itself.

How can I expand the range of characters 47-58 to be it's equivalent:
/, 0,1,2,3,4,5,6,7,8,9,:

I was hoping to do something like this:
for item in expand(split('47-58', '-'), '', 1)
" Somehow check if this is a regular character
if strtrans(nr2char(item)) != ''
endif
endfor

To iterate through each one.

>echo range(47, 58)
[47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58]
>echo range(split('47-58', '-')


The expand didn't work.

Thanks,
Dave


--
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

No comments: