Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Mode "enum" values Blank = iota Git // Git commits and interactive rebases Markdown // Markdown (and asciidoctor and rst files) Makefile // Makefiles Shell // Shell scripts and PKGBUILD files Config // Config like yaml, yml, toml, and ini files Assembly // Assembly GoAssembly // Go-style Assembly Go // Go Haskell // Haskell OCaml // OCaml StandardML // Standard ML Python // Python Text // plain text documents CMake // CMake files Vim // Vim or NeoVim configuration, or .vim scripts V // V programming language Clojure // Clojure Lisp // Common Lisp and Emacs Lisp Zig // Zig Kotlin // Kotlin Java // Java HIDL // the Android-related Hardware Abstraction Layer Interface Definition Language SQL // Structured Query Language Oak // Oak Rust // Rust Lua // Lua Crystal // Crystal Nim // Nim ObjectPascal // Object Pascal and Delphi Bat // DOS batch files Cpp // C++ C // C Ada // Ada HTML // HTML Odin // Odin XML // XML PolicyLanguage // SE Linux configuration files Nroff // editing man pages Scala // Scala JSON // JSON and iPython notebooks Battlestar // Battlestar CS // C# JavaScript // JavaScript TypeScript // TypeScript ManPage // viewing man pages Amber // Amber templates Bazel // Bazel and Starlark D // D Perl // Perl M4 // 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 ¶
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 DetectFromContents ¶ added in v0.1.0
DetectFromContents takes the first line of a file as a string, and a function that can return the entire contents of the file as a string, which will only be called if needed. Based on the contents, a Mode is detected and returned.
Click to show internal directories.
Click to hide internal directories.