Need help with yats.vim?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

HerringtonDarkholme
579 Stars 57 Forks 860 Commits 57 Opened issues

Description

Yet Another TypeScript Syntax: The most advanced TypeScript Syntax Highlighting in Vim

Services available

!
?

Need anything else?

Contributors list

# 3,203
Vue.js
deoplet...
vanilla...
Vanilla...
470 commits
# 18,265
viml
Perl
Vim
React
228 commits
# 11,106
github-...
Crystal
Electro...
phantom...
19 commits
# 528,239
viml
JavaScr...
TypeScr...
Shell
14 commits
# 153,926
Neovim
C
test-fr...
deoplet...
11 commits
# 27,780
TypeScr...
React
iterm2
syntax-...
6 commits
# 516,308
JavaScr...
tsx
jsx
TypeScr...
5 commits
# 302,993
Neovim
ack
pt
C
4 commits
# 147,616
cheminf...
deoplet...
Vim
Neovim
4 commits
# 375,310
fluentd
Scala
PHP
Vim
3 commits
# 368,979
XML
Shell
viml
xsd
3 commits
# 283,422
TypeScr...
viml
HTML
Jekyll
3 commits
# 78,481
freecad
workben...
Less
viml
3 commits
# 57,252
Clojure
ligatur...
Shell
HTML
2 commits
# 69,009
tailwin...
graphql...
vscode-...
figma
2 commits
# 634,839
JavaScr...
TypeScr...
Shell
viml
2 commits
# 223,104
dsl
seriali...
playfra...
scalajs
2 commits
# 25,565
React
reasonm...
Rust
hashtag...
2 commits
# 130,865
egg
Less
C
viml
1 commit
# 709,312
HTML
TypeScr...
React
Mobile
1 commit

YATS: Yet Another TypeScript Syntax

Build Status

screenshot

Yet Another TypeScript Syntax file for Vim, adapted from YAJS. Key differences:

  • Exuberant Highlighting. The most elaborate or byzatine syntax highlighting for TypeScript.
  • Bundled with snippets for UltiSnips!
  • Builtin Support for tagbar!
  • Use 'typescript' as group name's prefix, not 'typeScript' nor 'TypeScript'. Works great with SyntaxComplete.
  • Inherit Web API and DOM keywords from YAJS
  • Syntax fold. Fold long code block, semantically!
  • Remove old, unused syntax definitions.

Config

  • let g:yats_host_keyword = 1
    : configure yats to highlight host specific keywords like
    addEventListener
    . Default is 1. Set it 0 to turn off highlighting.
  • Note:

    set re=0
    explicitly in your vimrc. Old regexp engine will incur performance issues for yats and old engine is usually turned on by other plugins.

Concealing Characters

You can customize concealing characters, if your font provides the glyph you want, by defining one or more of the following variables:

let g:typescript_conceal_function             = "ƒ"
let g:typescript_conceal_null                 = "ø"
let g:typescript_conceal_undefined            = "¿"
let g:typescript_conceal_this                 = "@"
let g:typescript_conceal_return               = "⇚"
let g:typescript_conceal_prototype            = "¶"
let g:typescript_conceal_super                = "Ω"

You can enable concealing within VIM with:

set conceallevel=1

OR if you wish to toggle concealing you may wish to bind a command such as the following which will map

l
(leader is usually the
\
key) to toggling conceal mode:
map l :exec &conceallevel ? "set conceallevel=0" : "set conceallevel=1"

Credits

  • othree, whose YAJS is the most up-to-date js syntax for Vim
  • Jose Elera, Enhanced Javascript syntax
  • Zhao Yi, Claudio Fleiner, Scott Shattuck (This file is based on their hard work)
  • gumnos (From the #vim IRC Channel in Freenode) (Who helped me figured out the crazy Vim Regexes)

License

The same as Vim

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.