zfvimtxthighlight


Ⅰ. 插件描述

highlight plain text files, suit most cases

Ⅱ. 基本信息

创建日期:  2016-03-16
使用用户:  1
Github星:  2
插件作者:  ZERO

Ⅲ. 安装方法

使用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

screenshot

if you like my work, check here for a list of my vim plugins

How to use

  1. use Vundle or any other plugin manager you like to install

    Plugin 'ZSaberLv0/ZFVimTxtHighlight'
  2. by default, all text files or any other file that have no syntax specified,
    would be set to zftxt as syntax

    you 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=zftxt
or, replace original file type detect:
autocmd FileType html,markdown set syntax=zftxt
  1. by default, files that larger than 5MB would be ignored from highlight,
    you may change this setting by

    let g:zf_txt_large_file=5*1024*1024

Add your custom keyword

  • to add your custom syntax or keyword,
    add *.vim file to your rtp (: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

添加新评论