Permalink
Browse files

<leader>r works in MacVim as well, not just <D-r>.

  • Loading branch information...
1 parent a34217e commit 94fc46368351e935c07a26a9ebd6d426dd0c14e6 @henrik committed Dec 13, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 plugin/yaml_flattener.vim
View
@@ -10,13 +10,6 @@ if !has("ruby")
finish
endif
-let g:YAMLFlattener_key = '<Leader>r'
-
-" MacVim and not CLI.
-if has("gui_macvim") && has("gui_running")
- let g:YAMLFlattener_key = '<D-r>'
-end
-
" Thanks to https://github.com/hotchpotch/meta_framework-vim/blob/95eb37317eef061cec75c308eae273cc4256e1aa/meta_framework.vim#L23
let s:libfile = fnamemodify(resolve(expand('<sfile>:p')), ':p:h') . '/../lib/yamlator.rb'
execute 'rubyfile ' . s:libfile
@@ -55,5 +48,12 @@ endfunction
command! YAMLToggleFlatness call <SID>YAMLToggleFlatness()
if !hasmapto("YAMLToggleFlatness") && has("autocmd")
- exec 'au FileType yaml map <buffer> ' . g:YAMLFlattener_key . ' :YAMLToggleFlatness<CR>'
+
+ exec 'au FileType yaml map <buffer> <leader>r :YAMLToggleFlatness<CR>'
+
+ " MacVim and not CLI.
+ if has("gui_macvim") && has("gui_running")
+ exec 'au FileType yaml map <buffer> <D-r> :YAMLToggleFlatness<CR>'
+ end
+
endif

0 comments on commit 94fc463

Please sign in to comment.