Ⅰ. 插件描述
Syntax highlighting and more for use with the Eve programming languageⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'frankier/vim-eve'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'frankier/vim-eve'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'frankier/vim-eve'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/frankier/vim-eve
Ⅳ. 文档说明
This (Neo)Vim plugin provides syntax highlighting and more for use [with
Eve](http://witheve.com/). It's hosted [on
Github](https://github.com/frankier/vim-eve). Currently it has the following
features:
- Syntax highlighting;
- Indentation;
- Folding;
- Automatic insertion of code fences.
Only syntax highlighting and indentation are enabled by default. All other
features are configurable and opt-in. I highly recommend taking a look at the
options in this document to mis:issue is:open make sure you get the most out of
this plugin.
Installation
It's easiest if you use a plugin manager. My favourite is
vim-plug. If you're also using
vim-plug, just add:
Plug 'frankier/vim-eve'
to ~/.vimrc or ~/.config/nvim/init.vim, restart (neo)vim and run :PlugInstall
Highlighting
There is one option for configuring highlighting currently:g:eve_highlight_markdown. By default Markdown sections will be highlighted as
- You can set this option to highlight them as Markdown. This isn't the
- because it provides poor contrast between the comments and the code.
If someone knows a good way to get the best of both worlds then I'm interested.
See the issues on Github.
Indentation
This plugin comes with an indentation definition. It will also indent Markdown
lists if you have
plasticboy/vim-markdown
installed.
Folds
This plugin can fold your code in a few ways.
For people, like myself, who don't usually fold code, there is a mode which
only folds the empty Markdown blocks which tend to appear in Eve programs which
don't use literate programming. These folds are not intended to be interacted
with, but are rather only intended to save vertical space. This mode is enabled
by setting g:eve_fold_empty to 1.
The other options are to generate folds for code blocks so that only Markdown
is visible by default. This can be enabled by setting g:eve_fold_code to 1.
Automatic insertion of code fences
This plugin can try and insert code fences, the characters which delimit Eve
and markdown blocks ( ` ), automatically for you as you type. Since this
behaviour can be quite invasive, it's opt-in. You can enable it by settingg:eve_insert_code_fence to 1. There are 3 types of code fence insertions
possible.
1) Eve block => Markdown block (abbreviated e2m)
2) Markdown block => Eve block (abbreviated m2e)
3) Eve block => New Eve block (adds an empty Markdown block, abbreviated e2e)
(The last type, when combined with g:eve_fold_empty is particularly nice for
writing non-literate Eve.)
Each type of fence is only inserted if your current line is preceded by a
certain number of blank lines. An m2e or e2e fence is inserted when you finish
typing search, bind or commit in a Markdown block or in an Eve block
- An e2m fence is inserted when you start a line with something
- than
searchin an Eve block.
The number of blank lines for each fence is configurable withg:eve_TYPE_blanks where TYPE is one of the abbreviations above. For Eve to
Eve fences, new Eve blocks starting with search can be special cased to
require a different number of blank lines using g:eve_e2e_blanks_search. The
minimum values which make writing Eve code viable are:
let g:eve_e2m_blanks = 1
let g:eve_m2e_blanks = 0
let g:eve_e2e_blanks = 1
let g:eve_e2e_blanks_search = 0
The default values are chosen more conservatively to help prevent incorrect
insertions and are equivalent to:
let g:eve_e2m_blanks = 2
let g:eve_m2e_blanks = 2
let g:eve_e2e_blanks = 2
let g:eve_e2e_blanks_search = g:eve_e2e_blanks
My personal customisation of these defaults is to set
let g:eve_e2e_blanks = 1
let g:eve_e2e_blanks_search = 0
You can also disable a particular type of fence insertion altogether by settingg:eve_TYPE_blanks = -1
Contributing
This is my first Vim plugin and may be rough around the edges. If you run into
any problems, please file an issue. Suggestions and advice in the issues is
also humbly solicited, especially if you have any experience with vimscript and
can see better ways of doing things. If you want to fix any problems or add new
features, pull requests are very welcome.
License
Copyright © Frankie Robertson. Dual licensed under the Vim and Apache 2
licenses.