Editor Series: micro A terminal-based text editor

Editor Series: micro A terminal-based text editor

2022-11-10 0 532
Resource Number 47843 Last Updated 2025-02-21
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

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!

Editor Series: micro A terminal-based text editor插图

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.

Editor Series: micro A terminal-based text editor插图1

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

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code Editor Series: micro A terminal-based text editor https://ictcoder.com/kyym/editor-series-micro-a-terminal-based-text-editor.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service