Skip to content

Instantly share code, notes, and snippets.

@michel
Created January 5, 2015 11:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michel/7e2c210b973123220ec8 to your computer and use it in GitHub Desktop.
Save michel/7e2c210b973123220ec8 to your computer and use it in GitHub Desktop.
jump to alternative language file in rails
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()
@JeroenKnoops
Copy link

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment