Browse Source

Better ruby-mode support in Emacs, new "e" alias in zsh

master
Peter J. Jones 7 years ago
parent
commit
732c8fc286
6 changed files with 21 additions and 2 deletions
  1. 3
    0
      .gitmodules
  2. 5
    0
      emacs/GNUmakefile
  3. 1
    1
      emacs/emacsrc.el
  4. 8
    1
      emacs/lib/code.el
  5. 1
    0
      emacs/rhtml
  6. 3
    0
      zsh/zshrc

+ 3
- 0
.gitmodules View File

@@ -1,3 +1,6 @@
[submodule "zsh/oh-my-zsh"]
path = zsh/oh-my-zsh
url = https://github.com/robbyrussell/oh-my-zsh.git
[submodule "emacs/rhtml"]
path = emacs/rhtml
url = https://github.com/eschulte/rhtml.git

+ 5
- 0
emacs/GNUmakefile View File

@@ -11,6 +11,11 @@ THEME_FILES = $(wildcard themes/*.el)
THEME_DEST = $(HOME)/.emacs.d/themes
$(foreach f,$(THEME_FILES),$(eval $(call INSTALL_FILE_TO,$(f),$(THEME_DEST))))

##############################################################################
install: $(HOME)/.emacs.d/rhtml
$(HOME)/.emacs.d/rhtml: rhtml
cp -pr $< $@

##############################################################################
install: $(HOME)/.emacs
$(HOME)/.emacs: emacsrc.el

+ 1
- 1
emacs/emacsrc.el View File

@@ -17,7 +17,7 @@
(package-refresh-contents))

;; Add in your own as you wish:
(defvar my-packages '(magit flymake-ruby)
(defvar my-packages '(magit flymake-ruby ruby-end)
"A list of packages to ensure are installed at launch.")

(dolist (p my-packages)

+ 8
- 1
emacs/lib/code.el View File

@@ -8,7 +8,8 @@
(flyspell-prog-mode)
(electric-pair-mode 1)
(whitespace-mode t)
(font-lock-add-keywords nil '(("\\<\\(FIXME:\\|TODO:\\|NOTE:\\)" 1 pmade-fixme-face t)))
(font-lock-add-keywords nil '(("\\<\\(FIXME:\\|TODO:\\|NOTE:\\|WARN:\\)"
1 devalot-fixme-face t)))
(local-set-key (kbd "RET") 'reindent-then-newline-and-indent))
(add-hook 'prog-mode-hook 'usk-programming-mode-hook)

@@ -21,12 +22,18 @@
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Capfile$" . ruby-mode))
(add-hook 'ruby-mode-hook 'inf-ruby-keys)
(add-hook 'ruby-mode-hook 'flymake-ruby-load)
(add-hook 'ruby-mode-hook 'ruby-end-mode)

;; Ruby embedded in HTML
(add-to-list 'load-path (concat user-emacs-directory "rhtml"))
(autoload 'rhtml-mode "rhtml-mode" "Mode for editing mixed Ruby and HTML" t)
(add-to-list 'auto-mode-alist '("\\.html\\.erb$" . rhtml-mode))

;; HTML, CSS, JavaScript
(add-to-list 'auto-mode-alist '("\\.css\\.scss$" . css-mode))
(add-hook 'css-mode-hook 'usk-programming-mode-hook)
(add-hook 'sgml-mode-hook 'usk-programming-mode-hook)
(setq css-indent-offset 2 sgml-basic-offset 2
js-indent-level 2 js-flat-functions t)


+ 1
- 0
emacs/rhtml

@@ -0,0 +1 @@
Subproject commit 4d9e823c8490d9020242e9f310de31006589e52d

+ 3
- 0
zsh/zshrc View File

@@ -27,4 +27,7 @@ COMPLETION_WAITING_DOTS="true"
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)

alias e="emacsclient -nq"
export EDITOR="emacsclient"

source $ZSH/oh-my-zsh.sh

Loading…
Cancel
Save