Skip to content

Instantly share code, notes, and snippets.

@JohnL4
Last active September 26, 2017 11:41
Show Gist options
  • Save JohnL4/8e2ffb31aa371a2d9a74d5defa72587e to your computer and use it in GitHub Desktop.
Save JohnL4/8e2ffb31aa371a2d9a74d5defa72587e to your computer and use it in GitHub Desktop.
emacs tide (typescript-mode) configuration
(add-hook 'typescript-mode-hook
(lambda ()
(tide-setup)
(flycheck-mode +1)
(eldoc-mode +1)
(company-mode)
(setq fill-column 120)
(local-set-key "\C-j" 'newline)
(local-set-key "\r" 'newline-and-indent) ;Auto-indent.
(local-set-key "\M-o" 'one-line-section-break)
(local-set-key (kbd "<f2> r") 'tide-rename-symbol)
(local-set-key (kbd "S-<f12>") 'tide-references)
))
;; Note that the following don't work for me when set inside the mode hook. Don't know why.
(setq typescript-indent-level 3)
(setq tide-format-options '(:placeOpenBraceOnNewLineForFunctions t :placeOpenBraceOnNewLineForControlBlocks t))
(setq company-tooltip-align-annotations t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment