summaryrefslogtreecommitdiffstats
path: root/autoload/polyglot.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-09-06 20:51:38 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-09-06 20:51:38 +0200
commitcd2fded0e0abb6b31fceaca128699eca0f300c63 (patch)
treee796660cd3f9e056566b72e3a104f56f11b51504 /autoload/polyglot.vim
parent255345bf9525c94479a7ff9b787d2f9848cb7a18 (diff)
downloadvim-polyglot-cd2fded0e0abb6b31fceaca128699eca0f300c63.tar.gz
vim-polyglot-cd2fded0e0abb6b31fceaca128699eca0f300c63.zip
Add support for Visual Basic and Basic
Diffstat (limited to 'autoload/polyglot.vim')
-rw-r--r--autoload/polyglot.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/autoload/polyglot.vim b/autoload/polyglot.vim
index eca7e304..ffb3c43f 100644
--- a/autoload/polyglot.vim
+++ b/autoload/polyglot.vim
@@ -256,6 +256,16 @@ func! polyglot#DetectLidrFiletype()
setf lidris2 | return
endfunc
+func! polyglot#DetectBasFiletype()
+ for lnum in range(1, min([line("$"), 5]))
+ let line = getline(lnum)
+ if line =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
+ setf vb | return
+ endif
+ endfor
+ setf basic | return
+endfunc
+
" Restore 'cpoptions'
let &cpo = s:cpo_save
unlet s:cpo_save