Skip to content

Commit 0fb8211

Browse files
committed
Create typescript filetype, duplicate of javascript
1 parent eaae3ba commit 0fb8211

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

ftplugin/javascript.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
" Contents should be identical for javascript, typescript - not creating
2+
" symlinks to make it compatible for potential Windows users.
13
function! s:DebugStringFun()
24
let l:debug_str = 'console.log("' . g:DebugstringPrefixStr() . g:debugStringCounter . '");'
35
:return l:debug_str

ftplugin/typescript.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
" Contents should be identical for javascript, typescript - not creating
2+
" symlinks to make it compatible for potential Windows users.
3+
function! s:DebugStringFun()
4+
let l:debug_str = 'console.log("' . g:DebugstringPrefixStr() . g:debugStringCounter . '");'
5+
:return l:debug_str
6+
endfunc
7+
8+
function! s:DebugVarFun(desc, var)
9+
let l:debug_str = 'console.log(`' . a:desc . '`, ' . a:var . ')'
10+
return l:debug_str
11+
endfunc
12+
13+
14+
command! -buffer -nargs=0 AddDebugString put=s:DebugStringFun()
15+
command! -buffer -nargs=1 AddDebugStringExpr
16+
\ put=s:DebugVarFun(<args> . ': ', <args>)

test/basic.vader

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Execute (Java):
4646
:set filetype=java
4747
Execute (Javascript):
4848
:set filetype=javascript
49+
Execute (Typescript):
50+
:set filetype=typescript
4951
Execute (Python):
5052
:set filetype=python
5153
Execute (R):

test/ft/a.typescript

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.log("[[Vader-workbench]:$1$] DEBUGGING STRING ==> $2$");
2+
console.log(`a**2 + b**2: `, a**2 + b**2)

0 commit comments

Comments
 (0)