Update webdev modes
This commit is contained in:
parent
5d1fdfaa73
commit
db601a903d
4 changed files with 33 additions and 25 deletions
|
@ -3,6 +3,7 @@
|
||||||
:interpreter "node"
|
:interpreter "node"
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
|
(setq js2-skip-preprocessor-directives t)
|
||||||
(setq-default js2-show-parse-errors nil)
|
(setq-default js2-show-parse-errors nil)
|
||||||
(setq-default js2-global-externs '("module" "require" "buster" "sinon" "assert"
|
(setq-default js2-global-externs '("module" "require" "buster" "sinon" "assert"
|
||||||
"refute" "setTimeout" "clearTimeout"
|
"refute" "setTimeout" "clearTimeout"
|
||||||
|
@ -11,11 +12,14 @@
|
||||||
;; Launchbar API
|
;; Launchbar API
|
||||||
"LaunchBar" "File" "Action" "HTTP" "include"))
|
"LaunchBar" "File" "Action" "HTTP" "include"))
|
||||||
|
|
||||||
|
(after "web-beautify"
|
||||||
|
(add-hook! 'js2-mode-hook (setenv "jsbeautify_indent_size" "4"))
|
||||||
|
(bind 'motion js2-mode-map "gQ" 'web-beautify-js))
|
||||||
|
|
||||||
(after "emr" (use-package js2-refactor))
|
(after "emr" (use-package js2-refactor))
|
||||||
|
|
||||||
(use-package tern
|
(use-package tern
|
||||||
:commands tern-mode
|
:commands tern-mode
|
||||||
;; replace auto-complete with tern-ac-complete only in js-mode
|
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
(add-hook 'js2-mode-hook 'tern-mode)
|
(add-hook 'js2-mode-hook 'tern-mode)
|
||||||
|
@ -40,9 +44,8 @@
|
||||||
))))))
|
))))))
|
||||||
|
|
||||||
(use-package json-mode
|
(use-package json-mode
|
||||||
:mode (("\\.json\\'" . json-mode)
|
:mode (("\\.json$" . json-mode)
|
||||||
("\\.jshintrc\\'" . json-mode)))
|
("\\.jshintrc$" . json-mode)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-js)
|
(provide 'init-js)
|
||||||
|
|
|
@ -2,8 +2,15 @@
|
||||||
:mode "\\.\\(php\\|inc\\)$"
|
:mode "\\.\\(php\\|inc\\)$"
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(add-hook! 'php-mode-hook (setq my-run-code-interpreter "php"))
|
(setq php-template-compatibility nil)
|
||||||
(setq php-template-compatibility nil)))
|
(add-hook 'php-mode-hook 'turn-on-eldoc-mode)
|
||||||
|
|
||||||
|
(use-package php-extras
|
||||||
|
:config (company--backend-on 'php-mode-hook 'php-extras-company))
|
||||||
|
|
||||||
|
;; TODO Tie into emr
|
||||||
|
(use-package php-refactor-mode
|
||||||
|
:config (add-hook 'php-mode-hook 'php-refactor-mode))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-php)
|
(provide 'init-php)
|
||||||
|
|
|
@ -3,13 +3,16 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(add-hook 'scss-mode-hook 'enable-tab-width-2)
|
(add-hook 'scss-mode-hook 'enable-tab-width-2)
|
||||||
(add-hook 'scss-mode-hook 'ac-css-mode-setup)
|
|
||||||
|
|
||||||
(setq-default css-indent-offset 2)
|
(setq-default css-indent-offset 2)
|
||||||
(setq scss-compile-at-save nil)
|
(setq scss-compile-at-save nil)
|
||||||
|
|
||||||
(after "company"
|
(after "web-beautify"
|
||||||
(company--backend-on 'scss-mode-hook 'company-css))))
|
(add-hook! 'scss-mode-hook (setenv "jsbeautify_indent_size" "2"))
|
||||||
|
(bind 'motion scss-mode-map "gQ" 'web-beautify-css))
|
||||||
|
|
||||||
|
(after "auto-complete" (add-hook 'scss-mode-hook 'ac-css-mode-setup))
|
||||||
|
(after "company" (company--backend-on 'scss-mode-hook 'company-css))))
|
||||||
|
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode
|
||||||
:defer t
|
:defer t
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
(use-package web-beautify
|
||||||
|
:commands (web-beautify-js web-beautify-css web-beautify-html)
|
||||||
|
:init
|
||||||
|
(after "css-mode"
|
||||||
|
(add-hook! 'css-mode-hook (setenv "jsbeautify_indent_size" "2"))
|
||||||
|
(bind 'motion css-mode-map "gQ" 'web-beautify-css)))
|
||||||
|
|
||||||
(use-package web-mode
|
(use-package web-mode
|
||||||
:mode (("\\.\\(p\\)?htm\\(l\\)?$" . web-mode)
|
:mode (("\\.\\(p\\)?htm\\(l\\)?$" . web-mode)
|
||||||
("\\.tpl\\(\\.php\\)?$" . web-mode)
|
("\\.tpl\\(\\.php\\)?$" . web-mode)
|
||||||
|
@ -15,6 +22,10 @@
|
||||||
web-mode-script-padding 2
|
web-mode-script-padding 2
|
||||||
web-mode-block-padding 2)
|
web-mode-block-padding 2)
|
||||||
|
|
||||||
|
(after "web-beautify"
|
||||||
|
(add-hook! 'web-mode-hook (setenv "jsbeautify_indent_size" "4"))
|
||||||
|
(bind 'motion web-mode-map "gQ" 'web-beautify-html))
|
||||||
|
|
||||||
(bind web-mode-map (kbd "s-/") 'web-mode-comment-or-uncomment)
|
(bind web-mode-map (kbd "s-/") 'web-mode-comment-or-uncomment)
|
||||||
(bind 'normal web-mode-map
|
(bind 'normal web-mode-map
|
||||||
"zf" 'web-mode-fold-or-unfold
|
"zf" 'web-mode-fold-or-unfold
|
||||||
|
@ -43,22 +54,6 @@
|
||||||
(kbd "s-e") 'emmet-expand-yas
|
(kbd "s-e") 'emmet-expand-yas
|
||||||
(kbd "s-E") 'emmet-expand-line)))
|
(kbd "s-E") 'emmet-expand-line)))
|
||||||
|
|
||||||
(use-package web-beautify
|
|
||||||
:commands (web-beautify-js web-beautify-css web-beautify-html)
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
(after "scss-mode"
|
|
||||||
(add-hook! 'scss-mode-hook (setenv "jsbeautify_indent_size" "2"))
|
|
||||||
(bind 'motion scss-mode-map "gQ" 'web-beautify-css))
|
|
||||||
|
|
||||||
(after "web-mode"
|
|
||||||
(add-hook! 'web-mode-hook (setenv "jsbeautify_indent_size" "4"))
|
|
||||||
(bind 'motion web-mode-map "gQ" 'web-beautify-html))
|
|
||||||
|
|
||||||
(after "js2-mode"
|
|
||||||
(add-hook! 'js2-mode-hook (setenv "jsbeautify_indent_size" "4"))
|
|
||||||
(bind 'motion js2-mode-map "gQ" 'web-beautify-js))))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-web)
|
(provide 'init-web)
|
||||||
;;; init-web.el ends here
|
;;; init-web.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue