Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

modify commentary and README.md and add init.el.example

  • Loading branch information...
commit bb4e3607fd2cf7903f98e78d5a02fee64425df4e 1 parent c4c6a73
@abicky abicky authored
Showing with 51 additions and 2 deletions.
  1. +13 −1 README.md
  2. +19 −0 init.el.example
  3. +19 −1 jsx-mode.el
View
14 README.md
@@ -1,13 +1,25 @@
# jsx-mode.el --- major mode for JSX codes
## USAGE
+### Get Started
Put this file in your Emacs lisp path (e.g. ~/.emacs.d/site-lisp)
-and add to the following lines to your .emacs:
+and add to the following lines to your ~/.emacs.d/init.el.
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . jsx-mode))
(autoload 'jsx-mode "jsx-mode" "JSX mode" t)
+See also init.el.example.
+
+### Key Bindings
+
+In `jsx-mode', the following keys are bound by default.
+
+ C-c C-c comment-region (Comment or uncomment each line in the region)
+ C-c c jsx-compile-file (Compile the current buffer)
+ C-c C jsx-compile-file-async (Compile the current buffer asynchronously)
+ C-c C-r jsx-run-buffer (Run the current buffer)
+
## AUTHOR
Takeshi Arabiki (abicky)
View
19 init.el.example
@@ -0,0 +1,19 @@
+(add-to-list 'load-path (expand-file-name "~/.emacs.d/site-lisp/"))
+
+(add-to-list 'auto-mode-alist '("\\.jsx\\'" . jsx-mode))
+(autoload 'jsx-mode "jsx-mode" "JSX mode" t)
+
+;; You can edit user-customizable variables by typing the following command.
+;; M-x customize-group [RET] jsx-mode
+(custom-set-variables
+ '(jsx-indent-level 2)
+ '(jsx-cmd-options '("--add-search-path" "/path/to/search-path"))
+ '(jsx-use-flymake t)
+ '(jsx-syntax-check-mode "compile"))
+
+(defun jsx-mode-init ()
+ (define-key jsx-mode-map (kbd "C-c d") 'jsx-display-popup-err-for-current-line)
+ (when (require 'auto-complete nil t)
+ (auto-complete-mode t)))
+
+(add-hook 'jsx-mode-hook 'jsx-mode-init)
View
20 jsx-mode.el
@@ -25,12 +25,30 @@
;;; Commentary:
+;; =============
+;; Get Started
+;; =============
+
;; Put this file in your Emacs lisp path (e.g. ~/.emacs.d/site-lisp)
-;; and add to the following lines to your .emacs:
+;; and add to the following lines to your ~/.emacs.d/init.el.
;; (add-to-list 'auto-mode-alist '("\\.jsx\\'" . jsx-mode))
;; (autoload 'jsx-mode "jsx-mode" "JSX mode" t)
+;; See also init.el.example.
+
+
+;; ==============
+;; Key Bindings
+;; ==============
+
+;; In `jsx-mode', the following keys are bound by default.
+
+;; C-c C-c comment-region (Comment or uncomment each line in the region)
+;; C-c c jsx-compile-file (Compile the current buffer)
+;; C-c C jsx-compile-file-async (Compile the current buffer asynchronously)
+;; C-c C-r jsx-run-buffer (Run the current buffer)
+
;; TODO:
;; * support imenu
Please sign in to comment.
Something went wrong with that request. Please try again.