Skip to content

Commit 3a7d48a

Browse files
committed
That's not a crossroads, that's a T-junction.
0 parents  commit 3a7d48a

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Node for Vim
2+
Copyright (C) 2013 Andri Möll
3+
4+
This program is free software: you can redistribute it and/or modify it under
5+
the terms of the GNU Affero General Public License as published by the Free
6+
Software Foundation, either version 3 of the License, or any later version.
7+
8+
Additional permission under the GNU Affero GPL version 3 section 7:
9+
If you modify this Program, or any covered work, by linking or
10+
combining it with other code, such other code is not for that reason
11+
alone subject to any of the requirements of the GNU Affero GPL version 3.
12+
13+
In summary:
14+
- You can use this program for no cost.
15+
- You can use this program for both personal and commercial reasons.
16+
- You do not have to share your own program's code which uses this program.
17+
- You have to share modifications (e.g bug-fixes) you've made to this program.
18+
19+
For the full copy of the GNU Affero General Public License see:
20+
http://www.gnu.org/licenses.

ftdetect/node.vim

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function! s:isNode()
2+
let shebang = getline(1)
3+
if shebang =~# '^#!.*/bin/env\s\+node\>' | return 1 | en
4+
if shebang =~# '^#!.*/bin/node\>' | return 1 | en
5+
return 0
6+
endfunction
7+
8+
au BufRead,BufNewFile * if !did_filetype() && s:isNode() | setf javascript | en

test/ftdetect/shebang-usr-bin

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/usr/bin/node

test/ftdetect/shebang-usr-env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/usr/bin/env node

test/ftdetect/shebang-usr-local-bin

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/usr/local/bin/node

0 commit comments

Comments
 (0)