{"id":13470136,"url":"https://github.com/leafgarland/typescript-vim","last_synced_at":"2025-05-14T06:11:55.752Z","repository":{"id":4888614,"uuid":"6044030","full_name":"leafgarland/typescript-vim","owner":"leafgarland","description":"Typescript syntax files for Vim","archived":false,"fork":false,"pushed_at":"2025-01-15T22:48:32.000Z","size":172,"stargazers_count":1900,"open_issues_count":44,"forks_count":145,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-12T19:43:07.981Z","etag":null,"topics":["typescript","typescript-syntax","vim"],"latest_commit_sha":null,"homepage":null,"language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jtnelson/centos-server-setup","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leafgarland.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-10-02T11:43:38.000Z","updated_at":"2025-03-24T14:55:27.000Z","dependencies_parsed_at":"2022-07-13T05:50:26.757Z","dependency_job_id":"ee39101f-826f-44c9-a7d3-ae41f0b263f0","html_url":"https://github.com/leafgarland/typescript-vim","commit_stats":{"total_commits":112,"total_committers":55,"mean_commits":2.036363636363636,"dds":0.8660714285714286,"last_synced_commit":"52f3ca3474d51f5021696ffb7297d989e49121ac"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafgarland%2Ftypescript-vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafgarland%2Ftypescript-vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafgarland%2Ftypescript-vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafgarland%2Ftypescript-vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafgarland","download_url":"https://codeload.github.com/leafgarland/typescript-vim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254080106,"owners_count":22011322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["typescript","typescript-syntax","vim"],"created_at":"2024-07-31T16:00:23.729Z","updated_at":"2025-05-14T06:11:55.668Z","avatar_url":"https://github.com/leafgarland.png","language":"Vim Script","readme":"An old Typescript Syntax for Vim\n=========================\n\n---\n\nNOTE: This Typescript syntax was created before Typescript's 1.0 release, more than a decade ago. I hope it \nhas been helpful but there are now other options available. Vim has included \n[Typescript syntax](https://github.com/vim/vim/blob/master/runtime/syntax/typescript.vim) for some years,\nwhich receives more frequent updates at its own [repository](https://github.com/HerringtonDarkholme/yats.vim).\nNeovim can also use a [treesitter grammar](https://github.com/tree-sitter/tree-sitter-typescript) for highlighting.\n\n---\n\nSyntax file and other settings for [TypeScript](http://typescriptlang.org). The\nsyntax file was originally from this 2012 [blog\npost](https://docs.microsoft.com/en-us/archive/blogs/interoperability/sublime-text-vi-emacs-typescript-enabled).\n\nCheckout [Tsuquyomi](https://github.com/Quramy/tsuquyomi) for omni-completion\nand other features for TypeScript editing.\n\nInstall\n-------\n\nFrom Vim 8 onward, the plugin can be installed as simply as (Unix/Mac):\n```\ngit clone https://github.com/leafgarland/typescript-vim.git ~/.vim/pack/typescript/start/typescript-vim\n```\n\nOn Windows/Powershell, use the following:\n```\ngit clone https://github.com/leafgarland/typescript-vim.git $home/vimfiles/pack/typescript/start/typescript-vim\n```\n\nFor older versions of Vim, the simplest way to install is via a Vim add-in manager such as\n[Plug](https://github.com/junegunn/vim-plug),\n[Vundle](https://github.com/gmarik/vundle) or\n[Pathogen](https://github.com/tpope/vim-pathogen/).\n\n_See the [Installation Wiki](https://github.com/leafgarland/typescript-vim/wiki/Installation)_\n\n### Pathogen\n\n```\ngit clone https://github.com/leafgarland/typescript-vim.git ~/.vim/bundle/typescript-vim\n```\n\nIf you want to install manually then you need to copy the files from this\nrepository into your vim path, see the vim docs for [:help\nruntimepath](http://vimdoc.sourceforge.net/htmldoc/options.html#'runtimepath')\nfor more information. This might be as simple as copying the files and\ndirectories to `~/.vim/` but it depends on your Vim install and operating\nsystem.\n\nUsage\n-----\n\nOnce the files are installed the syntax highlighting and other settings will be\nautomatically enabled anytime you edit a `.ts` file.\n\nIndenting\n---------\n\nThis plugin includes a custom indenter (based on [pangloss/vim-javascript's\nindenter](https://github.com/pangloss/vim-javascript/blob/master/indent/javascript.vim)),\nit works pretty well but there are cases where it fails. If these bother you or\nwant to use other indent settings you can disable it by setting a flag in your\n`.vimrc`:\n\n```vim\nlet g:typescript_indent_disable = 1\n```\n\nIf you want the indenter to automatically indent chained method calls as you type.\n\n```typescript\nsomething\n    .foo()\n    .bar();\n```\n\nThen add something like `setlocal indentkeys+=0.` to your `.vimrc`, see `:help\n'indentkeys'` in vim for more information.\n\nIf you use the `=` operator to re-indent code it will always indent\nchained method calls - this can be disabled by changing the regex the\nindent script uses to identify indented lines. In this case removing '.'\nfrom the regex means that it wont indent lines starting with '.'. Note,\nthis is not ideal as the regex may change making your setting out of date.\n\n```vim\nlet g:typescript_opfirst='\\%([\u003c\u003e=,?^%|*/\u0026]\\|\\([-:+]\\)\\1\\@!\\|!=\\|in\\%(stanceof\\)\\=\\\u003e\\)'\n```\n\nCompiler settings\n-----------------\n\nThis plugin contains compiler settings to set `makeprg` and `errorformat`. \nThe compiler settings enable you to call the `tsc` compiler directly from Vim\nand display any errors or warnings in Vim's QuickFix window. \n\nTo run the compiler, enter `:make`, this will run `tsc` against the last saved\nversion of your currently edited file.\n\nThe default for `makeprg` is `tsc $* %`. You can enter other compiler options into your `:make`\ncommand line and they will be inserted in place of `$*`.\n\nThere are options to change the compiler name and to insert default options.\n\n```vim\nlet g:typescript_compiler_binary = 'tsc'\nlet g:typescript_compiler_options = ''\n```\n\nThese options will be passed to the binary as command arguments. For example,\nif `g:typescript_compiler_binary = 'tsc'` and `g:typescript_compiler_options = '--lib es6'`,\n`l:makeprg` will be: `tsc --lib es6 $* %`.\n\nYou can completely override this plugin's compiler settings with something like\nthis in your `.vimrc`, where you can set makeprg to whatever you want.\n\n```vim\n  autocmd FileType typescript :set makeprg=tsc\n```\n\nNote, this plugin's compiler settings are not used by Syntastic which has its own\nway of changing the options. See https://github.com/scrooloose/syntastic#faqargs.\n\nYou can use something like this in your `.vimrc` to make the QuickFix\nwindow automatically appear if `:make` has any errors.\n\n```vim\nautocmd QuickFixCmdPost [^l]* nested cwindow\nautocmd QuickFixCmdPost    l* nested lwindow\n```\n\nSyntax highlighting\n-------------------\n\nSyntax highlighting for TypeScript can be customized by following variables.\n\n- `g:typescript_ignore_typescriptdoc`: When this variable is defined, doccomments will not be\n  highlighted.\n- `g:typescript_ignore_browserwords`: When this variable is set to `1`, browser API names such as\n  `window` or `document` will not be highlighted. (default to `0`)\n\n![Obligatory screenshot](https://raw.github.com/leafgarland/typescript-vim/master/vimshot01.png)\n","funding_links":[],"categories":["Getting Started with (Awesome) TypeScript","Vim Script","Plugins / Themes / Dependencies","TypeScript IDE"],"sub_categories":["IDE","Offline"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafgarland%2Ftypescript-vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafgarland%2Ftypescript-vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafgarland%2Ftypescript-vim/lists"}