TypeScript layer: tweak layer
- remove not necessary binding for flymake - adapt key bindings to conventions - minor reformat of README.md
This commit is contained in:
parent
f9fa443f83
commit
37e515a57c
|
@ -15,16 +15,19 @@
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
This adds support for TypeScript editing via [typescript-tools](https://github.com/clausreinke/typescript-tools) and [emacs-tss](https://github.com/aki2o/emacs-tss).
|
This layer adds support for TypeScript editing via [typescript-tools][] and
|
||||||
|
[emacs-tss][].
|
||||||
|
|
||||||
These provide:
|
This layer provides:
|
||||||
- syntax coloring
|
- syntax coloring
|
||||||
- error highlighting
|
- error highlighting
|
||||||
- autocompletion
|
- auto-completion via Flymake
|
||||||
- jump-to-definition
|
- jump-to-definition
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
### Layer
|
||||||
|
|
||||||
To use this contribution add it to your `~/.spacemacs`
|
To use this contribution add it to your `~/.spacemacs`
|
||||||
|
|
||||||
```elisp
|
```elisp
|
||||||
|
@ -33,9 +36,10 @@ To use this contribution add it to your `~/.spacemacs`
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
You'll need [typescript-tools](https://github.com/clausreinke/typescript-tools) and fairly obviously also the TypeScript compiler:
|
You'll need [typescript-tools][] and fairly obviously also the TypeScript
|
||||||
|
compiler:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ npm install typescript
|
$ npm install typescript
|
||||||
$ git clone git://github.com/clausreinke/typescript-tools.git
|
$ git clone git://github.com/clausreinke/typescript-tools.git
|
||||||
$ cd typescript-tools/
|
$ cd typescript-tools/
|
||||||
|
@ -46,6 +50,8 @@ $ npm install -g
|
||||||
|
|
||||||
Key Binding | Description
|
Key Binding | Description
|
||||||
--------------|------------------------------------------------------------
|
--------------|------------------------------------------------------------
|
||||||
`<SPC> m h` | Show popup help (with type info)
|
`<SPC> m g g` | Jump to definition
|
||||||
`<SPC> m d` | Jump to definition
|
`<SPC> m h h` | Show popup help (with type info)
|
||||||
`<SPC> m c f` | Flymake check (is done automatically on save)
|
|
||||||
|
[emacs-tss]: https://github.com/aki2o/emacs-tss
|
||||||
|
[typescript-tools]: https://github.com/clausreinke/typescript-tools
|
||||||
|
|
|
@ -10,26 +10,14 @@
|
||||||
;;
|
;;
|
||||||
;;; License: GPLv3
|
;;; License: GPLv3
|
||||||
|
|
||||||
(defvar typescript-packages '(tss)
|
(setq typescript-packages '(tss))
|
||||||
"List of all packages to install and/or initialize. Built-in packages
|
|
||||||
which require an initialization must be listed explicitly in the list.")
|
|
||||||
|
|
||||||
(defvar typescript-excluded-packages '()
|
|
||||||
"List of packages to exclude.")
|
|
||||||
|
|
||||||
(defun typescript/init-tss ()
|
(defun typescript/init-tss ()
|
||||||
"Initialize my package"
|
"Initialize my package"
|
||||||
(use-package tss
|
(use-package tss
|
||||||
:mode ("\\.ts\\'" . typescript-mode)
|
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:mode ("\\.ts\\'" . typescript-mode)
|
||||||
(progn
|
:init (evil-leader/set-key-for-mode 'typescript-mode
|
||||||
(require 'typescript)
|
"mgg" 'tss-jump-to-definition
|
||||||
(require 'tss)
|
"mhh" 'tss-popup-help)
|
||||||
(evil-leader/set-key-for-mode 'typescript-mode
|
:config (tss-config-default)))
|
||||||
"mh" 'tss-popup-help
|
|
||||||
"md" 'tss-jump-to-definition
|
|
||||||
"mcf" 'tss-run-flymake))
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
(tss-config-default))))
|
|
||||||
|
|
Loading…
Reference in a new issue