Emacs personal configuration
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

34 行
906B

  1. ;;; package --- Typescript configuration
  2. ;;; Commentary:
  3. ;;; Code:
  4. (require-package 'tide)
  5. (defun setup-tide-mode ()
  6. (interactive)
  7. (tide-setup)
  8. (flycheck-mode +1)
  9. (setq flycheck-check-syntax-automatically '(save mode-enabled))
  10. (eldoc-mode +1)
  11. (tide-hl-identifier-mode +1)
  12. ;; company is an optional dependency. You have to
  13. ;; install it separately via package-install
  14. ;; `M-x package-install [ret] company`
  15. (company-mode +1))
  16. ;; aligns annotation to the right hand side
  17. (setq company-tooltip-align-annotations t)
  18. ;; https://github.com/ananthakumaran/tide/issues/229#issuecomment-357379743
  19. ;(setq typescript-indent-level
  20. ; (or (plist-get (tide-tsfmt-options) ':indentSize) 4))
  21. ;; formats the buffer before saving
  22. (add-hook 'before-save-hook 'tide-format-before-save)
  23. (add-hook 'typescript-mode-hook #'setup-tide-mode)
  24. (provide 'init-typescript)
  25. ;;; init-typescript ends here