1 vis
.lexers
= require('lexer')
5 vis
.events
.win_open
= function(win
)
8 [".1|.2|.3|.4|.5|.6|.7|.8|.9|.1x|.2x|.3x|.4x|.5x|.6x|.7x|.8x|.9x"] = "man",
9 [".au3|.a3x"] = "autoit",
10 [".as|.asc"] = "actionscript",
11 [".adb|.ads"] = "ada",
13 [".ans|.inp|.mac"] = "apdl",
15 [".applescript"] = "applescript",
16 [".asm|.ASM|.s|.S"] = "asm",
17 [".asa|.asp|.hta"] = "asp",
19 [".bat|.cmd"] = "batch",
23 [".c|.cc|.C"] = "ansi_c",
24 [".cpp|.cxx|.c++|.h|.hh|.hpp|.hxx|.h++"] = "cpp",
26 [".cmake|.cmake.in|.ctest|.ctest.in"] = "cmake",
27 [".coffee"] = "coffeescript",
29 [".cu|.cuh"] = "cuda",
32 [".desktop"] = "desktop",
33 [".diff|.patch"] = "diff",
35 [".e|.eif"] = "eiffel",
36 [".ex|.exs"] = "elixir",
37 [".erl|.hrl"] = "erlang",
39 [".feature"] = "gherkin",
42 [".forth|.frt|.fs"] = "forth",
43 [".f|.for|.ftn|.fpp|.f77|.f90|.f95|.f03|.f08"] = "fortran",
44 [".g|.gd|.gi|.gap"] = "gap",
45 [".po|.pot"] = "gettext",
46 [".glslf|.glslv"] = "glsl",
47 [".dem|.plt"] = "gnuplot",
49 [".groovy|.gvy"] = "groovy",
52 [".htm|.html|.shtm|.shtml|.xhtml"] = "html",
54 [".idl|.odl"] = "idl",
55 [".inf|.ni"] = "inform",
56 [".cfg|.cnf|.inf|.ini|.reg"] = "ini",
58 [".bsh|.java"] = "java",
59 [".js|.jsfl"] = "javascript",
62 [".bbl|.dtx|.ins|.ltx|.tex|.sty"] = "latex",
64 [".lily|.ly"] = "lilypond",
65 [".ledger|.journal"] = "ledger",
66 [".cl|.el|.lisp|.lsp"] = "lisp",
67 [".litcoffee"] = "litcoffee",
69 ["GNUmakefile|.iface|.mak|.mk|makefile|Makefile"] = "makefile",
73 [".nsh|.nsi|.nsis"] = "nsis",
74 [".m|.mm|.objc"] = "objective_c",
75 [".caml|.ml|.mli|.mll|.mly"] = "caml",
76 [".dpk|.dpr|.p|.pas"] = "pascal",
77 [".al|.perl|.pl|.pm|.pod"] = "perl",
78 [".inc|.php|.php3|.php4|.phtml"] = "php",
79 [".pike|.pmod"] = "pike",
80 [".PKGBUILD"] = "pkgbuild",
81 [".ps1"] = "powershell",
83 [".prolog"] = "prolog",
84 [".props|.properties"] = "props",
86 [".sc|.py|.pyw"] = "python",
87 [".R|.Rout|.Rhistory|.Rt|Rout.save|Rout.fail"] = "rstats",
88 [".r|.reb"] = "rebol",
90 [".orx|.rex"] = "rexx",
91 [".erb|.rhtml"] = "rhtml",
92 [".Rakefile|.rake|.rb|.rbw"] = "ruby",
94 [".sass|.scss"] = "sass",
96 [".sch|.scm"] = "scheme",
97 [".sno|.SNO"] = "snobol4",
98 [".bash|.bashrc|.bash_profile|.configure|.csh|.sh|.zsh"] = "bash",
99 [".changes|.st|.sources"] = "smalltalk",
100 [".ddl|.sql"] = "sql",
101 [".tcl|.tk"] = "tcl",
102 [".texi"] = "texinfo",
105 [".vcf|.vcard"] = "vcard",
106 [".v|.ver"] = "verilog",
107 [".vh|.vhd|.vhdl"] = "vhdl",
108 [".asa|.bas|.cls|.ctl|.dob|.dsm|.dsr|.frm|.pag|.vb|.vba|.vbs"] = "vb",
110 [".dtd|.svg|.xml|.xsd|.xsl|.xslt|.xul"] = "xml",
111 [".xtend"] = "xtend",
115 local filename
= win
.file
.name
117 if filename
~= nil then
118 -- filename = string.lower(filename)
119 for patterns
, lang
in pairs(files
) do
120 for pattern
in string.gmatch(patterns
, '[^|]+') do
121 if #filename
>= #pattern
then
122 local s
, e
= string.find(filename
, pattern
, -#pattern
, true)
123 if s
~= e
and e
== #filename
then
124 vis
.command('set syntax '.. lang
)