From f9fa443f83cac9cb349c952599d6929b198c1cd0 Mon Sep 17 00:00:00 2001 From: Chris Bowdon Date: Tue, 14 Apr 2015 22:43:50 +0100 Subject: [PATCH] Add TypeScript configuration layer --- contrib/lang/typescript/README.md | 51 +++++++++++++++++++++ contrib/lang/typescript/img/TypeScript.png | Bin 0 -> 3617 bytes contrib/lang/typescript/packages.el | 35 ++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 contrib/lang/typescript/README.md create mode 100644 contrib/lang/typescript/img/TypeScript.png create mode 100644 contrib/lang/typescript/packages.el diff --git a/contrib/lang/typescript/README.md b/contrib/lang/typescript/README.md new file mode 100644 index 000000000..55504ee84 --- /dev/null +++ b/contrib/lang/typescript/README.md @@ -0,0 +1,51 @@ +# TypeScript contribution layer for Spacemacs + +![logo](img/TypeScript.png) + + +**Table of Contents** + +- [TypeScript contribution layer for Spacemacs](#typescript-contribution-layer-for-spacemacs) + - [Description](#description) + - [Install](#install) + - [Prerequisites](#prerequisites) + - [Key bindings](#key-bindings) + + + +## 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). + +These provide: +- syntax coloring +- error highlighting +- autocompletion +- jump-to-definition + +## Install + +To use this contribution add it to your `~/.spacemacs` + +```elisp +(setq-default dotspacemacs-configuration-layers '(typescript)) +``` + +### Prerequisites + +You'll need [typescript-tools](https://github.com/clausreinke/typescript-tools) and fairly obviously also the TypeScript compiler: + +``` +$ npm install typescript +$ git clone git://github.com/clausreinke/typescript-tools.git +$ cd typescript-tools/ +$ npm install -g +``` + +## Key bindings + +Key Binding | Description +--------------|------------------------------------------------------------ +` m h` | Show popup help (with type info) +` m d` | Jump to definition +` m c f` | Flymake check (is done automatically on save) diff --git a/contrib/lang/typescript/img/TypeScript.png b/contrib/lang/typescript/img/TypeScript.png new file mode 100644 index 0000000000000000000000000000000000000000..6b8bdb534a6f8f5d298db7ccb425cda0a3da6c15 GIT binary patch literal 3617 z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jtZs-?|L`GQDoJwn^ zc!2YOaAg4IN2 zTi!T3J9fcm=O1WK0+5#H8RcN6u(XhNn&c@lu-EWViSO_D;l~Mg1g*B0WObi|TD>r@ z6(bUL-n?_I1Dr7M<`XAsq_6D835@oHpdTG%0bkNVegdayG#~NmhXQ|W=5N`pS srrhqFn<7R&FIZHk3PWM()SWeTU|W?efKRAs{|5&!H?=k)7+p#DKg32jKmY&$ literal 0 HcmV?d00001 diff --git a/contrib/lang/typescript/packages.el b/contrib/lang/typescript/packages.el new file mode 100644 index 000000000..04d333275 --- /dev/null +++ b/contrib/lang/typescript/packages.el @@ -0,0 +1,35 @@ +;;; packages.el --- typescript Layer packages File for Spacemacs +;; +;; Copyright (c) 2012-2014 Sylvain Benner +;; Copyright (c) 2014-2015 Chris Bowdon & Contributors +;; +;; Author: Chris Bowdon +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 + +(defvar 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 () + "Initialize my package" + (use-package tss + :mode ("\\.ts\\'" . typescript-mode) + :defer t + :init + (progn + (require 'typescript) + (require 'tss) + (evil-leader/set-key-for-mode 'typescript-mode + "mh" 'tss-popup-help + "md" 'tss-jump-to-definition + "mcf" 'tss-run-flymake)) + :config + (progn + (tss-config-default))))