6

I'm having problems showing the right fonts or glyphs in my VMWare hosted Ubuntu instance.

webkell@ubuntu:~$ uname -a
Linux ubuntu 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:36:48 UTC 2010 i686 GNU/Linux

I've i) installed vim-powerline using Vundle and ii) applied the fontpatcher as described in the "linux" section of that guide, but I'm still seeing weird characters as seen in this screenshot:

this screenshot.

I've tried the fonts Lucida Sans Typewriter-Powerline.otf and Monaco_Linux-Powerline.ttf in the user supplied Powerline fonts. I even tried setting set guifont=MyFont on the linux instance. But that didn't help.

Is there some special incantation I have to use to make this work on my VMWare hosted Ubuntu? It works fine on the host Mac.

Thanks

Conner
  • 30,144
  • 8
  • 52
  • 73
Nutritioustim
  • 2,686
  • 4
  • 32
  • 57

2 Answers2

12

You're using a Linux font when you need a Mac font. Try using this one. Yes, you're accessing a Linux machine, but you're displaying the font with OSX, so that is the font that needs to be Powerline enabled.

Download and unzip it then add the .otf to your Font Book.app by using ⌘O inside the application and locating the font. Then set your Terminal.app's font to Monaco for Powerline in the preferences (this might be what you're missing). I move between MacVim and terminal vim, so I set the font like this in my ~/.vimrc:

if has("gui_running")
   let s:uname = system("uname")
   if s:uname == "Darwin\n"
      set guifont=Monaco\ for\ Powerline
   endif
endif
Conner
  • 30,144
  • 8
  • 52
  • 73
  • 1
    Ah, all I had to do was add the Monaco Powerline font to FontBook. Then indeed, using vim on the host mac or guest linux works. Sweet, and much thanks. – Nutritioustim Aug 22 '12 at 12:48
8

The placeholder glyphs are not your only problem: powerline is supposed to have colorful backgrounds as well.

I see this line in your ~/.vimrc:

set term=builtin_xterm

you should change it to:

set term=xterm-256color

or let your shell deal with it. I think that it will fix the colors problem and possibly the font handling problem as well.

The values returned by these commands should be utf-8:

set encoding?
set termencoding?

Is that what you get?

Ho… and set nocompatible is not necessary at all. "nocompatible" is automatically set when Vim finds a .vimrc.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • Ok, I removed the `set term`, and the colors are coming up. That's great ! And those set values give me `encoding=utf-8` and `termencoding=` respectively. Other than that, I'm still getting those weird glyphs. – Nutritioustim Aug 22 '12 at 12:41
  • Check if your remote machine supports utf-8 with `$ echo $LANG`, `$ echo $LC_ALL` and `$ echo $LC_CTYPE` and try `set termencoding=utf-8`. – romainl Aug 22 '12 at 12:50