A modern and intuitive terminal-based text editor

Overview

micro logo

Build Status Go Report Card Release MIT License Join the chat at https://gitter.im/zyedidia/micro Snap Status

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals. It comes as a single, batteries-included, static binary with no dependencies; you can download and use it right now!

As its name indicates, micro aims to be somewhat of a successor to the nano editor by being easy to install and use. It strives to be enjoyable as a full-time editor for people who prefer to work in a terminal, or those who regularly edit files over SSH.

Here is a picture of micro editing its source code.

Screenshot

To see more screenshots of micro, showcasing some of the default color schemes, see here.

You can also check out the website for Micro at https://micro-editor.github.io.

Table of Contents


Features

  • Easy to use and install.
  • No dependencies or external files are needed — just the binary you can download further down the page.
  • Multiple cursors.
  • Common keybindings (Ctrl-s, Ctrl-c, Ctrl-v, Ctrl-z, …).
    • Keybindings can be rebound to your liking.
  • Sane defaults.
    • You shouldn't have to configure much out of the box (and it is extremely easy to configure).
  • Splits and tabs.
  • nano-like menu to help you remember the keybindings.
  • Extremely good mouse support.
    • This means mouse dragging to create a selection, double click to select by word, and triple click to select by line.
  • Cross-platform (it should work on all the platforms Go runs on).
    • Note that while Windows is supported Mingw/Cygwin is not (see below).
  • Plugin system (plugins are written in Lua).
    • micro has a built-in plugin manager to automatically install, remove, and update plugins.
  • Built-in diff gutter.
  • Simple autocompletion.
  • Persistent undo.
  • Automatic linting and error notifications.
  • Syntax highlighting for over 130 languages.
  • Color scheme support.
    • By default, micro comes with 16, 256, and true color themes.
  • True color support (set the MICRO_TRUECOLOR environment variable to 1 to enable it).
  • Copy and paste with the system clipboard.
  • Small and simple.
  • Easily configurable.
  • Macros.
  • Common editor features such as undo/redo, line numbers, Unicode support, soft wrapping, …

Installation

To install micro, you can download a prebuilt binary, or you can build it from source.

If you want more information about ways to install micro, see this wiki page.

Use micro -version to get the version information after installing. It is only guaranteed that you are installing the most recent stable version if you install from the prebuilt binaries, Homebrew, or Snap.

A desktop entry file and man page can be found in the assets/packaging directory.

Prebuilt binaries

All you need to install micro is one file, the binary itself. It's as simple as that!

Download the binary from the releases page.

Installation script

There is a script which can install micro for you by downloading the latest prebuilt binary. You can find it at https://getmic.ro.

You can easily install micro by running

curl https://getmic.ro | bash

The script will place the micro binary in the current directory. From there, you can move it to a directory on your path of your choosing (e.g. sudo mv micro /usr/bin). See its GitHub repository for more information.

To uninstall micro, simply remove the binary, and the configuration directory at ~/.config/micro.

Package managers

You can install micro using Homebrew on Mac:

brew install micro

Note for Mac: All micro keybindings use the control or alt (option) key, not the command key. By default, macOS terminals do not forward alt key events. To fix this, please see the section on macOS terminals further below.

On Linux, you can install micro through snap

snap install micro --classic

Note for Linux: for interfacing with the local system clipboard, xclip or xsel must be installed. Please see the section on Linux clipboard support further below.

Micro is also available through other package managers on Linux such as apt, dnf, AUR, Nix, and package managers for other operating systems. These packages are not guaranteed to be up-to-date.

  • Linux: Available in distro-specific package managers.
    • apt install micro (Ubuntu 20.04 focal, and Debian unstable | testing | buster-backports). At the moment, this package (2.0.1-1) is outdated and has a known bug where debug mode is enabled.
    • dnf install micro (Fedora).
    • pacman -S micro (Arch Linux).
    • eopkg install micro (Solus).
    • See wiki for details about CRUX, Termux.
  • Windows: Chocolatey and Scoop.
    • choco install micro.
    • scoop install micro.
  • OpenBSD: Available in the ports tree and also available as a binary package.
    • pkd_add -v micro.
  • NetBSD, macOS, Linux, Illumos, etc. with pkgsrc-current:
    • pkg_add micro

Building from source

If your operating system does not have a binary release, but does run Go, you can build from source.

Make sure that you have Go version 1.11 or greater and Go modules are enabled.

git clone https://github.com/zyedidia/micro
cd micro
make build
sudo mv micro /usr/local/bin # optional

The binary will be placed in the current directory and can be moved to anywhere you like (for example /usr/local/bin).

The command make install will install the binary to $GOPATH/bin or $GOBIN.

You can install directly with go get (go get github.com/zyedidia/micro/cmd/micro) but this isn't recommended because it doesn't build micro with version information (necessary for the plugin manager), and doesn't disable debug mode.

Fully static binary

By default, the micro binary will dynamically link with core system libraries (this is generally recommended for security and portability). However, there is a fully static prebuilt binary that is provided for amd64 as linux-static.tar.gz, and to build a fully static binary from source, run

CGO_ENABLED=0 make build

macOS terminal

If you are using macOS, you should consider using iTerm2 instead of the default terminal (Terminal.app). The iTerm2 terminal has much better mouse support as well as better handling of key events. For best keybinding behavior, choose xterm defaults under Preferences->Profiles->Keys->Presets..., and select Esc+ for Left Option Key in the same menu. The newest versions also support true color.

If you still insist on using the default Mac terminal, be sure to set Use Option key as Meta key under Preferences->Profiles->Keyboard to use option as alt.

Linux clipboard support

On Linux, clipboard support requires:

  • On X11, the xclip or xsel commands (for Ubuntu: sudo apt install xclip)
  • On Wayland, the wl-clipboard command

If you don't have these commands, micro will use an internal clipboard for copy and paste, but it won't work with external applications.

Colors and syntax highlighting

If you open micro and it doesn't seem like syntax highlighting is working, this is probably because you are using a terminal which does not support 256 color mode. Try changing the color scheme to simple by pressing Ctrl-e in micro and typing set colorscheme simple.

If you are using the default Ubuntu terminal, to enable 256 make sure your TERM variable is set to xterm-256color.

Many of the Windows terminals don't support more than 16 colors, which means that micro's default color scheme won't look very good. You can either set the color scheme to simple, or download and configure a better terminal emulator than the Windows default.

Cygwin, Mingw, Plan9

Cygwin, Mingw, and Plan9 are unfortunately not officially supported. In Cygwin and Mingw, micro will often work when run using the winpty utility:

winpty micro.exe ...

Micro uses the amazing tcell library, but this means that micro is restricted to the platforms tcell supports. As a result, micro does not support Plan9, and Cygwin (although this may change in the future). Micro also doesn't support NaCl (which is deprecated anyway).

Usage

Once you have built the editor, start it by running micro path/to/file.txt or micro to open an empty buffer.

micro also supports creating buffers from stdin:

ifconfig | micro

You can move the cursor around with the arrow keys and mouse.

You can also use the mouse to manipulate the text. Simply clicking and dragging will select text. You can also double click to enable word selection, and triple click to enable line selection.

Documentation and Help

micro has a built-in help system which you can access by pressing Ctrl-e and typing help. Additionally, you can view the help files here:

I also recommend reading the tutorial for a brief introduction to the more powerful configuration features micro offers.

Contributing

If you find any bugs, please report them! I am also happy to accept pull requests from anyone.

You can use the GitHub issue tracker to report bugs, ask questions, or suggest new features.

For a more informal setting to discuss the editor, you can join the Gitter chat.

Sometimes I am unresponsive, and I apologize! If that happens, please ping me.

Issues
  • Add to apt

    Add to apt

    It would be more convenient to install micro on servers if you could just run apt-get install micro.

    opened by carlmjohnson 92
  • Escape sequences written on mouse movement

    Escape sequences written on mouse movement

    When I ssh into an AWS EC2 instance and use micro, mouse movement inserts nonsense text. Here is a sample: [email protected]@N"][[email protected]"][MCH"MC2!&!MC3!<"[MC+MCC+9)MC=#MCe&[MCo'[MCo" Usually, that terminal will freeze after a little of this - sometimes as little as 20 characters, sometimes over 100. I can kill micro from a separate process, but then that frozen terminal keeps inserting mangled control codes for all mouse movement and ignores any keyboard input - even after the ssh session is killed. Normally, I'd say this has to be a terminal emulator bug, but the same happens in both Terminator and Xfce Terminal. I couldn't reproduce it with joe, another console editor with mouse support.

    I've reproduced this with ssh -X, -x, and -Y. It happens on both the EC2 instance itself and a docker container (see Dockerfile below) running on that instance. It does NOT happen on localhost, even when ssh'ing into a docker container running on localhost.

    Commit hash: dd5afc0 (v1.3.1 release) OS: Ubuntu 16.04 Terminal: Terminator, Xfce Terminal

    $ cat Dockerfile FROM ubuntu:16.04

    RUN useradd ted RUN echo 'ted:<appropriate stuff from /etc/shadow>' | chpasswd -e RUN usermod -a -G sudo ted RUN mkdir /var/run/sshd RUN mkdir /home/ted RUN chown -R ted /home/ted RUN apt-get update

    RUN apt-get install -y openssh-server EXPOSE 22 CMD ["/usr/sbin/sshd", "-D"]

    Once inside the container, download and unpack micro, invoke it with no arguments, then move the mouse.

    bug 
    opened by TedSinger 80
  • copy paste doesn't work well

    copy paste doesn't work well

    Hello, I like where micro is going. It's truly the commandline text editor I've been looking forward to.

    Any, so far copy and paste doesn't work. I copy text, but it won't paste elsewhere even though I already installed xclip on my Ubuntu 14.04 LTS. Also I noticed its a lot slower than say vim.

    opened by oquidave 50
  • Added autocomplete for Go, based on gocode, fixes #174

    Added autocomplete for Go, based on gocode, fixes #174

    Adds autocompletion for Go as a feature (disabled by default, but can be enabled in settings).

    To enable

    press CtrlE to go to command mode, and enter setlocal autocomplete true. This will enable autocomplete for the file until closed (the setting will not persist).

    Requirements

    Must have gocode installed and available on the path.

    Features

    • Triggered by . or ( characters.
    • Allows use of arrow keys to select item.
    • Press enter or tab to accept a selection.
    • Press escape to hide the list.

    Other language support

    Support for other languages can be added by accessing the properties and methods from plugins (see plugins.md) or by adding support within micro by:

    • Creating a function which has the OptionProvider signature (the function accepts the contents of the file and the byte offset within that file).
    type OptionProvider func(buffer []byte, offset int) (options []optionprovider.Option, err error)
    
    • Updating the NewCompleterForView function to choose the correct completion function based on the filename or other aspects of the file, e.g. the Go implementation simply checks for a .go file extension.
    // Load the provider based on filename.
    fileName := v.Buf.GetName()
    if strings.HasSuffix(fileName, ".go") {
    	provider = optionprovider.GoCode
    }
    
    opened by a-h 44
  • Added V syntax support

    Added V syntax support

    V is a new general purpose language, inspired mainly by Go, Rust, Pascal and C. Main site: https://vlang.io/ Github: https://github.com/vlang/v

    opened by spytheman 38
  • Multiple cursor support

    Multiple cursor support

    After using sublime and atom I can't go back to not having multiple cursor support. Any plans to introduce this into micro? Even just select all and select next would be amazing as that covers 90% of my usage.

    enhancement 
    opened by montanaflynn 33
  • Keybindings mostly not working

    Keybindings mostly not working

    Description of the problem or steps to reproduce

    • [x] alt+left/right does not select
    • [x] binding "Shift-Backspace": "DeleteWordLeft", does not work
    • [x] one can not rebind ctrl+e ?
    • [x] is there any Keybinding possible to swap the current line one up/ down (also works with selections in sublime using ctrl up+down)?
    • [x] creating keybidnings for plugins is confusing, I wanted to create one for snippets but snippets.snippetinsert and variants do not work, instead one has to look into the source and use snippet.Insert which is not documented or intuitive based on the ctrl+e command

    Specifications

    Version: 1.3.4 Commit hash: 5fc8f84 Compiled on November 25, 2017

    Commit hash: OS: macOS 10.13.2 Terminal: Terminal

    the editor is generally really a nice improvement upon nano

    thanks

    opened by ghost 32
  • terminal entry not found

    terminal entry not found

    When I run micro regardless of input, I get terminal entry not found and the process exits. I'm using zsh inside tmux in iterm without the tmux/iterm integration stuff, which may be confusing isatty?

    bug tcell issue 
    opened by hughrawlinson 30
  • Ctrl-v to paste not working

    Ctrl-v to paste not working

    @jsyedidia ctrl-v to paste is not working in latest version..however cutting a line (ctrl-k) then undoing that cut, make its work again, this is a bug, it is repeatable/reproducable.

    After a lot more testing, seems ctrl-x and ctrl-k work just fine and I can still paste with ctrl-v, but ctrl-c is dead.

    I should mention that whan pasting (ctrl-v) micro still displays the message at the bottom " Pasted clipboard" but does NOT actually paste anything.

    its really quite strange even after doing a ctrl-c, ctrl-v only pastes what was previously cut with ctrl-x or ctrl-k and not what I copied with ctrl-c

    Commit hash: b9763856 OS: MacOS Catalina Terminal: iTerm2 latest beta Micro Version: 2.0.10

    opened by drewauff 30
  • No syntax highlighting for .bat (batch) files

    No syntax highlighting for .bat (batch) files

    No syntax highlighting for Windows batch files, seems like this is overlooked

    image

    opened by StewAlexander-com 29
  • Option for scroll value moving more than one line to aid Braille readers

    Option for scroll value moving more than one line to aid Braille readers

    Description of the problem or steps to reproduce

    This is a request for an optional feature to aid use for blind people using multiline Braille displays

    On multiline line refreshable Braille displays, moving up and down by only one line causes excessive refreshing, whereas moving up and down by X (say 9) lines reduces the number of full pages refreshes.

    At the moment, when the user gets to the end of the terminal window it moves up by one line. This causes refreshable Braille displays to refresh the entire display every time someone writes a new line or the line overflows, i.e. all the time. It is noisy and takes time and makes writing with Micro on a multiline Braille display impossible.

    However if there were the option to define how many lines it moves up by when the user reaches the end then this effect would be reduced. For example if the user could choose to move up by seven lines then the multiline Braille display would only have to refresh one line (not the whole page) for every line written, except for once in every seven lines written.

    Possible syntax:

    micro -scrolllines 7

    (scrolllines defaults to 1)

    Please note I am referring to use using the Canute 360.

    Specifications

    Version: 2.0.10 Commit hash: b9763856 OS: Raspian Terminal: xfce4-terminal

    opened by pachpict 0
  • Adjust default keybinding text

    Adjust default keybinding text

    Fixes #2287

    • Also added a bit of consistency with wording and layout (Ctrl vs ctrl, + to separate modifier and key)
    • And some EOL whitespace apparently :P
    opened by chessmango 0
  • add nimble filetype , add more types, add documentation comments (##[)

    add nimble filetype , add more types, add documentation comments (##[)

    • add nimble filetype : nimble filetype wasnt detected and has been added.

    • add more types: add more nim typed that werent present; including common exception names

    • add documentation comments (##[): only comments were added (# and #[]# ), which dosent include documentation comments. this also fixes regular comments ( # ) at col 1, to not been grayed out.

    opened by antonl05 0
  • feature request: vertical ruler

    feature request: vertical ruler

    Just a common ruler with customizable limit to show maximum line length for your language.

    opened by swats-the-floran 1
  • Markdown parsing for `**styles**` interrupted after open-bracket `(`.

    Markdown parsing for `**styles**` interrupted after open-bracket `(`.

    Description of the problem or steps to reproduce

    1. Open new tab in micro
    2. Save as markdown (myFile.md)
    3. Type This is **bold** and highlighted - but (**this is not**). The parens interrupt parsing.

    Specifications

    Version 2.0.8 sudo apt get install -y micro

    Commit hash: N/A OS: Pop OS 21.04 Terminal: ZSH

    opened by williamflynt 0
  • Key Binding with command:term crasht

    Key Binding with command:term crasht

    In my bindings.json I'm setting

     {
         "Ctrl-p": "command:hsplit,command:term,NextSplit,NextSplit"
     }
    

    executing the binding triggers the following error message:

    Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
    runtime/panic.go:212 (0x559c6c5d4733)
    runtime/panic.go:211 (0x559c6c5d45b3)
    github.com/zyedidia/micro/internal/action/bufpane.go:137 (0x559c6caf4b9b)
    github.com/zyedidia/micro/internal/action/bufpane.go:26 (0x559c6caf48a2)
    github.com/zyedidia/micro/internal/action/bufpane.go:435 (0x559c6cae0864)
    github.com/zyedidia/micro/internal/action/bufpane.go:352 (0x559c6cae05db)
    github.com/zyedidia/micro/internal/action/tab.go:254 (0x559c6caf1870)
    github.com/zyedidia/micro/internal/action/tab.go:136 (0x559c6caf0fa5)
    github.com/zyedidia/micro/cmd/micro/micro.go:431 (0x559c6cb1912c)
    github.com/zyedidia/micro/cmd/micro/micro.go:386 (0x559c6cb18b5e)
    runtime/proc.go:204 (0x559c6c5c1089)
    runtime/asm_amd64.s:1374 (0x559c6c5f4981)
     
    If you can reproduce this error, please report it at https://github.com/zyedidia/micro/issues
    

    Thanks.

    • OS: Linux Debian/11
    • Term: tilix
    • micro version: 2.0.8
    opened by trixam 0
  • There's a typo in the Keybindings help documentation

    There's a typo in the Keybindings help documentation

    Description of the problem or steps to reproduce

    Lines 17-19 of the in-app help documentation for keybindings state:

    You can use the alt keys + arrows to move word by word. Ctrl left and right move the cursor to the start and end of the line, and ctrl up and down move the cursor the start and end of the buffer.

    This is the contrary for me. The alt keys move to the start and end of the line. The ctrl keys move word by word.

    Specifications

    Commit hash: 2.0.8 OS: Debian 11, Gnome 3.38.5 Terminal: Alacritty 0.10.0-dev

    opened by Pound-Hash 0
  • Add Contributor Docs

    Add Contributor Docs

    For both contributors and those looking to understand and/or reuse parts of micro, I think some documentation on how the codebase is structured, what the style guidelines are, etc. If this information is already available I apologize, however in that case I think a more clear link to where it is located would be helpful.

    opened by namespace-miata 0
  • ADD README Chinese Translation

    ADD README Chinese Translation

    Help Chinese users learn how to use Micro

    opened by yi0322 0
  • comment should start at the beginning of the line

    comment should start at the beginning of the line

    Description of the problem or steps to reproduce

    when using the comment plugin, the comment character should be at the beginning of the line and not in front of the first word, this way it is more readable what is commented.

    Specifications

    Micro version: 2.0.10 Commit hash: b9763856 OS: Arch comment plugin version: 1.0.0 Terminal: Tilix 1.9.4

    opened by Spindyckx 6
Releases(v2.0.10)
The new home of the CUE language! Validate and define text-based and dynamic configuration

The CUE Data Constraint Language Configure, Unify, Execute CUE is an open source data constraint language which aims to simplify tasks involving defin

null 1.3k Dec 3, 2021
A modern programming language written in Golang.

MangoScript A modern programming language written in Golang. Here is what I want MangoScript to look like: struct Rectangle { width: number he

PlebusSupremus1234 3 Nov 12, 2021
A minimalist Go PDF writer in 1982 lines. Draws text, images and shapes. Helps understand the PDF format. Used in production for reports.

one-file-pdf - A minimalist PDF generator in <2K lines and 1 file The main idea behind this project was: "How small can I make a PDF generator for it

Ali Bala 434 Nov 29, 2021
Enrich `go test` outputs with text decorations.

richgo Rich-Go will enrich go test outputs with text decorations Installation (go get): go get -u github.com/kyoh86/richgo (homebrew): brew tap kyoh8

Kyoichiro Yamada 632 Dec 1, 2021
Flow-based and dataflow programming library for Go (golang)

GoFlow - Dataflow and Flow-based programming library for Go (golang) Status of this branch (WIP) Warning: you are currently on v1 branch of GoFlow. v1

Vladimir Sibirov 1.3k Nov 25, 2021
GObject-introspection based bindings generator

WARNING! This project is no longer maintained. Probably doesn't even compile. GObject-introspection based bindings generator for Go. Work in progress

null 46 Feb 11, 2021
Yubigo is a Yubikey client API library that provides an easy way to integrate the Yubico Yubikey into your existing Go-based user authentication infrastructure.

yubigo Yubigo is a Yubikey client API library that provides an easy way to integrate the Yubikey into any Go application. Installation Installation is

Geert-Johan Riemer 117 Nov 17, 2021
A Go based HTTP Botnet

Second interation of GoBot, https://github.com/SaturnsVoid/GoBot2 GoBot GoBot is a project i am working on as i learn Go. GoBot is a PoC(Proof of Conc

Adam 103 Jul 19, 2021
Generate spreadsheets based on GitHub contributions

pullsheet generates a CSV (comma separated values) & HTML output about GitHub activity across a series of repositories.

Google 42 Nov 28, 2021
Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

The Moby Project Moby is an open-source project created by Docker to enable and accelerate software containerization. It provides a "Lego set" of tool

Moby 61.7k Dec 6, 2021
Experimental code execution microservice based on Docker containers.

ranna ランナー - Experimental code runner microservice based on Docker containers. ⚠ PLEASE READ BEFORE USE First of all, this project is currently work i

ranna 18 Oct 25, 2021
Scaffolding tool for golang based services

Scaffolding tool for golang based services

Praveen Penumaka 2 Oct 30, 2021
Examples on different options for implementing Flow Based Programming

Flow Based Programming This repository contains fragments and ideas related to Flow Based Programming. It shows different ways of implementing differe

Egon Elbre 9 Nov 19, 2021
An effective time-series data compression/decompression method based on Facebook's Gorilla.

Gorilla This package provides the effective time-series data compression method based on Facebook's Gorilla.. In a nutshell, it uses delta-of-delta ti

Keisuke Umegaki 42 Oct 31, 2021
A languge based on LISP syntax, NOT strictly lisp

Lisp-Interpreter A languge based on LISP syntax, NOT strictly lisp, I changed some things that in my opinion make the language more useable, this was

Leo De Silva 2 Nov 23, 2021
The kprobe package allows construction of dynamic struct based on kprobe event format descriptions.

The kprobe package allows construction of dynamic struct based on kprobe event format descriptions.

Dan Kortschak 4 Oct 27, 2021
Go 1.18 Generics based slice package

The missing slice package A Go-generics (Go 1.18) based functional library with no side-effects that adds the following functions to a slice package:

Steven Soroka 5 Nov 16, 2021
Multi-cluster api gateway based on apiserver-aggregation.

Cluster Gateway "Cluster-Gateway" is a gateway apiserver for routing kubernetes api traffic to multiple kubernetes clusters. Additionally, the gateway

Open Application Model 17 Dec 1, 2021
INCC calculator based on monthly rates.

inccCalc INCC calculator based on monthly rates. inccCalc version 1.0. Type 'help' for help, 'stop' to end the program. -help -stop -version -calc 'ca

ooshowa_ 0 Oct 29, 2021