Created
November 28, 2014 18:23
-
-
Save tkrs/2599a2712e8ea748de5e to your computer and use it in GitHub Desktop.
This scripts load yaml on the VIM using the if_python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:load_yaml(filename) | |
python << EOS | |
import vim, yaml | |
with open(vim.eval('a:filename'), 'r') as f: | |
obj = yaml.load(f) | |
obj_hash = str(obj).replace('None', '{}') | |
vim.command('let l:ret = %s' % obj_hash) | |
EOS | |
return l:ret | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Require PyYAML.
pip install PyYAML