The micro recommended in this issue is a terminal-based text editor designed to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals. It is a single, battery-containing, static binary file with no dependencies; You can download and use it now!
As the name suggests, micro is intended to be the successor to the nano editor by being easy to install and use. It strives to be a full-time editor for people who like to work in a terminal or who often edit files over SSH.
This is a picture of microediting its source code.
micro feature
- Easy to use and install.
- No dependencies or external files are required – just binaries that you can download at the bottom of the page.
- Multiple cursors.
- Common key binding (Ctrl-s, Ctrl-c, Ctrl-v, Ctrl-z,…) . Key bindings can be reconfigured to suit your preferences.
- Sensible default. You don’t have to do much configuration out of the box (and it’s pretty easy to do).
- Split and TAB.
- Nanoma-like menus help you remember key bindings.
- Very good mouse support. This means mouse dragging to create a selection, double clicking to select by word, and three clicks to select by line.
- Cross-platform (it should work on all platforms on which Go runs). Please note that while Windows is supported, Mingw/Cygwin is not supported (see below).
- Plug-in system (plug-ins are written in Lua). micro has a built-in plugin manager to automatically install, remove, and update plugins.
- Built-in differential binding line.
- Simple automatic completion.
- Persistent undo.
- Automatic linting and error notification.
- Syntax highlights for more than 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 using the system Clipboard.
- Small and simple.
- Easy to configure.
- macro.
- Common editor features such as undo/redo, line numbers, Unicode support, flexible wrapping…
micro installation
To install micro, you can either download the pre-built binary or build it from source code.
If you want to learn more about how to install micro, see this wiki page.
Used to obtain the version information after installation. If you are installing from a pre-built binary, Homebrew, or Snap, you can only guarantee that you are installing the latest stable version.
Desktop entry files and man pages can be found in the assets/packaging directory.
Prebuilt binary
Prebuilt binaries are distributed with release.
To uninstall micro, just delete the binary file and ~/.config/micro.
Quick installation script
curl https://getmic.ro | bash
The script places the microbinaries in the current directory. From there, you can move it to a directory on the path of your choice (such as sudo mv micro /usr/bin).
Package manager
You can install micro on your Mac using Homebrew:
brew install micro
Mac note: All micro-key bindings use the control or alt (option) keys instead of the command key. By default, macOS terminals do not forward alt key events. To resolve this issue, see the section on macOS terminals below.
On Linux, you can install micro via snap
snap install micro --classic
Linux precautions: Used to interface with the local system clipboard, xclip or xsel must be installed.
Micro is also available through other package managers on Linux, such as dnf, AUR, Nix, and other operating systems. These packages are not guaranteed to be up to date.
Linux: available in a distribution-specific package manager.
- dnf install micro (Fedora).
- pacman -S micro (arch Linux).
- eopkg install micro (solution).
- For more information about CRUX, Termux, see wiki.
Window: Chocolate and Scoop.
- choco install micro.scoop install micro.
OpenBSD: available in the port tree or as a binary package.
- pkd_add -v micro.
NetBSD, macOS, Linux, Illumos, etc. Use pkgsrc-current:
- pkg_add micro
macOS with MacPorts:
- sudo port install micro
Build from the source
If your operating system doesn’t have a binary version but runs Go, you can build from source code.
Ensure that you have Go version 1.16 or later and that the Go module is 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 any location you like (for example, /usr/local/bin).
The command make install will install the binary to $GOPATH/bin or $GOBIN.
You can use go get(go get
Github.com/zyedidia/micro/cmd/micro) installed directly, but it is not recommended to do this, because it does not use the version information to build micro (necessary) plug-in manager, and will not disable debug mode.
Full static binary
By default, microbinaries dynamically link the core system library (this is generally recommended for security and portability). However, a fully static pre-built binary is provided for amd64 as, linux-static.tar.gz To build a fully static binary from source code, run
CGO_ENABLED=0 make build
Usage
After building the editor, start it by running micro path/to/file.txt or micro to open an empty buffer.
micro also supports creating buffer stdin from:
ifconfig | micro
You can use the arrow keys and mouse to move the cursor.
You can also use the mouse to manipulate the text. Simply click and drag to select text. You can also double click to enable word selection and triple click to enable line selection.
Command bar
Open the command bar by pressing Ctrl-e. It is a single-line buffer, which means that all key bindings (as well as mouse and selection) from regular buffers are supported.
When running a command, you can use additional syntax that micro will extend before running the command. To use a parameter with a space, put it in quotes. The command bar parser uses the same rules to parse the arguments that /bin/sh will use (single quotes, double quotes, escape). The command bar does not look for environment variables.
Micro provides the following commands, which can be executed in the command bar by pressing Ctrl-e and typing the command. The parameters are enclosed in single quotes here, but these are not required when entering commands in micro.
- bind ‘key’ ‘action’ : Creates a key binding from the key to the action. For more information about binding keys, see the keybindings documentation. This command will modify bindings.json and overwrite any bindings that the key already has.
- help ‘topic’? : Opens the appropriate help topic. If no theme is provided, the default help screen opens. The help topic is stored as a.md file in the directory of the runtime/help source tree, embedded in the final binary.
- save ‘filename’? : Saves the current buffer. If a file is provided, it will “save as” the file name.
- quit: quit the micro.
- goto ‘line’: Jump to the given line number. Negative numbers can be passed in to jump inwards from the end of the file; For example, -5 jumps to the fifth line from the bottom of the file.
- replace ‘search’ ‘value’ ‘flags’? : This will replace search with value. flags is optional. Possible signs are:
- -a: replaces all matches at once
- -l: do a text search instead of a regular expression search
- Note that search must be a valid regular expression (unless -l passes). If there are no Spaces in one of the arguments, the quotation marks can be omitted.
—END—
Open Source protocol: MIT license