sponsor Vim development Vim logo Vim Book Ad

basic Tip #576: one call to generate all unicode "characters" from within vim

 tip karma   Rating 19/7, Viewed by 1229 

created:   October 5, 2003 17:16      complexity:   basic
author:   [email protected]      as of Vim:   6.0


This is a small function to generate all unicode "characters".
It might be interesting to those who are familiar with CJK.

I modified Frank's idea, http://groups.yahoo.com/group/vim/message/43907,
with a neat format. (Thank you, Frank)

Tony Mechelynck offered a great tip as how to work with utf-8 in
http://vim.sourceforge.net/tip_view.php?tip_id=246

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! GenerateUnicode()
  let i = 0
  while i <= 16*16*16*16
    let n = i
    let j = 0
    let h = ""
    while n
       let h = '0123456789ABCDEF'[n%16].h
       let n = n/16
    endwhile
    let c = h.' '
    while j<16
      let u = i+j
      let c = c.nr2char(u).' '
      let j = j+1
    endwhile
    $put = c
    let i = i+16
    if (i%(16*16) == 0)
      $put='----------------------------------------------------'
      $put='     0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F '
      $put='----------------------------------------------------'
    endif
  endwhile
endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""


 rate this tip  Life Changing Helpful Unfulfilling 

<<chop long lines. | Access [email protected] using Newsgroup Reader >>

Additional Notes

[email protected], October 5, 2003 18:15

Here is the screen shot:

http://www.clarkson.edu/~maxi/unicode.gif
Anonymous, February 18, 2006 5:43
hi
which font you using to display??
i cant get these foreign chars to display..
using winxp..
plus.. another note.. why the "freemono" fonts (http://www.nongnu.org/freefont/) are not available to select
in windows.. but available in *nixes..??
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
    stats
Sponsored by Web Concept Group Inc. SourceForge.net Logo