Skip to content

Emacs Configuration for who loves Ruby on Rails and also uses magic to code!

Notifications You must be signed in to change notification settings

the-moriarty/doom-emacs-on-rails

 
 

Repository files navigation

Index

This project goal

This project goal is bring emacs and its powerful features to people that don’t want to lose time searching and configuring stuff. The doom-emacs-on-rails config is ready to use and easy to customize. The user can change the user-settings.el the way he wants, receiving a lot of tips. Doom Emacs + this dotfiles is the fusion of power and simplicity.

To access your personal settings, just press SPC f m.

The user can print a manual accessing Emacs Handbook.pdf, also has a video demonstration with some cool commands below.

Features

  • Made for Ruby on rails
  • Works with rbenv or docker
  • Works with rspec or minitest
  • Javascript support out of box
  • Cool stuff for Ruby Refactoring
  • Advance autocomplete and snippets management
  • Code Diagnostics
  • Best git client integrated (Magit)
  • Vim Keybindings

Prerequisites

  • Git 2.23+
  • Emacs 27 with GNUTLS support
  • ripgrep 11.0+ (sudo apt install ripgrep)
  • GNU find
  • OPTIONAL fd 7.3.0+ (improves file indexing performance for some commands) (sudo apt install find-fd) (good for large projects)
  • typescript-language-server (npm install -g typescript-language-server)

Installation

# Install my config
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
git clone https://github.com/otavioschwanck/doom_emacs_dotfiles.git ~/.doom.d
~/.emacs.d/bin/doom install

# Some dependencies (ubuntu)
sudo apt install fd-find ripgrep libtool-bin cmake tidy

# If you use mac
brew install fd ripgrep

# Install dependencies for LSP
npm install -g vscode-css-languageserver-bin vscode-html-languageserver-bin typescript-language-server @tailwindcss/language-server@0.0.4 stylelint js-beautify
gem install solargraph

After Install

Open your personal configuration with SPC f m and read the file.

Upgrading

To upgrade, just press M-x and search for upgrade-doom-emacs-on-rails

Keybindings

I’ve write an emacs handbook to use this config. You can access using emacs with SPC f p, than searching for handbook. (Require M-x pdf-tools-install).

The PDF is on this project root: Emacs Handbook.pdf

This PDF is perfect to be printed out or be used on second monitor.

Video Showcase + Guide

I made a video showcase with the principal commands (See description all the video highlights)

https://www.youtube.com/watch?v=5H1-Qc9uD5A

My Configuration features

Here is an example of some features that i made for Ruby:

refactoring in emacs.gif

method at point.gif Please ignore the wrong comment at line 8 =D.

Autocomplete + Snippets = <3

autocomplete.gif

USING SNIPPETS AND AUTOCOMPLETE TOGETHER <3

  • To toggle an snippet, press tab.
  • On Snippet, Tab also goes forward on snippet
  • To go backward on snippets, press Shift + Tab
  • To delete selected text on snippet, press C-d
  • To go forward on autocomplete list, press C-n OR C-j.
  • Use C-enter to complete any text in editor (SUPER USEFUL)
  • To use enter ignoring the autocomplete (create a new line, send on rails console), press Alt + Enter.
  • To confirm the selection on autocomplete, press Enter

    Resume: Tab is ONLY for snippets and ENTER and C-n / C-p is only for autocomplete.

Tips

Configuring Forge for Creating / Reviewing pull requests

For github

1 - Go to https://github.com/settings/tokens and create a personal token with repo (all), read:org and user

2 - Don’t forget to configure your user in github with git config –global github.user youruser

3 - Create a file called ~/.authinfo

4 - add machine api.github.com login youruser^forge password yourtokenhere and machine api.github.com login otavioschwanck^github-review password yourtokenhere to this file

5 - M-x epa-encrypt-file and select ~/.authinfo to encrypt with gpg.

6 - delete the ~/.authinfo

For other git server

See: https://practicalli.github.io/spacemacs/source-control/forge-configuration.html and https://magit.vc/manual/ghub/Getting-Started.html

Improve emacs speed (a lot)

Use Emacs Server: https://wikemacs.org/wiki/Emacs_server

Resume: run emacs --daemon on system start. To open an emacs window, use emacsclient -c instead emacs.

Getting help

For getting help, access doom official github page: https://github.com/hlissner/doom-emacs

Want to learn how to use advanced commands from this config inside emacs?

Just follow this gif: https://imgur.com/J3KzrPK

Installing Emacs on Ubuntu

Just run `sudo snap install emacs –classic`

Installing Emacs on Mac

Just install from https://emacsformacosx.com/

Tip: To work, go to applications, right click and then, open.

What i need to know to start using ?

I really recommend you to learn the basics of vim first, choose one:

After that, you can see the Doom Casts to learn the basics of doom emacs (optional) Don’t forget to see the evil cheatsheet pt-BR.png on the root of this repository!

Don’tt forget the Doom Emacs Discord Server, is always full of people that always helps! You can get help of any command on doom with SPC h p (function) of SPC h k + keybinding = (to see the options, etc.)

Buy me a coffee

If you want to support my work, please, buy me a coffee: https://www.buymeacoffee.com/otavioschwanck

About

Emacs Configuration for who loves Ruby on Rails and also uses magic to code!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 91.8%
  • YASnippet 8.2%