Up until now, I''ve been using TextMate to develop my rails applications. However, I develop on a Linux box as well, and I want my development environment to be consistent over the two computers, my macbook and my linux box. So I decided to give emacs a try. I am slowly learning how to get a handle on this editor, and it''s loads of fun. I was wondering, if some of you other emacs rails people could post there .emacs files so that I (and anyone else interested) could check them out, and hopefully learn something from them. I am learning the emacs editor along side the rails-emacs el package. So far I''ve been pretty un-productive, but I am getting better. You know how in textmate you can hit Cmd-return and it will give you an indented new-line from wherever you are on the previous line? Is there a way to accomplish this in emacs? Also, I can''t seem to figure out how to set the tab indentation to 2 soft spaces. I''ve got (setq tab-width 2) in my emacs file, but it doesn''t seem to effect anything as I am still tabbing 8 spaces in everything but ruby/erb files. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 19, 1:05 pm, Matt Swasey <ruby...-b60islb68c7lL05M/teW5w@public.gmane.org> wrote:> Up until now, I''ve been using TextMate to develop my rails applications. > However, I develop on a Linux box as well, and I want my development > environment to be consistent over the two computers, my macbook and my > linux box. > > So I decided to give emacs a try. I am slowly learning how to get a > handle on this editor, and it''s loads of fun. > > I was wondering, if some of you other emacs rails people could post > there .emacs files so that I (and anyone else interested) could check > them out, and hopefully learn something from them. > > I am learning the emacs editor along side the rails-emacs el package. > So far I''ve been pretty un-productive, but I am getting better. You > know how in textmate you can hit Cmd-return and it will give you an > indented new-line from wherever you are on the previous line? > Is there a way to accomplish this in emacs?The command is newline-and-indent. It is usually bound to Control-J. Have you tried Control-H m (help for mode) and Control-H b (list key bindings) ?> Also, I can''t seem to figure out how > to set the tab indentation to 2 soft spaces. I''ve got (setq tab-width > 2) in my emacs file, but it doesn''t seem to effect anything as I am > still tabbing 8 spaces in everything but ruby/erb files.M-x set-variable ruby-indent-level 2 You might want to set that in your emacs initialization file. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, 2007-12-19 at 14:05 -0500, Matt Swasey wrote:> Up until now, I''ve been using TextMate to develop my rails applications. > However, I develop on a Linux box as well, and I want my development > environment to be consistent over the two computers, my macbook and my > linux box. > > So I decided to give emacs a try. I am slowly learning how to get a > handle on this editor, and it''s loads of fun. > > I was wondering, if some of you other emacs rails people could post > there .emacs files so that I (and anyone else interested) could check > them out, and hopefully learn something from them. > > I am learning the emacs editor along side the rails-emacs el package. > So far I''ve been pretty un-productive, but I am getting better. You > know how in textmate you can hit Cmd-return and it will give you an > indented new-line from wherever you are on the previous line? Is there > a way to accomplish this in emacs? Also, I can''t seem to figure out how > to set the tab indentation to 2 soft spaces. I''ve got (setq tab-width > 2) in my emacs file, but it doesn''t seem to effect anything as I am > still tabbing 8 spaces in everything but ruby/erb files. >Ok here is my .emacs file: (setq load-path (append (list nil "~/lisp/" "~/lisp/arorem/" "~/lisp/custom/" "~/lisp/nxml_mode/" "~/lisp/rinari/" "~/lisp/rinari/rhtml" "~/lisp/icicles" "~/lisp/shared/") load-path)) ;; here let''s load everything in proper order here (load "setup.el") (load "01bm.el") (load "02ruby_mode.el") (load "03rails.el") (load "04nxml.el") (load "05ido.el") ;;(load "07vm.el") (load "08fri.el") (load "09org.el") (load "10sql.el") (load "11erlang.el") (load "12rd.el") (load "13rcode.el") (load "last.el") (load "my_snippets.el") (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won''t work right. ''(bm-persistent-face ((((class color) (background light)) (:background "MistyRose" :foreground "Black")))) ''(font-lock-comment-face ((((class color) (min-colors 88) (background light)) (:foreground "grey64" :slant italic :family "-*-helvetica-medium-*-*-*-12-*-*-*-*-*-*-*"))))) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won''t work right. ) And You can download ready to run/work lisp files from http://syncnotes.googlecode.com/files/lisp.tar.bz2 The caveats are, I have obviously customized emacs, to suit my taste of key bindings, and hence for me Control-W is backward word delete, and region kill is C-X,C-K Other set of shortcuts are basically inspired from here: http://steve.yegge.googlepages.com/effective-emacs Unzip the archive and put it under directory ~/lisp . If you in home, it would automatically create that directory for you. lisp | |---- rinari |---- xxxx And put the above .emacs file in your home directory and restart your emacs. For using above packages, you must be running > Emacs 22 Snippets, ruby debugging, control/view/testcase switching, console, irb, and many other things should work out of the box. All the best -- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Very cool, that is getting closer. However, the newline-and-indent will still break a line if you are in the middle of it. The behaviour I am looking for, would be something like jumping to the end of the current line, followed by a newline-and-indent. Supposing there is no one command to accomplish this, is there a way to bind two actions to a single key combo? Thanks for you help! On Wed, 2007-12-19 at 19:49 -0800, kevin cline wrote:> On Dec 19, 1:05 pm, Matt Swasey <ruby...-b60islb68c7lL05M/teW5w@public.gmane.org> wrote: > > Up until now, I''ve been using TextMate to develop my rails applications. > > However, I develop on a Linux box as well, and I want my development > > environment to be consistent over the two computers, my macbook and my > > linux box. > > > > So I decided to give emacs a try. I am slowly learning how to get a > > handle on this editor, and it''s loads of fun. > > > > I was wondering, if some of you other emacs rails people could post > > there .emacs files so that I (and anyone else interested) could check > > them out, and hopefully learn something from them. > > > > I am learning the emacs editor along side the rails-emacs el package. > > So far I''ve been pretty un-productive, but I am getting better. You > > know how in textmate you can hit Cmd-return and it will give you an > > indented new-line from wherever you are on the previous line? > > Is there a way to accomplish this in emacs? > > The command is newline-and-indent. It is usually bound to Control-J. > Have you tried Control-H m (help for mode) and Control-H b (list key > bindings) ? > > > Also, I can''t seem to figure out how > > to set the tab indentation to 2 soft spaces. I''ve got (setq tab-width > > 2) in my emacs file, but it doesn''t seem to effect anything as I am > > still tabbing 8 spaces in everything but ruby/erb files. > > M-x set-variable ruby-indent-level 2 > > You might want to set that in your emacs initialization file.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you my friend, this is very useful. I see that you are using Rinari. I heard that the rails-emacs group was going to be merging rinari into itself. Did that already happen? Is that even accurate info? Thanks again! On Thu, 2007-12-20 at 11:18 +0530, hemant kumar wrote:> > On Wed, 2007-12-19 at 14:05 -0500, Matt Swasey wrote: > > Up until now, I''ve been using TextMate to develop my rails applications. > > However, I develop on a Linux box as well, and I want my development > > environment to be consistent over the two computers, my macbook and my > > linux box. > > > > So I decided to give emacs a try. I am slowly learning how to get a > > handle on this editor, and it''s loads of fun. > > > > I was wondering, if some of you other emacs rails people could post > > there .emacs files so that I (and anyone else interested) could check > > them out, and hopefully learn something from them. > > > > I am learning the emacs editor along side the rails-emacs el package. > > So far I''ve been pretty un-productive, but I am getting better. You > > know how in textmate you can hit Cmd-return and it will give you an > > indented new-line from wherever you are on the previous line? Is there > > a way to accomplish this in emacs? Also, I can''t seem to figure out how > > to set the tab indentation to 2 soft spaces. I''ve got (setq tab-width > > 2) in my emacs file, but it doesn''t seem to effect anything as I am > > still tabbing 8 spaces in everything but ruby/erb files. > > > Ok here is my .emacs file: > > (setq load-path > (append (list nil "~/lisp/" > "~/lisp/arorem/" > "~/lisp/custom/" > "~/lisp/nxml_mode/" > "~/lisp/rinari/" > "~/lisp/rinari/rhtml" > "~/lisp/icicles" > "~/lisp/shared/") > load-path)) > > ;; here let''s load everything in proper order here > (load "setup.el") > (load "01bm.el") > (load "02ruby_mode.el") > (load "03rails.el") > (load "04nxml.el") > (load "05ido.el") > ;;(load "07vm.el") > (load "08fri.el") > (load "09org.el") > (load "10sql.el") > (load "11erlang.el") > (load "12rd.el") > (load "13rcode.el") > (load "last.el") > (load "my_snippets.el") > > (custom-set-faces > ;; custom-set-faces was added by Custom. > ;; If you edit it by hand, you could mess it up, so be careful. > ;; Your init file should contain only one such instance. > ;; If there is more than one, they won''t work right. > ''(bm-persistent-face ((((class color) (background light)) > (:background "MistyRose" :foreground "Black")))) > ''(font-lock-comment-face ((((class color) (min-colors 88) (background > light)) (:foreground "grey64" :slant italic :family > "-*-helvetica-medium-*-*-*-12-*-*-*-*-*-*-*"))))) > (custom-set-variables > ;; custom-set-variables was added by Custom. > ;; If you edit it by hand, you could mess it up, so be careful. > ;; Your init file should contain only one such instance. > ;; If there is more than one, they won''t work right. > ) > > > And You can download ready to run/work lisp files from > http://syncnotes.googlecode.com/files/lisp.tar.bz2 > > The caveats are, I have obviously customized emacs, to suit my taste > of key bindings, and hence for me Control-W is backward word delete, > and region kill is C-X,C-K > > Other set of shortcuts are basically inspired from here: > http://steve.yegge.googlepages.com/effective-emacs > > Unzip the archive and put it under directory ~/lisp . If you in home, > it would automatically create that directory for you. > > lisp > | > |---- rinari > |---- xxxx > > > And put the above .emacs file in your home directory and restart your > emacs. For using above packages, you must be running > Emacs 22 > > Snippets, ruby debugging, control/view/testcase switching, console, > irb, and many other things should work out of the box. > > All the best > > > > -- > Let them talk of their oriental summer climes of everlasting > conservatories; give me the privilege of making my own summer with my > own coals. > > http://gnufied.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 20, 12:31 am, Matt Swasey <ruby...-b60islb68c7lL05M/teW5w@public.gmane.org> wrote:> Very cool, that is getting closer. However, the newline-and-indent will > still break a line if you are in the middle of it. The behaviour I am > looking for, would be something like jumping to the end of the current > line, followed by a newline-and-indent. Supposing there is no one > command to accomplish this, is there a way to bind two actions to a > single key combo?That would be Control-E Control-J, which requires only three key presses: control, E, J. You could create a keyboard macro or lisp function and bind it to some key and see if it really helps. I type Control-E- J so quickly that it wouldn''t make much difference to me. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve got some blog posts on setting up Aquamacs/generic emacs to use for Rails development and other stuff here: http://blog.katipo.co.nz/?p=39 http://blog.katipo.co.nz/?p=38 http://blog.katipo.co.nz/?p=21 You might some of it handy. Cheers, Walter P.S. - I must admit Aquamacs 1.2 is annoying the hell out of me right now, for some reason it has disabled C-space as "set mark". Some other funkiness that might be related to my set up, so be warned. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
P.P.S.- I hate wordpress, will eventually move to my own Rails app for blogging... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Cheers for this! Good stuff in there. On Dec 22, 2007, at 12:13 AM, Walter McGinnis wrote:> I''ve got some blog posts on setting up Aquamacs/generic emacs to use > for Rails development and other stuff here: > > http://blog.katipo.co.nz/?p=39 > > http://blog.katipo.co.nz/?p=38 > > http://blog.katipo.co.nz/?p=21 > > You might some of it handy. > > Cheers, > Walter > > P.S. - I must admit Aquamacs 1.2 is annoying the hell out of me > right now, for some reason it has disabled C-space as "set mark". > Some other funkiness that might be related to my set up, so be warned. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 19, 11:09 pm, kevin cline <kevin.cl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I type Control-E-J so quickly that it wouldn''t make much difference to me.I can''t help noting that the equivalent vi command would be "o". ///ark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Unless you are in insert-mode, then it would be escape-o. But first you''d have to check your mode, then type the command. About the same... On Dec 23, 10:08 pm, Mark Wilden <m...-OCn100epQuBBDgjK7y7TUQ@public.gmane.org> wrote:> On Dec 19, 11:09 pm, kevin cline <kevin.cl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I type Control-E-J so quickly that it wouldn''t make much difference to me. > > I can''t help noting that the equivalent vi command would be "o". > > ///ark--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 23, 1:03 pm, fredistic <fredis...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Unless you are in insert-mode, then it would be escape-o. But first > you''d have to check your mode, then type the command. About the > same...That''s not how vi users work. For us, there are commands (like o) and insertions (like ithisisaninsertion<Esc>). The Esc is part of the insertion. If you''re experienced, you don''t really have to think about modes. ///ark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I always wanted to use vim / gvim for rails development, I thought it was more elegant and simple compared to emacs, but the escape is a little far away to be comfortable in touch typing. I''m sure that someone will tell me that you can just remap Esc to another key, but this is my reasoning for choosing emacs in the end. On Dec 25, 2007, at 12:07 AM, Mark Wilden wrote:> > On Dec 23, 1:03 pm, fredistic <fredis...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Unless you are in insert-mode, then it would be escape-o. But first >> you''d have to check your mode, then type the command. About the >> same... > > That''s not how vi users work. For us, there are commands (like o) and > insertions (like ithisisaninsertion<Esc>). The Esc is part of the > insertion. If you''re experienced, you don''t really have to think about > modes. > > ///ark > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 24, 9:26 pm, Matt Swasey <ruby...-b60islb68c7lL05M/teW5w@public.gmane.org> wrote:> I always wanted to use vim / gvim for rails development, I thought it > was more elegant and simple compared to emacs, but the escape is a > little far away to be comfortable in touch typing. I''m sure that > someone will tell me that you can just remap Esc to another key, but > this is my reasoning for choosing emacs in the end.I''ve always used ^[ for Esc. ObRails: There''s a good plugin for Rails development with vi available. ///ark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This looks like something peculiar to my user environment which I haven''t figured out yet. It''s not in Aquamacs or emacs from what I can tell. Cheers, Walter On Dec 22, 2007 6:13 PM, Walter McGinnis <walter.mcginnis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > P.S. - I must admit Aquamacs 1.2 is annoying the hell out of me right now, > for some reason it has disabled C-space as "set mark". Some other funkiness > that might be related to my set up, so be warned. >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---