mode

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2021 License: BSD-3-Clause Imports: 2 Imported by: 9

README

editormode

Select an editor mode based on a given filename

Documentation

Index

Constants

View Source
const (
	// Mode "enum" values
	Blank          = iota
	Git            // for git commits and interactive rebases
	Markdown       // for Markdown (and asciidoctor and rst files)
	Makefile       // for Makefiles
	Shell          // for shell scripts and PKGBUILD files
	Config         // for yml, toml, and ini files etc
	Assembly       // for Assembly
	GoAssembly     // for Go-style Assembly
	Go             // for Go
	Haskell        // for Haskell
	OCaml          // for OCaml
	StandardML     // for Standard ML
	Python         // for Python
	Text           // for plain text documents
	CMake          // for CMake files
	Vim            // for Vim or NeoVim configuration, or .vim scripts
	V              // the V programming language
	Clojure        // for Clojure
	Lisp           // for Common Lisp and Emacs Lisp
	Zig            // for Zig
	Kotlin         // for Kotlin
	Java           // for Java
	HIDL           // for the Android-related Hardware Abstraction Layer Interface Definition Language
	SQL            // for Structured Query Language
	Oak            // for Oak
	Rust           // for Rust
	Lua            // for Lua
	Crystal        // for Crystal
	Nim            // for Nim
	ObjectPascal   // for Object Pascal and Delphi
	Bat            // for DOS batch files
	Cpp            // for C++
	C              // for C
	Ada            // for Ada
	HTML           // for HTML
	Odin           // for Odin
	XML            // for XML
	PolicyLanguage // for SE Linux configuration files
	Nroff          // for editing man pages
	Scala          // for Scala
	JSON           // for JSON and iPython notebooks
	Battlestar     // for Battlestar
	CS             // for C#
	JavaScript     // for JavaScript
	TypeScript     // for TypeScript
	ManPage        // for viewing man pages
	Amber          // for Amber templates
	Bazel          // for Bazel and Starlark
	D              // for D
	Perl           // for Perl
	M4             // for M4 macros
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int

Mode is a per-filetype mode, like for Markdown

func Detect

func Detect(filename string) (Mode, bool)

Detect looks at the filename and tries to guess what could be an appropriate editor mode. This mainly affects syntax highlighting (which can be toggled with ctrl-t) and indentation.

func (Mode) String

func (mode Mode) String() string

String will return a short lowercase string representing the given editor mode

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL