Ⅰ. 插件描述
highlight plain text files, suit most casesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'zsaberlv0/zfvimtxthighlight'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'zsaberlv0/zfvimtxthighlight'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'zsaberlv0/zfvimtxthighlight'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/zsaberlv0/zfvimtxthighlight
Ⅳ. 文档说明
# ZFVimTxtHighlight
vim script to highlight plain text files
here is a screenshot with xterm16 colorscheme

if you like my work, check here for a list of my vim plugins
How to use
use Vundle or any other plugin manager you like to install
Plugin 'ZSaberLv0/ZFVimTxtHighlight'by default, all
textfiles or any other file that have nosyntaxspecified,
would be set tozftxtassyntaxyou can disable it by setting:
let g:zf_txt_auto_highlight=0
or, set the file type to auto enable:
let g:zf_txt_auto_syntax = ['', 'txt', 'text']or, you may want to set `syntax` manually when necessary:
set syntax=zftxtor, replace original file type detect:
autocmd FileType html,markdown set syntax=zftxtby default, files that larger than 5MB would be ignored from highlight,
you may change this setting bylet g:zf_txt_large_file=5*1024*1024
Add your custom keyword
to add your custom syntax or keyword,
add*.vimfile to yourrtp(:h rtp),
with this directory structure:rtp/ zftxt/ your_syntax.vim
the `*.vim` file would be sourced (`:h :source`) during highlighting,
see `zftxt.vim` itself for examples
Functions
:call ZF_VimTxtHighlightToggle(): toggle current file syntax:call ZF_VimTxtHighlightEcho()or:ZFHIGHLIGHT: echo the highlight info of the word under cursor