Ⅰ. 插件描述
Patched version of the font Consolas for PowerlineⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'nicolalamacchia/powerline-consolas'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'nicolalamacchia/powerline-consolas'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'nicolalamacchia/powerline-consolas'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/nicolalamacchia/powerline-consolas
Ⅳ. 文档说明
Consolas for Powerline
This is the patched version of the Consolas font for MS Windows. This font is
compatible with
vim-powerline
and
powerline.
I've manually patched the original font since it's practically impossible to
use correctly the Powerline fontpatcher with it. I think this is due to a
series of reasons (that I won't list here) that aren't directly correlated to
the script itself.
Installation and usage
Install the vanilla Consolas font family
Fist of all you need the Consolas font family to be installed on your system.
If you're running Windows Vista or later, you should find it already installed,
otherwise here's how you can install it manually:
- download Microsoft PowerPoint Viewer for free from the Microsoft Download
Center; - extract the downloaded
.exeinstaller (PowerPointViewer.exe); - find the file
ppviewer.cabsomewhere inside the extracted folder and
extract it too; - install
CONSOLA.ttf,CONSOLAB.ttf,CONSOLAI.ttfandCONSOLAZ.ttf
contained within the unpackedppviewer.cab.
NOTE: Consolas comes also bundled with the following packages and software:
- Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint File
Formats; - Microsoft Visual Studio (2005+, the Consolas font package is available for
download from the Microsoft Download Center for the older versions); - Microsof Office (2007+).
Use the patched font
To use this font, just download the file consola.ttf and install it, then
put the following lines in your vimrc file:
" Setting the font to Consolas, 11 pt
if has("gui_running")
if has("gui_gtk2")
set guifont=Consolas\ 11
else
set guifont=Consolas:h11
endif
endif
If you need fallback fonts, do the following:
if has('gui_win32')
" On Vim 7.4.16 the following line still doesn't work with gui_gtk
set guifont=Consolas:h11:cANSI,Inconsolata:h12,Courier New:h11
else " not win32
let consolas=system('fc-list | grep -c Consolas')
let inconsolata=system('fc-list | grep -c Inconsolata')
if (consolas > 0)
set guifont=Consolas\ 11
elseif (inconsolata > 0)
set guifont=Inconsolata\ 12
else
set guifont=DejaVu\ Sans\ Mono\ 10
" or simply
" set guifont=Monospace\ 10
endif
endif
See :help guifont and :help setting-guifont in Vim.
Please note that to install this font you'll need to overwrite the original
one! Do your backups, if you want, I'm not responsible for the loss of your
previous version of Consolas! Anyway, in case you do lose it and want it back,
follow the instructions above to reinstall it.
Why overwrite?
I made a version of this font with a different family name ("Powerline
Consolas") which was giving me lot of headaches and was killing my free time.
I couldn't end up with working alternative styles ( bold, italic and
bold italic ) when re-generating them from the original ttf files. I
decided, then, to take advantage of the existing Consolas family. Perhaps this
solution is less elegant, but at least it works.
Further information and troubleshooting
Always refer to the vim-powerline or powerline
documentation if something doesn't work as you expected and to understand how
Powerline itself works.
You could also find helpful this article by Eugene Ching, which
inspired me.
For more information about the Consolas font family, visit [this
page][Microsoft] (copyright, trademarks and technical details) and [this
page][LucasFonts] (history).
Please, contact me if the font is being naughty with you.