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",
34 ["Dockerfile"] = "dockerfile",
36 [".e|.eif"] = "eiffel",
37 [".ex|.exs"] = "elixir",
38 [".erl|.hrl"] = "erlang",
40 [".feature"] = "gherkin",
43 [".forth|.frt|.fs"] = "forth",
44 [".f|.for|.ftn|.fpp|.f77|.f90|.f95|.f03|.f08"] = "fortran",
45 [".g|.gd|.gi|.gap"] = "gap",
46 [".po|.pot"] = "gettext",
47 [".glslf|.glslv"] = "glsl",
48 [".dem|.plt"] = "gnuplot",
50 [".groovy|.gvy"] = "groovy",
53 [".htm|.html|.shtm|.shtml|.xhtml"] = "html",
55 [".idl|.odl"] = "idl",
56 [".inf|.ni"] = "inform",
57 [".cfg|.cnf|.inf|.ini|.reg"] = "ini",
59 [".bsh|.java"] = "java",
60 [".js|.jsfl"] = "javascript",
63 [".bbl|.dtx|.ins|.ltx|.tex|.sty"] = "latex",
65 [".lily|.ly"] = "lilypond",
66 [".ledger|.journal"] = "ledger",
67 [".cl|.el|.lisp|.lsp"] = "lisp",
68 [".litcoffee"] = "litcoffee",
70 ["GNUmakefile|.iface|.mak|.mk|makefile|Makefile"] = "makefile",
72 [".moon"] = "moonscript",
75 [".nsh|.nsi|.nsis"] = "nsis",
76 [".m|.mm|.objc"] = "objective_c",
77 [".caml|.ml|.mli|.mll|.mly"] = "caml",
78 [".dpk|.dpr|.p|.pas"] = "pascal",
79 [".al|.perl|.pl|.pm|.pod"] = "perl",
80 [".inc|.php|.php3|.php4|.phtml"] = "php",
82 [".pike|.pmod"] = "pike",
83 [".PKGBUILD"] = "pkgbuild",
84 [".ps1"] = "powershell",
86 [".prolog"] = "prolog",
87 [".props|.properties"] = "props",
89 [".sc|.py|.pyw"] = "python",
90 [".R|.Rout|.Rhistory|.Rt|Rout.save|Rout.fail"] = "rstats",
91 [".r|.reb"] = "rebol",
93 [".orx|.rex"] = "rexx",
94 [".erb|.rhtml"] = "rhtml",
95 [".Rakefile|.rake|.rb|.rbw"] = "ruby",
97 [".sass|.scss"] = "sass",
99 [".sch|.scm"] = "scheme",
100 [".sno|.SNO"] = "snobol4",
101 [".bash|.bashrc|.bash_profile|.configure|.csh|.sh|.zsh"] = "bash",
102 [".changes|.st|.sources"] = "smalltalk",
103 [".ddl|.sql"] = "sql",
104 [".tcl|.tk"] = "tcl",
105 [".texi"] = "texinfo",
108 [".vcf|.vcard"] = "vcard",
109 [".v|.ver"] = "verilog",
110 [".vh|.vhd|.vhdl"] = "vhdl",
111 [".asa|.bas|.cls|.ctl|.dob|.dsm|.dsr|.frm|.pag|.vb|.vba|.vbs"] = "vb",
113 [".dtd|.svg|.xml|.xsd|.xsl|.xslt|.xul"] = "xml",
114 [".xtend"] = "xtend",
118 local filename
= win
.file
.name
120 if filename
~= nil then
121 -- filename = string.lower(filename)
122 for patterns
, lang
in pairs(files
) do
123 for pattern
in string.gmatch(patterns
, '[^|]+') do
124 if #filename
>= #pattern
then
125 local s
, e
= string.find(filename
, pattern
, -#pattern
, true)
126 if s
~= e
and e
== #filename
then
127 vis
:command('set syntax '.. lang
)