aboutsummaryrefslogtreecommitdiff
path: root/.vim/ftdetect
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2019-09-05 19:35:38 +0300
committerYaroslav <contact@yaroslavps.com>2019-09-05 19:35:38 +0300
commit212dcd0bf753f08c0127a26a71b673c734b45c02 (patch)
tree4a43e43c7c9b9ccfcaef4088ba9e5f52154994b5 /.vim/ftdetect
downloadvimrice-212dcd0bf753f08c0127a26a71b673c734b45c02.tar.gz
vimrice-212dcd0bf753f08c0127a26a71b673c734b45c02.zip
init commit, extracted vim config from i3rice
Diffstat (limited to '.vim/ftdetect')
-rw-r--r--.vim/ftdetect/node.vim8
1 files changed, 8 insertions, 0 deletions
diff --git a/.vim/ftdetect/node.vim b/.vim/ftdetect/node.vim
new file mode 100644
index 0000000..ed50604
--- /dev/null
+++ b/.vim/ftdetect/node.vim
@@ -0,0 +1,8 @@
+function! s:isNode()
+ let shebang = getline(1)
+ if shebang =~# '^#!.*/bin/env\s\+node\>' | return 1 | en
+ if shebang =~# '^#!.*/bin/node\>' | return 1 | en
+ return 0
+endfunction
+
+au BufRead,BufNewFile * if !did_filetype() && s:isNode() | setf javascript | en