Skip to content

Commit 197914a

Browse files
committed
Add TypeScript support
1 parent 3dc959f commit 197914a

File tree

5 files changed

+371
-42
lines changed

5 files changed

+371
-42
lines changed

README.md

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# vim-javascript
22

3-
JavaScript bundle for vim, this bundle provides syntax highlighting and
4-
improved indentation.
3+
JavaScript and TypeScript bundle for vim, this bundle provides syntax
4+
highlighting and improved indentation.
5+
6+
Note: This is my personal fork of pangloss/vim-javascript that removes flow
7+
support and adds TypeScript instead. Other than that, it should match the
8+
origin and I will mostly be pulling from there and trying to submit any
9+
changes upstream.
510

611

712
## Installation
813

914
### Install with native package manager
1015

11-
git clone https://github.com/pangloss/vim-javascript.git ~/.vim/pack/vim-javascript/start/vim-javascript
16+
git clone https://github.com/vieira/vim-javascript.git ~/.vim/pack/vim-javascript/start/vim-javascript
1217

1318
since Vim 8.
1419

1520
### Install with [pathogen](https://github.com/tpope/vim-pathogen)
1621

17-
git clone https://github.com/pangloss/vim-javascript.git ~/.vim/bundle/vim-javascript
22+
git clone https://github.com/vieira/vim-javascript.git ~/.vim/bundle/vim-javascript
1823

1924
alternatively, use a package manager like [vim-plug](https://github.com/junegunn/vim-plug)
2025

@@ -47,16 +52,6 @@ Default Value: 0
4752

4853
-----------------
4954

50-
```
51-
let g:javascript_plugin_flow = 1
52-
```
53-
54-
Enables syntax highlighting for [Flow](https://flowtype.org/).
55-
56-
Default Value: 0
57-
58-
-----------------
59-
6055
```vim
6156
augroup javascript_folding
6257
au!
@@ -69,34 +64,6 @@ Enables code folding for javascript based on our syntax file.
6964
Please note this can have a dramatic effect on performance.
7065

7166

72-
## Concealing Characters
73-
74-
You can customize concealing characters, if your font provides the glyph you want, by defining one or more of the following
75-
variables:
76-
77-
let g:javascript_conceal_function = "ƒ"
78-
let g:javascript_conceal_null = "ø"
79-
let g:javascript_conceal_this = "@"
80-
let g:javascript_conceal_return = "⇚"
81-
let g:javascript_conceal_undefined = "¿"
82-
let g:javascript_conceal_NaN = "ℕ"
83-
let g:javascript_conceal_prototype = "¶"
84-
let g:javascript_conceal_static = "•"
85-
let g:javascript_conceal_super = "Ω"
86-
let g:javascript_conceal_arrow_function = "⇒"
87-
let g:javascript_conceal_noarg_arrow_function = "🞅"
88-
let g:javascript_conceal_underscore_arrow_function = "🞅"
89-
90-
91-
You can enable concealing within VIM with:
92-
93-
set conceallevel=1
94-
95-
OR if you wish to toggle concealing you may wish to bind a command such as the following which will map `<LEADER>l` (leader is usually the `\` key) to toggling conceal mode:
96-
97-
map <leader>l :exec &conceallevel ? "set conceallevel=0" : "set conceallevel=1"<CR>
98-
99-
10067
## Indentation Specific
10168

10269
* `:h cino-:`

compiler/tsc.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
" Vim compiler plugin
2+
" Language: Typescript
3+
4+
if exists("current_compiler")
5+
finish
6+
endif
7+
let current_compiler = "typescript"
8+
9+
if exists(":CompilerSet") != 2
10+
command! -nargs=* CompilerSet setlocal <args>
11+
endif
12+
13+
CompilerSet makeprg=npx\ --quiet\ tsc\ --noEmit\ %:p
14+
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m

0 commit comments

Comments
 (0)