Building Blocks & Learning Experiences

Browsing Posts tagged emacs

I was having some trouble running rspec within Emacs. One of the gems in my Gemfile was pointing to a git repo, and as a result, bundle was shelling out through Emacs to check my revision using this method: def revision_from_git if File.exists?(scope(‘.git/HEAD’)) Dir.chdir scope(“.”) do `git rev-parse HEAD` end end end Since my git […]

I’ve often been sad that there is no default keybinding for comment-region in Emacs’s ruby-mode. Eventually it annoyed me enough that I added one: (add-hook ‘ruby-mode-hook (lambda () (define-key ruby-mode-map “\C-c#” ‘comment-or-uncomment-region) ) ) This assigns C-c # to comment the current region, or if the current region is already commented, it will uncomment the […]