Skip to content

Instantly share code, notes, and snippets.

@icholy
Last active March 21, 2023 19:35
Show Gist options
  • Save icholy/78dc8a9c5d9d6a1998ab to your computer and use it in GitHub Desktop.
Save icholy/78dc8a9c5d9d6a1998ab to your computer and use it in GitHub Desktop.
TypeScript autocomplete in vim

Install the tss tool.

git clone https://github.com/clausreinke/typescript-tools.git
cd typescript-tools
git checkout testing_ts1.4
npm install -g

Install vim plugin (my fork has a tiny tweak that made it work for me).

Bundle "icholy/typescript-tools.git"
au BufRead,BufNewFile *.ts        setlocal filetype=typescript

Create a tsconfig.json in the root of your project:
Note: (Every single one of your files needs to be listed in the files array).

{
  "compilerOptions": {
    "target": "es5",
    "noImplicitAny": false,
  },
  "files": [
    "Script.ts"
  ]
}

Start tss in vim

:TSSstart

DefinitelyTyped:

I'm using the new version of tsd and I include the generated tsd.d.ts file in the files array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment