Daniel Dadush wrote:
Thanks so much, it does seem like I'm having a font problem. When I changed gfn=Courier_New:h12 I was able to properly see hebrew text, but if I opened the japanese translation I have the same problem as before. This is not to say that I speak japanese, but I was just wondering if there was a way for vim to autodetect a suitable font dependent on the unicode characters present in the file. Is there a universal font by any chance? (that would be too easy right). Also if I'm using the command line version of vim, will gui_font still work or do I need to set another option?
There may be a universal font, and certainly there will someday be one (as the trend seems to be towards Unicode) but I haven't yet found a fixed-width one to my satisfaction. On Windows I use Lucida_Console for Latin-only editing, Courier_New for Cyrillic and/or Arabic, and MingLiU for East-Asian ideograms. When a page includes all of these charsets, for instance when editing my frontpage http://users.skynet.be/antoine.mechelynck/index.htm , I switch between Courier_New and MingLiU depending on which part of the page I'm editing at the moment. Vim can guess that a page is or isn't encoded in UTF-8, but it cannot guess if such a page includes Russian, Arabic, Hebrew, Chinese, or even only Latin script. Also, 'guifont' is a global option, common to all files visible in any split windows, so changing it when loading a file would usually not be ideal.
As for console Vim, it has no control at all over the font being used: the console terminal does it. So 'guifont' doesn't work in console Vim, nor can you display any glyphs not present in both the 'termencoding' (the terminal's charset) and the font presently being used by the terminal. Console Vim (if compiled with +multi_byte) can still edit any Unicode or other file properly, you just won't see what the terminal can't display -- you have to use ga (in Normal mode) to know what is under the cursor if what you see is a "placeholder" blank or ? glyph meaning "I can't display this character".
By the way, the expression "the command-line version of Vim" that you're using is a misnomer. You can call gvim from the command line, with the same command-line arguments as console Vim, it will just detach itself from the Dos Box (or other console terminal) when opening the GUI window. (On Linux, but not on Windows, there should be an & at the end of the command-line to get the shell prompt back, and of course -again on Linux only- you must do it from an xterm, not from the bare-bones linux text-only non-X display.)
Best regards, Tony.