![]() ![]() ![]() ![]() Some, however, require you to supply your own answer. Some koans simply need to have the correct answer substituted for an incorrect one. It will stop at the first place you need to correct. They are presented in order in the path_to_enlightenment.rb file.Įach koan builds up your knowledge of Ruby and builds upon itself. Using functionality from the textmate.The koans are broken out into areas by file, hashes are covered in about_hashes.rb, modules are introduced in about_modules.rb, etc. While rinari is a great library filled will all manner of helpful shortcuts, I never found myself using any of them save for one: running a single test buffer. ![]() The experienced Emacs Rails developer will notice that I haven't included rinari. You can now develop your Ruby and Rails application in Emacs! Bonus Round # We've now got file extension detection and nice ruby indentation. Now our el-get package list looks more like this: (setq el-get-sources Now we can add :after parameters to ruby-mode, rhtml-mode, yaml-mode, and css-mode. (define-key rhtml-mode-map (kbd "M-s") 'save-buffer)))) (autoload 'rhtml-mode "rhtml-mode" nil t) (add-to-list 'auto-mode-alist '("Rakefile". (add-to-list 'auto-mode-alist '("Gemfile". (add-to-list 'auto-mode-alist '("Capfile". Insert the following functions into your init.el above the previous el-get-sources definition: (defun ruby-mode-hook () In the interest of keeping line length to a minimum, I will create hook functions for each mode I want to configure post-load. In the instance of rvm the rvm-use-default command is run after the rvm library loads. This is the perfect place to add per-mode hooks to our configuration. This parameter takes whatever function passed and executes it after the package is loaded. If we look carefully at our previous el-get package list code, we notice that the entry for rvm has an :after parameter. There is, however, some simple configuration that will further enhance your Rails development experience. This will start pulling down and compiling our list of packages.Īt this point you have all you need to hack on Ruby and Rails applications. Now evaluate the buffer again: (M-x) eval-buffer Drop the following configuration in your init.el: (setq el-get-sources (add-to-list 'load-path "~/.emacs.d/el-get/el-get")Īt this point it's a good idea to evaluate the init.el buffer and refresh the elpa package list, in Emacs: (M-x) eval-bufferĮl-get can use a number of package retrieval protocols. We can now add the following lines to our configuration to load ELPA w/ an alternate repository and el-get. Install el-get in the following manner: $ cd ~/.emacs.d It's also fundamental in making our quick configuration possible. So we'll configure Emacs to use the tromey repository.Įl-get is a new package management library written by Dimitri Fontaine. ELPA & el-get #Įmacs 24 comes with ELPA package management built-in, however, the default repository of libraries excludes many we will need. The first line changes the default font while the second line uses one of Emacs 24's new features: built-in themes. In the interest of aesthetics I will add two additional lines to our configuration: (set-frame-font "Menlo-16") We are pushing "/usr/local/bin" onto the exec-path list giving Emacs the ability to use git (presuming it's installed via hombrew and the binary resides in /usr/local/bin). The most important bit of configuration is the first line. Navigate (C-x C-f) to ~/.emacs.d/init.el and insert the following after our singular comment at the top: (push "/usr/local/bin" exec-path) If you are new to Emacs consider taking the Emacs tutorial presented in the default splash screen. You will be presented with the illustrious Emacs logo and some instructions on how to use the editor. So, go ahead and launch Emacs like you would any other application. That's ok! It only takes a few lines of elisp to make a more pleasant experience. Configuring The Basics #Īt the risk of editorializing I'll say that Emacs doesn't have the most desirable configuration defaults. This will leave you will a fresh copy of Emacs and a blank configuration file. I'd like to show you how you can go from a default installation of Emacs HEAD (24) to a workable Rails development environment in only a few minutes. So, I have no interest in engaging in any kind of editor holy war here. I strongly believe that everyone should use an editor they feel productive in and most importantly, an editor they enjoy. My fellow employees at Viget enjoy a number of different editors including Textmate and Vim. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |