我如何设置我的vim航空公司或vim-powerline ?

时间:2022-10-05 17:19:17

Hello I am trying to install vim-powerline or new-powerline or vim-airline on Windows7 on a 64bit version of vim But I cannot get either of those working.

你好,我正在尝试在Windows7上安装vim-powerline或新电力线或vim-airline,在64位版本的vim中,但我无法得到其中任何一个工作。

In vim-powerline: I get the status line but can't see the nice '<' delimiters: 我如何设置我的vim航空公司或vim-powerline ? I installed the plugin via Vundle and updated my _vimrc

在vim-powerline中:我获得了状态行,但看不到nice的“<”分隔符:我通过Vundle安装了这个插件,并更新了我的_vimrc。

let g:Powerline_symbols = 'fancy'
set encoding=utf-8
set t_Co=256
set fillchars+=stl:\ ,stlnc:\
let g:Powerline_mode_V="V·LINE"
let g:Powerline_mode_cv="V·BLOCK"
let g:Powerline_mode_S="S·LINE"
let g:Powerline_mode_cs="S·BLOCK"

Any combinaison looks pretty much the same. It seems that one might have to install new fonts, but there is no how-to for windows,

任何组合看起来都差不多。似乎人们可能不得不安装新的字体,但对于windows来说,并没有什么可操作的,

vim-airline I finally found those fonts looking at the vim-airline plugin.

我终于在vim航空公司找到了这些字体。

Once again I can't get it quite right, I can see some ugly '<<' 我如何设置我的vim航空公司或vim-powerline ? This is not the beautiful screenshot provided

再一次,我不能完全正确,我可以看到一些难看的< <这不是美丽的截图提供的。< p>

3 个解决方案

#1


58  

You didn't use a patched font! Patching means manually adding the six extra symbols to the font at specific places in UTF formatted fonts. If these symbols are not present, you get the ugly placeholder blocks, which you are getting. You can either patch by yourself using fontforge (not easy!) or you can simply download and install a pre-patched font from this page:

你没有用过补丁的字体!Patching意思是在UTF格式的字体中,在特定的位置手工添加6个额外的符号。如果这些符号不存在,你就会得到一个丑陋的占位符块。你可以使用fontforge(不容易!)或者你可以简单的下载和安装一个预先补丁的字体从这个页面:

https://github.com/Lokaltog/powerline-fonts

https://github.com/Lokaltog/powerline-fonts

Installing a font in Windows is easy: Rightclick and choose Install. Then you set it as usual like this in your _vimrc:

在Windows中安装字体很简单:右键单击并选择Install。然后你像往常一样把它设置在你的_vimrc中:

set guifont=Liberation_Mono_for_Powerline:h10 

Linux .vimrc for completeness

Linux . vimrc出于完整性的考虑

set guifont=Liberation\ Mono\ for\ Powerline\ 10 

Then for airline

然后对航空公司

let g:airline_powerline_fonts = 1

or powerline

或电力线

let g:Powerline_symbols = 'fancy'

Other settings are merely optional.

其他设置仅仅是可选的。

Restart and enjoy *line.

重启并享受*线。


If you patch manually, here's a hint I learned painfully: After patching the normal font don't forget to patch the bold and italic fonts as well...

如果你手动修补,这里有一个提示,我很痛苦地学会了:在修补了正常的字体之后,不要忘记贴补粗体和斜体的字体。

#2


31  

I had similar issue for vim-airline, it was resolved by going into the help file

我对vim航空公司也有类似的问题,它通过进入帮助文件解决了。

:h airline

scroll down to the customization section or search

向下滚动到自定义部分或搜索。

/unicode symbols

copy this three lines below into your ~/.vimrc:

将这三行复制到你的~/.vimrc中:

if !exists('g:airline_symbols')
  let g:airline_symbols = {}
endif

then copy the unicode symbols from airline help into your ~/.vimrc mine looks like this:

然后将航空公司的unicode符号复制到您的~/中。vimrc我的是这样的:

  if !exists('g:airline_symbols')
    let g:airline_symbols = {}
  endif

  " unicode symbols
  let g:airline_left_sep = '»'
  let g:airline_left_sep = '▶'
  let g:airline_right_sep = '«'
  let g:airline_right_sep = '◀'
  let g:airline_symbols.linenr = '␊'
  let g:airline_symbols.linenr = '␤'
  let g:airline_symbols.linenr = '¶'
  let g:airline_symbols.branch = '⎇'
  let g:airline_symbols.paste = 'ρ'
  let g:airline_symbols.paste = 'Þ'
  let g:airline_symbols.paste = '∥'
  let g:airline_symbols.whitespace = 'Ξ'

start a new terminal session and launch your vim or mvim as in my case, status line arrows for airline was sorted out for me.

启动一个新的终端会话,并启动vim或mvim,就像我的情况一样,航空公司的状态线箭头已经为我整理好了。

#3


6  

I met the same problem and it was fixed by:

我遇到了同样的问题,它是固定的:

let g:airline_powerline_fonts = 1

#1


58  

You didn't use a patched font! Patching means manually adding the six extra symbols to the font at specific places in UTF formatted fonts. If these symbols are not present, you get the ugly placeholder blocks, which you are getting. You can either patch by yourself using fontforge (not easy!) or you can simply download and install a pre-patched font from this page:

你没有用过补丁的字体!Patching意思是在UTF格式的字体中,在特定的位置手工添加6个额外的符号。如果这些符号不存在,你就会得到一个丑陋的占位符块。你可以使用fontforge(不容易!)或者你可以简单的下载和安装一个预先补丁的字体从这个页面:

https://github.com/Lokaltog/powerline-fonts

https://github.com/Lokaltog/powerline-fonts

Installing a font in Windows is easy: Rightclick and choose Install. Then you set it as usual like this in your _vimrc:

在Windows中安装字体很简单:右键单击并选择Install。然后你像往常一样把它设置在你的_vimrc中:

set guifont=Liberation_Mono_for_Powerline:h10 

Linux .vimrc for completeness

Linux . vimrc出于完整性的考虑

set guifont=Liberation\ Mono\ for\ Powerline\ 10 

Then for airline

然后对航空公司

let g:airline_powerline_fonts = 1

or powerline

或电力线

let g:Powerline_symbols = 'fancy'

Other settings are merely optional.

其他设置仅仅是可选的。

Restart and enjoy *line.

重启并享受*线。


If you patch manually, here's a hint I learned painfully: After patching the normal font don't forget to patch the bold and italic fonts as well...

如果你手动修补,这里有一个提示,我很痛苦地学会了:在修补了正常的字体之后,不要忘记贴补粗体和斜体的字体。

#2


31  

I had similar issue for vim-airline, it was resolved by going into the help file

我对vim航空公司也有类似的问题,它通过进入帮助文件解决了。

:h airline

scroll down to the customization section or search

向下滚动到自定义部分或搜索。

/unicode symbols

copy this three lines below into your ~/.vimrc:

将这三行复制到你的~/.vimrc中:

if !exists('g:airline_symbols')
  let g:airline_symbols = {}
endif

then copy the unicode symbols from airline help into your ~/.vimrc mine looks like this:

然后将航空公司的unicode符号复制到您的~/中。vimrc我的是这样的:

  if !exists('g:airline_symbols')
    let g:airline_symbols = {}
  endif

  " unicode symbols
  let g:airline_left_sep = '»'
  let g:airline_left_sep = '▶'
  let g:airline_right_sep = '«'
  let g:airline_right_sep = '◀'
  let g:airline_symbols.linenr = '␊'
  let g:airline_symbols.linenr = '␤'
  let g:airline_symbols.linenr = '¶'
  let g:airline_symbols.branch = '⎇'
  let g:airline_symbols.paste = 'ρ'
  let g:airline_symbols.paste = 'Þ'
  let g:airline_symbols.paste = '∥'
  let g:airline_symbols.whitespace = 'Ξ'

start a new terminal session and launch your vim or mvim as in my case, status line arrows for airline was sorted out for me.

启动一个新的终端会话,并启动vim或mvim,就像我的情况一样,航空公司的状态线箭头已经为我整理好了。

#3


6  

I met the same problem and it was fixed by:

我遇到了同样的问题,它是固定的:

let g:airline_powerline_fonts = 1