Skip to content

Micro

In this example we will install Micro - a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the full capabilities of modern terminals. It comes as one single, batteries-included, static binary with no dependencies, and you can download and use it right now.

micro

Micro is a terminal-based application without a graphical user interface.

Info

Micro can be installed in any workspace. We will use Codeserver workspace v.4.0 in this example.

Install

To install Micro with Nix, execute the next command

$ nix-env -iA nixpkgs.micro

installing 'micro-2.0.11'
...
copying path '/nix/store/6f1vr3ar1rrz4dkbfsyprns33z6bf635-micro-2.0.11' from 'https://cache.nixos.org'...
building '/nix/store/ziffm6mfmqbbfq5ss7cb7ms2lr9ic92f-user-environment.drv'...

Explore

Let's clone Micro own repository and edit some of the files in it

$ git clone https://github.com/zyedidia/micro

Cloning into 'micro'...
remote: Enumerating objects: 18041, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 18041 (delta 2), reused 3 (delta 0), pack-reused 18032
Receiving objects: 100% (18041/18041), 12.26 MiB | 1.42 MiB/s, done.
Resolving deltas: 100% (12284/12284), done.

Go to the cloned directory, and use Micro to edit file snapcraft.yaml

$ cd micro   
08:01:32 with <font color="#FDEB61">abc</font> in <font color="#37E6E8">~p/micro</font> on <font color="#BC94B7">⇡master</font> <font color="#98E242">➜</font>    

$ micro snapcraft.yaml

Alias

It is not very convennient to type the whole word "micro" every time we want to use it. let's create a single-character alias to open files with Micro:

  • on the workspace UI go to the "Admin" tab, open "Workspace Settings" and go to "Aliases".
  • select "ADD NEW", enter m as short name, and micro as command. Click "Save".
  • open a new terminal window, go to the cloned repository folder again, and use m (instead of micro) to open the same file.
$ cd micro   
08:01:32 with <font color="#FDEB61">abc</font> in <font color="#37E6E8">~p/micro</font> on <font color="#BC94B7">⇡master</font> <font color="#98E242">➜</font>    

$ m snapcraft.yaml

Now we can quicly open and edit any file with a single-character command m.