Ⅰ. 插件描述
Unicode goodness for Python code using vim's “conceal” featureⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ehamberg/vim-cute-python'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ehamberg/vim-cute-python'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ehamberg/vim-cute-python'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ehamberg/vim-cute-python
Ⅳ. 文档说明
This syntax file displays unicode characters for some Python operators and
built-in functions, turning the following:
map (lambda x: x, [1,2,3])
def foo(e, a):
if e in [1,2,3] and not a:
return math.sqrt(math.pi)
else:
return sum([1,2,3])into
map (λ x: x, [1,2,3])
def foo(e, a):
if e ∈ [1,2,3] ∧ ¬a:
return √(π)
else:
return ∑([1,2,3])Screenshot:

This does not – at any point – alter your source code. It simply uses Vim's
"conceal" feature to “hide” in behind ∈, etc. Whenever the cursor is at
a line with concealed text, the text will be expanded.
To install, simply put python.vim in ~/.vim/after/syntax or use a plug-in
manager such as vim-plug or
pathogen.vim.
Vim ≥ 7.3 is required.
The branch moresymbols
includes commits from various people that add even more conceal replacements. I
try to maintain a healthy balance in the master branch, but if you like to
conceal even more operators or don't mind slight inaccuracies in what
mathematical symbols are used to represent, you should have a look at the extra
symbols in the moresymbols branch.
This plug-in is very much inspired by
http://github.com/Twinside/vim-haskellConceal