Skip to content

Instantly share code, notes, and snippets.

@Genki-S
Created February 5, 2014 22:39
Show Gist options
  • Save Genki-S/8834793 to your computer and use it in GitHub Desktop.
Save Genki-S/8834793 to your computer and use it in GitHub Desktop.
function! g:yaml_load(filename)
ruby << EOF
require 'yaml'
obj = YAML.load_file(File.expand_path(VIM::evaluate('a:filename')))
obj_hash = obj.inspect.gsub('=>', ':').gsub('nil', '{}')
VIM::command("let l:ret = #{obj_hash}")
EOF
return l:ret
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment