Skip to content

Instantly share code, notes, and snippets.

@kawaguchi
Created November 4, 2009 09:23
Show Gist options
  • Save kawaguchi/225908 to your computer and use it in GitHub Desktop.
Save kawaguchi/225908 to your computer and use it in GitHub Desktop.
;; cucumber
;; http://github.com/michaelklishin/cucumber.el
;; 日本語でも色つける
(require 'feature-mode)
(defconst feature-mode-ja-keywords
'("フィーチャ" "機能" "背景" "シナリオ" "シナリオアウトライン"
"シナリオテンプレート" "テンプレ" "シナリオテンプレ"
"例" "サンプル" "前提" "もし" "ならば" "かつ" "しかし" "但し" "ただし"))
(defconst feature-font-lock-ja-keywords
(list
'("^ *\\(?:フィーチャ\\|機能\\):" (0 font-lock-keyword-face) (".*" nil nil (0 font-lock-type-face t)))
'("^ *背景:$" (0 font-lock-keyword-face))
'("^ *\\(?:テンプレ\\|\\(?:シナリオ\\(?:アウトライン\\|テンプレート\\|テンプレ\\)?\\)\\):" (0 font-lock-keyword-face) (".*" nil nil (0 font-lock-function-name-face t)))
'("^ *前提" . font-lock-keyword-face)
'("^ *もし" . font-lock-keyword-face)
'("^ *ならば" . font-lock-keyword-face)
'("^ *\\(?:しかし\\|但し\\|ただし\\)" . font-lock-keyword-face)
'("^ *かつ" . font-lock-keyword-face)
'("^ *\\(?:他の\\)?サンプル:" . font-lock-keyword-face)))
(setq feature-mode-keywords
(append feature-mode-keywords feature-mode-ja-keywords))
(setq feature-font-lock-keywords
(append feature-font-lock-keywords feature-font-lock-ja-keywords))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment