Created
January 5, 2015 11:38
-
-
Save michel/7e2c210b973123220ec8 to your computer and use it in GitHub Desktop.
jump to alternative language file in rails
This file contains hidden or 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 EditAlternativeLocal() | |
let filename = bufname("%") | |
if filename =~ "\.nl\.yml" | |
let alt_filename = substitute(filename, ".nl.yml", ".en.yml", "g") | |
execute "e " . alt_filename | |
elseif filename =~ "\.en\.yml" | |
let alt_filename = substitute(filename, ".en.yml", ".nl.yml", "g") | |
execute "e " . alt_filename | |
endif | |
endfunction | |
command L :call EditAlternativeLocal() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome!