The best thing to do is enable filetype detection:
Vim defaults to setting .tsx files as typescriptreact (8.1.2100 for me at least).
To enable filetype-plugins and indent scripts (recommended):
filetype plugin indent on
TL;DR Use :h packages
You will need
the plugin code (github is easiest, though if you just have a copy of the
source tree lying around, that works too)
A brief history of time managing plugins1
I won't go into extreme detail here unless it is requested. This is mostly a
background section, and can be skipped if needed.
In the dark ages, you used to need ...
The usual way to compile from Vim is to use :make. From :h :make:
:mak[e][!] [arguments] 1. All relevant |QuickFixCmdPre| autocommands are
2. If the 'autowrite' option is on, write any changed
3. An errorfile name is made from 'makeef'. If
'makeef' doesn't contain "##", ...
What you want is to use a Language Server through the Language Server Protocol (LSP).
Read more about it on Wikipedia or on the official website.
As the Wikipedia article points out:
The Language Server Protocol was originally developed for Microsoft's Visual Studio Code and is now an open standard.
So what you get in VS Code is actually being backed ...