summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-06-07 08:21:30 -0400
committermattkae <mattkae@protonmail.com>2022-06-07 08:21:30 -0400
commitb07628dddf418d4f47b858e6c35fd3520fbaeed2 (patch)
tree376cd7b4b5daed06ac397ac23ae041e4b365ad08 /lisp
parentbecff06c71d277647eda4378203d03ab36e141eb (diff)
Flycheck mode and typescript
Diffstat (limited to 'lisp')
-rw-r--r--lisp/general.el5
-rw-r--r--lisp/org-custom.el5
-rw-r--r--lisp/ts-custom.el34
3 files changed, 41 insertions, 3 deletions
diff --git a/lisp/general.el b/lisp/general.el
index f6f447b..caf2f92 100644
--- a/lisp/general.el
+++ b/lisp/general.el
@@ -52,6 +52,11 @@
;; Smooth scroll
(require 'smooth-scrolling)
(smooth-scrolling-mode 1)
+
+ ;; Show flycheck always and after save
+ (use-package flycheck :ensure t)
+ (global-flycheck-mode)
+ (add-hook 'after-init-hook #'global-flycheck-mode)
)
(provide 'general)
diff --git a/lisp/org-custom.el b/lisp/org-custom.el
index 6b4713b..4323cae 100644
--- a/lisp/org-custom.el
+++ b/lisp/org-custom.el
@@ -34,8 +34,7 @@
'(org-code ((t (:inherit (shadow fixed-pitch)))))
'(org-document-info ((t (:foreground "dark orange"))))
'(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
- '(org-indent ((t (:inherit (org-hide fixed-pitch)))))
- '(org-link ((t (:foreground "royal blue" :underline t))))
+ '(org-link ((t (:foreground "royalblue" :underline t))))
'(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
'(org-property-value ((t (:inherit fixed-pitch))) t)
'(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))
@@ -47,7 +46,7 @@
(visual-line-mode)
(require 'org-bullets)
- (org-bullets-mode 1)
+ (org-bullets-mode +1)
(setq org-blank-before-new-entry (quote ((heading . nil)
(plain-list-item . nil))))
diff --git a/lisp/ts-custom.el b/lisp/ts-custom.el
new file mode 100644
index 0000000..3054102
--- /dev/null
+++ b/lisp/ts-custom.el
@@ -0,0 +1,34 @@
+(defun setup-ts()
+
+ (use-package tide :ensure t)
+ (use-package company :ensure t)
+ (use-package flycheck :ensure t)
+ (defun setup-tide-mode()
+ (interactive)
+ (tide-setup)
+ (flycheck-mode +1)
+ (setq web-mode-enable-auto-quoting nil)
+ (setq web-mode-markup-indent-offset 2)
+ (setq web-mode-code-indent-offset 2)
+ (setq web-mode-attr-indent-offset 2)
+ (setq web-mode-attr-value-indent-offset 2)
+ (setq flycheck-check-syntax-automatically '(save-mode-enabled))
+ (eldoc-mode +1)
+ (tide-hl-identifier-mode +1)
+ (company-mode +1)
+ (setq flycheck-check-syntax-automatically '(mode-enabled save)))
+
+ (add-hook 'typescript-mode-hook #'setup-tide-mode)
+ (add-hook 'before-save-hook 'tide-format-before-save)
+ (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-tide-mode))))
+
+ ;; enable typescript - tslint checker
+ (flycheck-add-mode 'typescript-tslint 'web-mode))
+
+(provide 'ts-custom)