Vim powerline (Lokaltog's) weird characters in MacVim

后端 未结 6 1883
刺人心
刺人心 2021-02-09 00:52

I\'m trying to use Powerline plugin (https://github.com/Lokaltog/vim-powerline) for the first time.

Plugin seems to be installed. I use vundle with the following command

相关标签:
6条回答
  • 2021-02-09 00:57

    You're referring to two different plugins. vim-powerline is the old vim-only project. Lokaltog/powerline is a new Python-based port, and the code points have changed in this version because the old code points caused a bunch of issues.

    You'll have to either:

    1. Update your bundle to point to vim-powerline (and remove the rtp option), or
    2. Update your font to one of the fonts in https://github.com/Lokaltog/powerline-fonts (or patch your own)
    0 讨论(0)
  • 2021-02-09 00:57

    In my case, fonts in the status bar were working in vim (displaying the proper symbols) but not in macvim. Added the following line to the .gvimrc file and it works fine now.

    I had specify :h16

    set guifont=Source\ Code\ Pro\ for\ Powerline:h16 
    

    0 讨论(0)
  • 2021-02-09 01:13

    If you are using command-line vim (i.e. not a GUI implementation) you may need to specify the patched font in your terminal's preferences.

    0 讨论(0)
  • 2021-02-09 01:18

    adding this to the vimrc file fixed it for me:

    set guifont=Source\ Code\ Pro\ for\ Powerline "make sure to escape the spaces in the name properly
    

    Source: https://github.com/bling/vim-airline/issues/142

    0 讨论(0)
  • 2021-02-09 01:18

    Also make sure you have the right fonts not just the right name get them from https://github.com/Lokaltog/powerline-fonts and that let g:airline_powerline_fonts = 1 that if your using airline

    Note:For example "Source code pro" font from http://fontsquirrel.com will give this effect but the "Source code pro for powerline" from the link above will not

    0 讨论(0)
  • 2021-02-09 01:21

    I had the same problem. I downloaded "Menlo Regular for Powerline.otf" from https://github.com/Lokaltog/powerline-fonts

    I then double clicked on the otf file, which opens up the Font Book application. I clicked install, despite the font giving gibberish symbols in the window. I then set that font as the font for my terminal (simply set it in your termnial preferenes). This fixed the problem in regular terminal vim ($ vim), but did not fix it in MacVim. To fix it in MacVim, I had to add the following line to my .vimrc file:

    set guifont=Menlo\ For\ Powerline
    

    The backslashes are necessary to escape the spaces. Everything works great now. Hope this helps others.

    Edit: To add a bit more detail, my .vimrc looks like this now:

    """ FOR STATUSLINE
    set encoding=utf-8 " Necessary to show Unicode glyphs
    let g:Powerline_symbols = 'fancy'
    set rtp+=/Users/nate/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim
    set nocompatible   " Disable vi-compatibility
    set laststatus=2   " Always show the statusline
    " For powerline font in MacVim
    set guifont=Menlo\ For\ Powerline
    
    0 讨论(0)
提交回复
热议问题