vim-rails icon indicating copy to clipboard operation
vim-rails copied to clipboard

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

Open henrik opened this issue 14 years ago • 4 comments

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 avatar Aug 27 '11 08:08 henrik

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.

henrik avatar Aug 27 '11 08:08 henrik

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.

tpope avatar Aug 27 '11 18:08 tpope

That's good enough for me. Thanks!

henrik avatar Aug 27 '11 21:08 henrik

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

Mange avatar Nov 29 '11 07:11 Mange