package
1.4.1
Repository: https://github.com/zyedidia/micro.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

Abs is a simple absolute value function for ints.
AddOption creates a new option.
AddRuntimeFile registers a file for the given filetype.
AddRuntimeFilesFromAssets registers each file from the given asset-directory for the filetype which matches the file-pattern.
AddRuntimeFilesFromDirectory registers each file from the given directory for the filetype which matches the file-pattern.
Append efficiently appends lines together It allocates an additional 10000 lines if the original estimate is incorrect.
Asset loads and returns the asset for the given name.
AssetDir returns the file names below a certain directory embedded in the file by go-bindata.
AssetInfo loads and returns the asset info for the given name.
AssetNames returns the names of the assets.
BeginSearch starts a search.
Bind creates a new keybinding.
BindKey takes a key and an action and binds the two together.
ByteOffset is just like ToCharPos except it counts bytes instead of runes.
Call calls the lua function 'function' If it does not exist nothing happens, if there is an error, the error is returned.
Cd changes the current working directory.
ColorschemeComplete tab-completes names of colorschemes.
ColorschemeExists checks if a given colorscheme exists.
CommandAction returns a bindable function which executes the given command.
CommandComplete autocompletes commands.
CommandEditAction returns a bindable function that opens a prompt with the given string and executes the command when the user presses enter.
CommonSubstring gets a common substring among the inputs.
Contains returns whether or not a string array contains a given string.
Count returns the length of a string in runes This is exactly equivalent to utf8.RuneCountInString(), just less characters.
CurView returns the current view.
DefaultBindings returns a map containing micro's default keybindings.
DefaultCommands returns a map containing micro's default commands.
DefaultGlobalSettings returns the default global settings for micro Note that colorscheme is a global only option.
DefaultLocalSettings returns the default local settings Note that filetype is a local only option.
Diff returns the distance between two locations.
DisplayKeyMenu displays the nano-style key menu at the bottom of the screen.
DisplayTabs displays the tabbar at the top of the editor if there are multiple tabs.
EndSearch stops the current search.
EscapePath replaces every path separator in a given path with a %.
Eval evaluates a lua expression.
ExecCommand executes a command using exec It returns any output/errors.
ExecuteTextEvent runs a text event.
ExitSearch exits the search mode, reset active search phrase, and clear status bar.
FileComplete autocompletes filenames.
FindRuntimeFile finds a runtime file of the given filetype and name will return nil if no file was found.
FromCharPos converts from a character position to an x, y position.
FSize gets the size of a file.
FuncName returns the full name of a given function object.
GetAllPluginPackages gets all PluginPackages which may be available.
No description provided by the author
GetColor takes in a syntax group and returns the colorscheme's style for that group.
GetColor256 returns the tcell color for a number between 0 and 255.
GetGlobalOption returns the global value of the given option.
GetInstalledPluginVersion returns the string of the exported VERSION variable of a loaded plugin.
GetInstalledVersions returns a list of all currently installed plugins including an entry for micro itself.
GetLeadingWhitespace returns the leading whitespace of the given string.
GetLocalOption returns the local value of the given option.
GetModTime returns the last modification time for a given file It also returns a boolean if there was a problem accessing the file.
GetOption returns the value of the given option If there is a local version of the option, it returns that otherwise it will return the global version.
GetPathAndCursorPosition returns a filename without everything following a `:` This is used for opening files like util.go:10:5 to specify a line and column Special cases like Windows Absolute path (C:\myfile.txt:10:5) are handled correctly.
GlobalCall makes a call to a function in every plugin that is currently loaded.
HandleCommand handles input from the user.
HandleSearchEvent takes an event and a view and will do a real time match from the messenger's output to the current buffer.
HandleShellCommand runs the shell command The openTerm argument specifies whether a terminal should be opened (for viewing output or interacting with stdin).
Help tries to open the given help page in a horizontal split.
HelpComplete autocompletes help topics.
HSplit opens a horizontal split with file given in the first argument If no file is given, it opens an empty buffer in a new split.
Import allows a lua plugin to import a package.
InBounds returns whether the given location is a valid character position in the given buffer.
InitBindings initializes the keybindings for micro.
InitColorscheme picks and initializes the colorscheme when micro starts.
InitCommands initializes the default commands.
InitConfigDir finds the configuration directory for micro according to the XDG spec.
InitGlobalSettings initializes the options map and sets all options to their default values.
InitLocalSettings scans the json in settings.json and sets the options locally based on whether the buffer matches the glob.
InitRuntimeFiles initializes all assets file and the config directory.
InitScreen creates and initializes the tcell screen.
Insert makes a simple insert into a string at the given position.
IsSpaces checks if a given string is only spaces.
IsSpacesOrTabs checks if a given string contains only spaces and tabs.
IsStrWhitespace returns true if the given string is all whitespace.
IsWhitespace returns true if the given rune is a space, tab, or newline.
IsWordChar returns whether or not the string is a 'word character' If it is a unicode character, then it does not match Word characters are defined as [A-Za-z0-9_].
JobSend sends the given data into the job's stdin stream.
JobSpawn starts a process with args in the background with the given callbacks It returns an *exec.Cmd as the job id.
JobStart starts a shell command in the background with the given callbacks It returns an *exec.Cmd as the job id.
JobStop kills a job.
ListRuntimeFiles lists all known runtime files for the given filetype.
No description provided by the author
LoadColorscheme loads the given colorscheme from a directory.
LoadDefaultColorscheme loads the default colorscheme from $(configDir)/colorschemes.
LoadFile loads a lua file.
LoadInput determines which files should be loaded into buffers based on the input stored in flag.Args().
LoadPlugins loads the pre-installed plugins and the plugins located in ~/.config/micro/plugins.
No description provided by the author
No description provided by the author
LuaFunctionBinding is a function generator which takes the name of a lua function and creates a function that will call that lua function Specifically it creates a function that can be called as a binding because this is used to bind keys to lua functions.
LuaFunctionCommand is the same as LuaFunctionBinding except it returns a normal function so that a command can be bound to a lua function.
LuaFunctionComplete returns a function which can be used for autocomplete in plugins.
LuaFunctionJob returns a function that will call the given lua function structured as a job call i.e.
LuaFunctionMouseBinding is a function generator which takes the name of a lua function and creates a function that will call that lua function Specifically it creates a function that can be called as a mouse binding because this is used to bind mouse actions to lua functions.
MakeCommand is a function to easily create new commands This can be called by plugins in Lua so that plugins can define their own commands.
MakeCompletion registers a function from a plugin for autocomplete commands.
MakeRelative will attempt to make a relative path between path and base.
Max takes the max of two ints.
MemUsage prints micro's memory usage Alloc shows how many bytes are currently in use Sys shows how many bytes have been requested from the operating system NumGC shows how many times the GC has been run Note that Go commonly reserves more memory from the OS than is currently in-use/required Additionally, even if Go returns memory to the OS, the OS does not always claim it because there may be plenty of memory to spare.
Min takes the min of two ints.
MustAsset is like Asset but panics when Asset would return an error.
NewBuffer creates a new buffer from a given reader with a given path.
NewBufferFromFile opens a new buffer using the given path It will also automatically handle `~`, and line/column with filename:l:c It will return an empty buffer if the path does not exist and an error if the file is a directory.
NewBufferFromString creates a new buffer containing the given string.
NewEventHandler returns a new EventHandler.
NewLeafNode returns a new leaf node containing the given view.
NewLineArray returns a new line array from an array of bytes.
NewTab opens the given file in a new tab.
NewTabFromView creates a new tab and puts the given view in the tab.
NewView returns a new fullscreen view.
NewViewWidthHeight returns a new view with the specified width and height Note that w and h are raw column and row values.
NumOccurrences counts the number of occurrences of a byte in a string.
Open opens a new buffer with a given filename.
OptionComplete autocompletes options.
OptionValueComplete completes values for various options.
ParseBool is almost exactly like strconv.ParseBool, except it also accepts 'on' and 'off' as 'true' and 'false' respectively.
ParseColorscheme parses the text definition for a colorscheme and returns the corresponding object Colorschemes are made up of color-link statements linking a color group to a list of colors For example, color-link keyword (blue,red) makes all keywords have a blue foreground and red background.
No description provided by the author
PluginAddRuntimeFile adds a file to the runtime files for a plugin.
PluginAddRuntimeFileFromMemory adds a file to the runtime files for a plugin from a given string.
PluginAddRuntimeFilesFromDirectory adds files from a directory to the runtime files for a plugin.
PluginCmd installs, removes, updates, lists, or searches for given plugins.
PluginCmdComplete completes with possible choices for the `> plugin` command.
PluginComplete autocompletes from plugin function.
PluginListRuntimeFiles allows plugins to lists all runtime files of the given type.
PluginnameComplete completes with the names of loaded plugins.
PluginReadRuntimeFile allows plugin scripts to read the content of a runtime file.
PostActionCall executes the lua plugin callback if possible.
PreActionCall executes the lua pre callback if possible.
Pwd prints the current working directory.
Quit closes the main view.
Raw opens a new raw view which displays the escape sequences micro is receiving in real-time.
RedrawAll redraws everything -- all the views and the messenger.
Reload reloads all files (syntax files, colorschemes...).
Replace runs search and replace.
ReplaceAll replaces search term all at once.
ReplaceHome takes a path as input and replaces ~ at the start of the path with the user's home directory.
RestoreAsset restores an asset under the given directory.
RestoreAssets restores an asset under the given directory recursively.
Retab changes all spaces to tabs or all tabs to spaces depending on the user's settings.
Run runs a shell command in the background.
No description provided by the author
No description provided by the author
RunShellCommand executes a shell command and returns the output/error.
No description provided by the author
Save saves the buffer in the main view.
Search searches in the view for the given regex.
SearchPlugin retrieves a list of all PluginPackages which match the given search text and could be or are already installed.
Set sets an option.
SetLocal sets an option local to the buffer.
SetLocalOption sets the local version of this option.
SetOption attempts to set the given option to the value By default it will set the option as global, but if the option is local only it will set the local version Use setlocal to force an option to be set locally.
SetOptionAndSettings sets the given option and saves the option setting to the settings config file.
ShortFuncName returns the name only of a given function object.
Show shows the value of the given option.
ShowKey displays the action that a key is bound to.
ShowMultiCursor will display a cursor at a location If i == 0 then the terminal cursor will be used Otherwise a fake cursor will be drawn at the position.
Spaces returns a string with n spaces.
StringToColor returns a tcell color from a string representation of a color We accept either bright..
StringToStyle returns a style from a string The strings must be in the format "extra foregroundcolor,backgroundcolor" The 'extra' can be bold, reverse, or underline.
StringWidth returns the width of a string where tabs count as `tabsize` width.
TabbarHandleMouseEvent checks the given mouse event if it is clicking on the tabbar If it is it changes the current tab accordingly This function returns true if the tab is changed.
TabbarString returns the string that should be displayed in the tabbar It also returns a map containing which indicies correspond to which tab number This is useful when we know that the mouse click has occurred at an x location but need to know which tab that corresponds to to accurately change the tab.
TabSwitch switches to a given tab either by name or by number.
Term opens a terminal in the current view.
TermError sends an error to the user in the terminal.
TermMessage sends a message to the user in the terminal.
ToCharPos converts from an x, y position to a character position.
ToggleLog toggles the log view.
TryBindKey tries to bind a key by writing to configDir/bindings.json This function is unused for now.
UndoTextEvent undoes a text event.
UninstallPlugin deletes the plugin folder of the given plugin.
UpdatePlugins updates the given plugins.
VSplit opens a vertical split with file given in the first argument If no file is given, it opens an empty buffer in a new split.
WidthOfLargeRunes searches all the runes in a string and counts up all the widths of runes that have a width larger than 1 (this also counts tabs as `tabsize` width).
WriteSettings writes the settings to the specified filename as JSON.

# Constants

No description provided by the author
CorePluginName is a plugin dependency name for the micro core.
No description provided by the author
GutterError represents a compiler error.
GutterInfo represents a simple info message.
GutterWarning represents a compiler warning.
No description provided by the author
HorizontalSplit type.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TextEventInsert represents an insertion event.
TextEventRemove represents a deletion event.
TextEventReplace represents a replace event.
VerticalSplit type.
Finished running a command.
Waiting for a new command.
Currently running a command.

# Variables

CommitHash is the commit this version was built on.
CompileDate is the date this binary was compiled on.
No description provided by the author
Version is the version number or commit hash These variables should be set by the linker when compiling.

# Structs

Buffer stores the text for files that are loaded into the text editor It uses a rope to efficiently store the string and contains some simple functions for saving and wrapper functions for modifying the rope.
A CallbackFile is the data structure that makes it possible to catch stderr and stdout write events.
No description provided by the author
No description provided by the author
A Command contains a action (a function to call) as well as information about how to autocomplete the command.
The Cursor struct stores the location of the cursor in the view The complicated part about the cursor is storing its location.
A Delta is a change to the buffer.
An Element which is stored in the Stack.
EventHandler executes text manipulations and allows undoing and redoing.
A GutterMessage is a message displayed on the side of the editor.
JobFunction is a representation of a job (this data structure is what is loaded into the jobs channel).
The Key struct holds the data for a keypress (keycode + modifiers).
A LeafNode is an actual split so it contains a view.
A Line contains the data in bytes as well as a highlight state, match and a flag for whether the highlighting needs to be updated.
A LineArray simply stores and array of lines and makes it easy to insert and delete in it.
Loc stores a location.
Messenger is an object that makes it easy to send messages to the user and get input from the user.
PluginDependency descripes a dependency to another plugin or micro itself.
PluginPackage contains the meta-data of a plugin and all available versions.
PluginVersion descripes a version of a PluginPackage.
ScrollBar represents an optional scrollbar that can be used.
The SerializedBuffer holds the types that get serialized when a buffer is saved These are used for the savecursor and saveundo options.
A SplitTree is a Node itself and it contains other nodes.
Stack is a simple implementation of a LIFO stack for text events.
Statusline represents the information line at the bottom of each view It gives information such as filename, whether the file has been modified, filetype, cursor location.
A StrCommand is similar to a command but keeps the name of the action.
A Tab holds an array of views and a splitTree to determine how the views should be arranged.
A Terminal holds information for the terminal emulator.
TextEvent holds data for a manipulation on some text that can be undone.
The View struct stores information about a view into a buffer.
The ViewType defines what kind of view this is.

# Interfaces

A Node on the split tree.
RuntimeFile allows the program to read runtime data like colorschemes or syntax files.

# Type aliases

Colorscheme is a map from string to style -- it represents a colorscheme.
Completion represents a type of completion.
PluginChannel contains an url to a json list of PluginRepository.
PluginChannels is a slice of PluginChannel.
PluginDependencies is a slice of PluginDependency.
PluginPackages is a list of PluginPackage instances.
PluginRepository contains an url to json file containing PluginPackages.
PluginVersions is a slice of PluginVersion.
SplitType specifies whether a split is horizontal or vertical.