eschulte / rinari

Rinari Is Not A Rails IDE (it is an Emacs minor mode for Rails)
http://rinari.rubyforge.org
GNU General Public License v3.0
412 stars 68 forks source link

Need better buffer names with rinari #70

Closed jaseemabid closed 11 years ago

jaseemabid commented 11 years ago

This is a feature request than a bug report

Rinari should do a better job at naming buffers.

Right now I am working on a moderate sized rails project with a few controllers and almost all of them have view files named index.html.haml, show.html.haml etc. Emacs by default names them index.html.haml<n> etc, which is pretty useless. It would be great if we can add a buffer naming scheme to make things clearer.

For example, we can name controllers controller-{controller_name}, like controller-users or controller-files instead of users_controller.rb. Same goes with views. 'view-{controller}-{action}' will be a lot more useful than a index.html.haml<3>, like 'view-users-show'. Similar names for assets, config files, logs etc.

Thoughts?

dgutov commented 11 years ago
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)
purcell commented 11 years ago

Yep, agree with @dgutov here -- Emacs has great facilities for doing this already. :-)

jaseemabid commented 11 years ago

Hey this looks good, problem solved :) Thanks @dgutov @purcell Its almost the orig idea with no effort.

purcell commented 11 years ago

And it helps everywhere, not just in rinari projects. I personally use these uniquify settings:

(setq uniquify-buffer-name-style 'reverse)
(setq uniquify-separator " • ")
(setq uniquify-after-kill-buffer-p t)
(setq uniquify-ignore-buffers-re "^\\*")