tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.11k stars 384 forks source link

Command (":Rlocales"?) to open locale files in splits #113

Open henrik opened 13 years ago

henrik commented 13 years ago

I've implemented a simple version of this: https://github.com/henrik/dotfiles/blob/master/vimrc#L251-263

Possible extensions: provide arguments with autocompletion to jump to or add a specific key (":Rloc foo.bar.baz"), and/or provide arguments to open other locale files than the root set (":Rloc" to open config/locales/*.yml, ":Rloc defaults" to open config/locales/defaults/*.yml).

henrik commented 13 years ago

I see there is a :Rlocale currently that will open single locale files. I love being able to open multiple locales in splits, but I'm not sure how best to integrate that functionality. Maybe simply have that be the behavior with an empty argument, instead of opening the default locale file? For apps that only have one locale, the effect is the same. For apps with multiple locales, the new behavior might be more useful. Though I'm not sure how opening multiple windows/splits would go together with variations like :RSlocale and :RVlocale.

tpope commented 13 years ago

I wasn't on board until you mentioned the default would be the same with one locale. When I refactor the navigation code (it's long overdue: it's some of the oldest Vimscript I've written), I'll see if I can accommodate that. Until that refactoring is done, however, trying to bolt on this behavior is a fool's errand.

henrik commented 13 years ago

That's good enough for me. Thanks!

Mange commented 12 years ago

Possible extensions: provide arguments with autocompletion to jump to or add a specific key (":Rloc foo.bar.baz"), and/or provide arguments to open other locale files than the root set (":Rloc" to open config/locales/.yml, ":Rloc defaults" to open config/locales/defaults/.yml).

How would this work when any given locale has X files? Like this:

config/locales/
  en/
    flashes.yml
    models.yml
    forms.yml
  sv/
    defaults.yml
    flashes.yml
    models.yml
    forms.yml