Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (37 sloc) 1.48 KB
# Vim syntax file
# Language: YAML (YAML Ain't Markup Language) 1.2
# Maintainer: Nikolai Pavlov <>
# Credits: Nikolai Weibull <>
# Igor Vergeichik <>
# Support: Ingy döt Net <>
# Tom Sawyer <>
# Last Change: 2010-10-08
# Version: 2.1
YAML.VIM and YAML collection sorting scripts:
- 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.
- Type vim command: |
:source ~/.vim/scripts/yamlsort.vim
- Then: >
<F4> is mapped to sort YAML collections in direct order,
and <F5> in reversed order.
- If you want change key mapping of sorting rules edit yamlsort.vim
- Work with short notation of collections and mappings ({}, [])
- Support sorting of multiline values
- Merge Nikolai Weibull's rendition of yaml.vim (thanks to Phill Baker).
- 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.