Skip to content

Commit

Permalink
updated js2-mode snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
nisaacson committed Feb 14, 2013
1 parent 0728ac5 commit c8bd265
Show file tree
Hide file tree
Showing 27 changed files with 45 additions and 31 deletions.
2 changes: 1 addition & 1 deletion site-lisp/noah/javascript.el
Expand Up @@ -51,7 +51,7 @@
(local-set-key (kbd "C-j") 'js2-newline-key))

(defun my-js2-sources ()
(setq ac-sources '(ac-source-yasnippet ac-source-filename ac-source-words-in-buffer ac-source-words-in-same-mode-buffers )))
(setq ac-sources '(ac-source-filename ac-source-words-in-buffer ac-source-words-in-same-mode-buffers ac-source-yasnippet )))

(add-hook 'js2-mode-hook 'my-js2-sources)
(add-hook 'js2-mode-hook 'noah-add-js2-keys)
Expand Down
19 changes: 16 additions & 3 deletions site-lisp/noah/noah-autocomplete.el
@@ -1,18 +1,31 @@
;; ;;;;;;;;;;;;;;;;;;;;
;; ;; autocomplete
;; ;;;;;;;;;;;;;;;;;;;;
(setq-default ac-sources '(ac-source-yasnippet))
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "/Users/noah/.emacs.d/vendor/autocomplete/dict")
(set-default 'ac-sources
'(ac-source-abbrev
ac-source-dictionary
ac-source-yasnippet
ac-source-words-in-buffer
ac-source-words-in-same-mode-buffers
ac-source-semantic))

(add-to-list 'ac-dictionary-directories "/Users/noah/.emacs.d/vendor/autocomplete/dict")
(ac-config-default)

;; (global-auto-complete-mode t)

(defadvice ac-common-setup (after give-yasnippet-highest-priority activate)
(setq ac-sources (delq 'ac-source-yasnippet ac-sources))
(add-to-list 'ac-sources 'ac-source-yasnippet))

(global-auto-complete-mode t)
(setq ac-use-menu-map t)
(setq ac-show-menu t)
(define-key ac-completing-map "\e" 'ac-stop) ; use esc key to exit completion
(define-key ac-complete-mode-map "\C-n" 'ac-next)
(define-key ac-complete-mode-map "\C-p" 'ac-previous)
;; Use TAB to complete, not cycle.
(define-key ac-completing-map "\t" 'ac-complete)
(setq ac-dwim t)


Expand Down
4 changes: 2 additions & 2 deletions site-lisp/noah/shortcuts.el
Expand Up @@ -4,8 +4,8 @@
;; (global-set-key (kbd "C-.") 'shift-right)
;; (global-set-key (kbd "C-,") 'shift-left)

(key-chord-define-global "df" 'ace-jump-mode)
(key-chord-define-global "dr" 'ace-jump-char-mode)
;; (key-chord-define-global "df" 'ace-jump-mode)
;; (key-chord-define-global "dr" 'ace-jump-char-mode)
(global-set-key (kbd "C-s") 'isearch-forward)
(global-set-key (kbd "C-r") 'isearch-backward)
(global-set-key [C-tab]
Expand Down
Expand Up @@ -9,4 +9,4 @@
("using" "using namespace ${std};\n$0" "using namespace ... " nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:00 2013
2 changes: 1 addition & 1 deletion vendor/yasnippet/snippets/c-mode/.yas-compiled-snippets.el
Expand Up @@ -6,4 +6,4 @@
("printf" "printf (\"${1:%s}\\\\n\"${1:$(if (string-match \"%\" text) \",\" \"\\);\")\n}$2${1:$(if (string-match \"%\" text) \"\\);\" \"\")}" "printf " nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:00 2013
Expand Up @@ -12,4 +12,4 @@
("struct" "struct ${1:name}\n{\n $0\n};" "struct ... { ... }" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:00 2013
@@ -1,2 +1,2 @@
;;; Compiled snippets and support files for `cperl-mode'
;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:00 2013
Expand Up @@ -19,4 +19,4 @@
("using" "using System.$1;" "using System....;" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:00 2013
Expand Up @@ -25,4 +25,4 @@
("pad" "padding-top: $1;" "padding-top: ..." nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:00 2013
Expand Up @@ -145,4 +145,4 @@
("yes-or-no-p" "(yes-or-no-p \"PROMPT$0 \")" "yes-or-no-p" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -25,4 +25,4 @@
("undef" "-undef($1).\n$0" "-undef(...)." nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -30,4 +30,4 @@
("wr" "write (${1:*},${2:*}) $0" "write (*,*)" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -145,4 +145,4 @@
nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
4 changes: 2 additions & 2 deletions vendor/yasnippet/snippets/js2-mode/.yas-compiled-snippets.el
Expand Up @@ -5,7 +5,7 @@
'(("elif" "else if (${1:condition}) {\n $0\n} " "else if (condition) { ... }" nil nil nil nil nil nil)
("else" "else {\n $0\n} " "else { ... }" nil nil nil nil nil nil)
("if" "if (${1:condition}) $2;$0" "if (condition) ..." nil nil nil nil nil nil)
("requ" "var $1 = require('${1:file}');" "var name = require(file);" nil nil nil nil nil nil)
("requ" "var $1 = require('$3');\n$0" "var name = require(file);" nil nil nil nil nil nil)
("var" "var ${1:name} = ${2:value};$0" "var name = value;" nil nil nil nil nil nil)))


Expand Down Expand Up @@ -38,4 +38,4 @@
nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
3 changes: 2 additions & 1 deletion vendor/yasnippet/snippets/js2-mode/requ
@@ -1,4 +1,5 @@
#Author : Christopher Roach <vthakr@gmail.com>
#name : var name = require(file);
# --
var $1 = require('${1:file}');
var $1 = require('$3');
$0
Expand Up @@ -5,4 +5,4 @@
'(("begin" "\n\\begin{${1:environment}}\n$0\n\\end{$1}" "\\begin{environment} ... \\end{environment}" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -25,4 +25,4 @@
("rlink" "[${1:Link Text}][$2] $0" "Reference Link" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -72,4 +72,4 @@
nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -5,4 +5,4 @@
'(("prop" "- (${1:id})${2:foo}\n{\n return $2;\n}\n\n- (void)set${2:$(capitalize text)}:($1)aValue\n{\n [$2 autorelease];\n $2 = [aValue retain];\n}\n$0" "foo { ... } ; setFoo { ... }" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -17,4 +17,4 @@
("xwhile" "${1:expression} while ${2:condition};" "... while ..." nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -14,4 +14,4 @@
("while" "while ${condition}:\n $0" "while ... : ..." nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -7,4 +7,4 @@
("tit" "${1:$(make-string (string-width text) ?\\=)}\n${1:Title}\n${1:$(make-string (string-width text) ?\\=)}\n\n$0" "Document title" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -145,4 +145,4 @@
nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:41 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -100,4 +100,4 @@
("with" "with $0" "with T" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:42 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -7,4 +7,4 @@
("vars" "# name: $1${2:\n# key: ${3:trigger-key}}${4:\n# keybinding: ${5:keybinding}}${6:\n# expand-env: (${7:})}\n# contributor: $6\n# --\n$0" "Snippet header" nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:42 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
Expand Up @@ -10,4 +10,4 @@
("references" "REFERENCES ${1:TableName}([${2:ColumnName}])" "REFERENCES ..." nil nil nil nil nil nil)))


;;; Do not edit! File generated at Mon Feb 11 02:46:42 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013
@@ -1,2 +1,2 @@
;;; Compiled snippets and support files for `text-mode'
;;; Do not edit! File generated at Mon Feb 11 02:46:42 2013
;;; Do not edit! File generated at Thu Feb 14 13:33:01 2013

0 comments on commit c8bd265

Please sign in to comment.