Tip #500: View character class
tip karma |
Rating -3/3, Viewed by 348
|
created: |
|
July 2, 2003 18:03 |
|
complexity: |
|
intermediate |
author: |
|
beo |
|
as of Vim: |
|
6.0 |
This one shows the definition of a predefined character class. ([:alpha:], [:graph:] etc.) The cursor is assumed to point to the name of the character class one wants to examine. Press "cc" ...
fun! s:Show()
norm! viwy
echo 'class [:' . @" . ':]' . "\n"
let pat = '[[:' . @" . ':]]'
let i = 0
while i < 256
let ch = nr2char(i)
if ch =~ pat | echon ch . '(' . i . ')' . "\t" | endif
let i = i + 1
endwhile
endfun
nn cc :call <SID>Show()<Cr>
<<View character class |
View character class >>
Additional Notes
|