1package mode
2
3// Mode is a per-filetype mode, like for Markdown
4type Mode int
5
6const (
7	// Mode "enum" values
8	Blank          = iota
9	Git            // Git commits and interactive rebases
10	Markdown       // Markdown (and asciidoctor and rst files)
11	Makefile       // Makefiles
12	Shell          // Shell scripts and PKGBUILD files
13	Config         // Config like yaml, yml, toml, and ini files
14	Assembly       // Assembly
15	GoAssembly     // Go-style Assembly
16	Go             // Go
17	Haskell        // Haskell
18	OCaml          // OCaml
19	StandardML     // Standard ML
20	Python         // Python
21	Text           // plain text documents
22	CMake          // CMake files
23	Vim            // Vim or NeoVim configuration, or .vim scripts
24	V              // V programming language
25	Clojure        // Clojure
26	Lisp           // Common Lisp and Emacs Lisp
27	Zig            // Zig
28	Kotlin         // Kotlin
29	Java           // Java
30	HIDL           // the Android-related Hardware Abstraction Layer Interface Definition Language
31	SQL            // Structured Query Language
32	Oak            // Oak
33	Rust           // Rust
34	Lua            // Lua
35	Crystal        // Crystal
36	Nim            // Nim
37	ObjectPascal   // Object Pascal and Delphi
38	Bat            // DOS batch files
39	Cpp            // C++
40	C              // C
41	Ada            // Ada
42	HTML           // HTML
43	Odin           // Odin
44	XML            // XML
45	PolicyLanguage // SE Linux configuration files
46	Nroff          // editing man pages
47	Scala          // Scala
48	JSON           // JSON and iPython notebooks
49	Battlestar     // Battlestar
50	CS             // C#
51	JavaScript     // JavaScript
52	TypeScript     // TypeScript
53	ManPage        // viewing man pages
54	Amber          // Amber templates
55	Bazel          // Bazel and Starlark
56	D              // D
57	Perl           // Perl
58	M4             // M4 macros
59)
60
61// String will return a short lowercase string representing the given editor mode
62func (mode Mode) String() string {
63	switch mode {
64	case Blank:
65		return "-"
66	case Git:
67		return "Git"
68	case Markdown:
69		return "Markdown"
70	case Makefile:
71		return "Make"
72	case Shell:
73		return "Shell"
74	case Config:
75		return "Configuration"
76	case Assembly:
77		return "Assembly"
78	case GoAssembly:
79		return "Go-style Assembly"
80	case Go:
81		return "Go"
82	case Haskell:
83		return "Haskell"
84	case OCaml:
85		return "Ocaml"
86	case StandardML:
87		return "Standard ML"
88	case Python:
89		return "Python"
90	case Text:
91		return "Text"
92	case CMake:
93		return "Cmake"
94	case Vim:
95		return "ViM"
96	case Clojure:
97		return "Clojure"
98	case Lisp:
99		return "Lisp"
100	case Zig:
101		return "Zig"
102	case Kotlin:
103		return "Kotlin"
104	case Java:
105		return "Java"
106	case HIDL:
107		return "HIDL"
108	case SQL:
109		return "SQL"
110	case Oak:
111		return "Oak"
112	case Rust:
113		return "Rust"
114	case Lua:
115		return "Lua"
116	case Crystal:
117		return "Crystal"
118	case Nim:
119		return "Nim"
120	case ObjectPascal:
121		return "Pas"
122	case Bat:
123		return "Bat"
124	case Cpp:
125		return "C++"
126	case C:
127		return "C"
128	case Ada:
129		return "Ada"
130	case HTML:
131		return "HTML"
132	case Odin:
133		return "Odin"
134	case Perl:
135		return "Perl"
136	case XML:
137		return "XML"
138	case PolicyLanguage:
139		return "SELinux"
140	case Nroff:
141		return "Nroff"
142	case Scala:
143		return "Scala"
144	case JSON:
145		return "JSON"
146	case Battlestar:
147		return "Battlestar"
148	case CS:
149		return "C#"
150	case TypeScript:
151		return "TypeScript"
152	case JavaScript:
153		return "JavaScript"
154	case ManPage:
155		return "Man"
156	case Amber:
157		return "Amber"
158	case Bazel:
159		return "Bazel"
160	case D:
161		return "D"
162	case V:
163		return "V"
164	case M4:
165		return "M4"
166	default:
167		return "?"
168	}
169}
170