vim-shufflefonts


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2015-03-14
使用用户:  2
Github星:  1
插件作者:  Zader Zheng

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'yums/vim-shufflefonts'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'yums/vim-shufflefonts'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'yums/vim-shufflefonts'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/yums/vim-shufflefonts

Ⅳ. 文档说明

# vim-shufflefonts

This is a productivity VIM plugin which will pick a random font from your carefully picked 'font playlist' automatically when you read a new file or switch the window. And of course, you can manually switch to the next font whenever you want.

I call it productivity plugin because codes are usually updated so slow that they almost look the same. Fast changing fonts will make your codes not that rotten to touch.

So get this and your ‘font playlist’ and make your one day two.

Dependency

Since vim-fontsize has already done some great infrastructural font related processing works, I decided to get benefits from it.

So, You need to also add his plugin to make this one work.

Installation

It is Vundle which showed a noob like me a way to separate my own plugins from everything-mixed-together .vimrc file. So I’ll only tell you how to do it with Vundle:

Append

    Bundle 'drmikehenry/vim-fontsize'
    Bundle 'YuMS/vim-shufflefonts'

in your .vimrc.

Execute

    $vim +BundleInstall

and it should work.

Customization - IMPORTANT

Playlist

A font playlist is required, or this plugin won’t do anything. 5 configuration values are bound with it:

  • g:shufflefonts_fonts_list
  • g:shufflefonts_fonts_list_all
  • g:shufflefonts_fonts_list_windows
  • g:shufflefonts_fonts_list_mac
  • g:shufflefonts_fonts_list_linux

When g:shufflefonts_fonts_list is set, the other 4 configurations are ignored. Otherwise, g:shufflefonts_fonts_list_all and the one corresponding to your working operating system are concatenated and used.

Sample 1:

let g:shufflefonts_fonts_list = [
     \'Inconsolata',
     \'Consolas',
 \]

Sample 2:

let g:shufflefonts_fonts_list_all = [
    \'Inconsolata',
\]
let g:shufflefonts_fonts_list_windows = [
    \'Consolas',
\]
let g:shufflefonts_fonts_list_linux = [
    \'Ubuntu Mono',
\]

Note that font names vary a bit on different platforms: they use space to seperate words on *nix but underline on Windows/Mac. But don’t worry about it because this is shufflefonts’s concern.(may fail in some corner cases)

Shuffle Switch

Auto changing can be disabled by:

let g:shufflefonts_on_switch = 0

Fonts

I found it beautiful for fonts on google fonts

Know Issues

As font name will be shown at statusline on switches, 'shufflefonts' may conflict with some plugins doing similar things. Like bling/vim-bufferline.

You can disable echoing of vim-bufferline by appending let g:bufferline_echo = 0 in your .vimrc if you want to know which font is it on showing up.

添加新评论