editormode

package module
v0.0.1 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: 0

README

editormode

Select an editor mode based on a given filename

Documentation

Index

Constants

View Source
const (
	// Mode "enum" values
	ModeBlank          = iota
	ModeGit            // for git commits and interactive rebases
	ModeMarkdown       // for Markdown (and asciidoctor and rst files)
	ModeMakefile       // for Makefiles
	ModeShell          // for shell scripts and PKGBUILD files
	ModeConfig         // for yml, toml, and ini files etc
	ModeAssembly       // for Assembly
	ModeGoAssembly     // for Go-style Assembly
	ModeGo             // for Go
	ModeHaskell        // for Haskell
	ModeOCaml          // for OCaml
	ModeStandardML     // for Standard ML
	ModePython         // for Python
	ModeText           // for plain text documents
	ModeCMake          // for CMake files
	ModeVim            // for Vim or NeoVim configuration, or .vim scripts
	ModeV              // the V programming language
	ModeClojure        // for Clojure
	ModeLisp           // for Common Lisp and Emacs Lisp
	ModeZig            // for Zig
	ModeKotlin         // for Kotlin
	ModeJava           // for Java
	ModeHIDL           // for the Android-related Hardware Abstraction Layer Interface Definition Language
	ModeSQL            // for Structured Query Language
	ModeOak            // for Oak
	ModeRust           // for Rust
	ModeLua            // for Lua
	ModeCrystal        // for Crystal
	ModeNim            // for Nim
	ModeObjectPascal   // for Object Pascal and Delphi
	ModeBat            // for DOS batch files
	ModeCpp            // for C++
	ModeC              // for C
	ModeAda            // for Ada
	ModeHTML           // for HTML
	ModeOdin           // for Odin
	ModeXML            // for XML
	ModePolicyLanguage // for SE Linux configuration files
	ModeNroff          // for editing man pages
	ModeScala          // for Scala
	ModeJSON           // for JSON and iPython notebooks
	ModeBattlestar     // for Battlestar
	ModeCS             // for C#
	ModeJavaScript     // for JavaScript
	ModeTypeScript     // for TypeScript
	ModeManPage        // for viewing man pages
	ModeAmber          // for Amber templates
	ModeBazel          // for Bazel and Starlark
	ModeD              // for D
	ModePerl           // for Perl
	ModeM4             // 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