Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim-powerline plugin problems

Tags:

vim

plugins

fonts

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

like image 701
Nutritioustim Avatar asked Aug 22 '12 05:08

Nutritioustim


2 Answers

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
like image 167
Conner Avatar answered Nov 15 '22 17:11

Conner


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.

like image 39
romainl Avatar answered Nov 15 '22 15:11

romainl