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 @@
1 1
 [submodule "zsh/oh-my-zsh"]
2 2
 	path = zsh/oh-my-zsh
3 3
 	url = https://github.com/robbyrussell/oh-my-zsh.git
4
+[submodule "emacs/rhtml"]
5
+	path = emacs/rhtml
6
+	url = https://github.com/eschulte/rhtml.git

+ 5
- 0
emacs/GNUmakefile View File

@@ -11,6 +11,11 @@ THEME_FILES = $(wildcard themes/*.el)
11 11
 THEME_DEST  = $(HOME)/.emacs.d/themes
12 12
 $(foreach f,$(THEME_FILES),$(eval $(call INSTALL_FILE_TO,$(f),$(THEME_DEST))))
13 13
 
14
+##############################################################################
15
+install: $(HOME)/.emacs.d/rhtml
16
+$(HOME)/.emacs.d/rhtml: rhtml
17
+	cp -pr $< $@
18
+
14 19
 ##############################################################################
15 20
 install: $(HOME)/.emacs
16 21
 $(HOME)/.emacs: emacsrc.el

+ 1
- 1
emacs/emacsrc.el View File

@@ -17,7 +17,7 @@
17 17
   (package-refresh-contents))
18 18
 
19 19
 ;; Add in your own as you wish:
20
-(defvar my-packages '(magit flymake-ruby)
20
+(defvar my-packages '(magit flymake-ruby ruby-end)
21 21
   "A list of packages to ensure are installed at launch.")
22 22
 
23 23
 (dolist (p my-packages)

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

@@ -8,7 +8,8 @@
8 8
   (flyspell-prog-mode)
9 9
   (electric-pair-mode 1)
10 10
   (whitespace-mode t)
11
-  (font-lock-add-keywords nil '(("\\<\\(FIXME:\\|TODO:\\|NOTE:\\)" 1 pmade-fixme-face t)))
11
+  (font-lock-add-keywords nil '(("\\<\\(FIXME:\\|TODO:\\|NOTE:\\|WARN:\\)"
12
+                                 1 devalot-fixme-face t)))
12 13
   (local-set-key (kbd "RET") 'reindent-then-newline-and-indent))
13 14
 (add-hook 'prog-mode-hook 'usk-programming-mode-hook)
14 15
 
@@ -21,12 +22,18 @@
21 22
 (add-to-list 'auto-mode-alist '("Gemfile$"    . ruby-mode))
22 23
 (add-to-list 'auto-mode-alist '("Capfile$"    . ruby-mode))
23 24
 (add-hook 'ruby-mode-hook 'inf-ruby-keys)
25
+(add-hook 'ruby-mode-hook 'flymake-ruby-load)
26
+(add-hook 'ruby-mode-hook 'ruby-end-mode)
24 27
 
25 28
 ;; Ruby embedded in HTML
29
+(add-to-list 'load-path (concat user-emacs-directory "rhtml"))
30
+(autoload 'rhtml-mode "rhtml-mode" "Mode for editing mixed Ruby and HTML" t)
26 31
 (add-to-list 'auto-mode-alist '("\\.html\\.erb$" . rhtml-mode))
27 32
 
28 33
 ;; HTML, CSS, JavaScript
29 34
 (add-to-list 'auto-mode-alist '("\\.css\\.scss$" . css-mode))
35
+(add-hook 'css-mode-hook 'usk-programming-mode-hook)
36
+(add-hook 'sgml-mode-hook 'usk-programming-mode-hook)
30 37
 (setq css-indent-offset 2 sgml-basic-offset 2
31 38
       js-indent-level 2 js-flat-functions t)
32 39
 

+ 1
- 0
emacs/rhtml

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

+ 3
- 0
zsh/zshrc View File

@@ -27,4 +27,7 @@ COMPLETION_WAITING_DOTS="true"
27 27
 # Example format: plugins=(rails git textmate ruby lighthouse)
28 28
 plugins=(git)
29 29
 
30
+alias e="emacsclient -nq"
31
+export EDITOR="emacsclient"
32
+
30 33
 source $ZSH/oh-my-zsh.sh

Loading…
Cancel
Save