yaml-vim


Ⅰ. 插件描述

YAML Highlight script for VIM editor

Ⅱ. 基本信息

创建日期:  2008-09-21
使用用户:  102
Github星:  53
插件作者:  Ingy döt Net

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'ingydotnet/yaml-vim-better-than-revenge'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'ingydotnet/yaml-vim-better-than-revenge'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'ingydotnet/yaml-vim-better-than-revenge'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Vim syntax file

Language: YAML (YAML Ain't Markup Language) 1.2

Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>

Credits: Nikolai Weibull <now@bitwi.se>

Igor Vergeichik <iverg@mail.ru>

Support: Ingy döt Net <ingy@ingy.net>

Tom Sawyer <transami@transami.net>

Last Change: 2010-10-08

Version: 2.1

YAML.VIM and YAML collection sorting scripts:

INSTALLATION:

  • Put syntax/yaml.vim in vim's syntax folder (/usr/share/vim/syntax on my system)
  • Add the .yaml/.yml extensions to the filetype.vim file: |
    " Yaml
    au BufNewFile,BufRead .yaml,.yml setf yaml
  • If you want add a new enty to the syntax menu:
    an 50.110.370 &Syntax.WXYZ.Yaml :cal SetSyn("yaml")<CR>
  • Put yamlsort.rb and yamlsort.vim into ~/.vim/scripts directory.

SORT USE:

  • Type vim command: |
    :source ~/.vim/scripts/yamlsort.vim
  • Then: >
    <F4> is mapped to sort YAML collections in direct order,
    and <F5> in reversed order.

NOTES:

  • If you want change key mapping of sorting rules edit yamlsort.vim

TODO:

  • Work with short notation of collections and mappings ({}, [])
  • Support sorting of multiline values

Changelog:
2010-02-19:

  • Merge Nikolai Weibull's rendition of yaml.vim (thanks to Phill Baker).
    2002-06-09:
  • Key field can contain any number of spaces before column.
  • If any record of collection does not key field (i.e field which

    value is used in sorting), it is placed to the end of collection.

添加新评论