summaryrefslogtreecommitdiff
path: root/lisp/web.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/web.el')
-rw-r--r--lisp/web.el33
1 files changed, 5 insertions, 28 deletions
diff --git a/lisp/web.el b/lisp/web.el
index d05fa34..e7af0d4 100644
--- a/lisp/web.el
+++ b/lisp/web.el
@@ -1,7 +1,7 @@
;;; Code:
-;; web mode
+;; Web general
(defun my-web-mode-colors ()
"Set colors for web mode."
(set-face-background 'web-mode-current-element-highlight-face "#FFFDD0")
@@ -21,37 +21,14 @@
)
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.php\\'" . web-mode))
+(setq-default js-indent-level 2)
;; JavaScript
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
(push '("\\.js[x]?\\'" . javascript-mode) auto-mode-alist)
-(defun setup-js2-mode()
- "Hooks for Javscript 2 Mode."
- (setq js-indent-level 2)
- (company-mode t)
- (smartparens-mode 1)
-)
-(add-hook 'js-mode-hook 'setup-js2-mode)
-;(setq js2-highlight-level 3)
-;(setq js2-idle-timer-delay 0)
-
;; TypeScript
-(defun setup-typescript()
- "Set up tiny things for TypeScript."
- (setq typescript-indent-level 2)
- (company-mode t)
- (company-quickhelp-mode t)
- (smartparens-mode 1)
-)
-(add-hook 'typescript-mode-hook #'setup-typescript)
-
-(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . web-mode))
-(add-hook 'web-mode-hook
- (lambda ()
- (when (string-equal "tsx" (file-name-extension buffer-file-name))
- (setup-typescript))))
;; Eslint through Flycheck.
(require 'flycheck)
@@ -92,9 +69,9 @@
;; CSS eldoc
(use-package css-eldoc
- :commands turn-on-css-eldoc
- :config
- (add-hook 'css-mode-hook 'turn-on-css-eldoc))
+ :commands turn-on-css-eldoc)
+
+(add-hook 'css-mode-hook 'turn-on-css-eldoc)
(provide 'web)
;;; web.el ends here