First, build and install the micro snap:
- sudo apt install git snapcraft
- git clone https://github.com/elopio/micro
- cd micro
- git checkout snapcraft
- snapcraft
- sudo snap install micro*.snap
Open the editor:
$ micro
Print the help:
Ctrl+e
> help
Close the help:
Ctrl+g
Save a file:
- Enter some $TEXT.
- Save the file with
Ctrl+s
. - Enter the $FILENAME.
- Press
Enter
. - Exit the editor with
Ctrl+q
. - Print the file contents with
cat $FILENAME
.- Verify that the $TEXT is printed.
Edit an exiting file:
- Create a file with
echo test > $HOME/test.micro
. - Open the file in the editor with `micro $HOME/test.micro``.
- Edit the file adding some lines with text.
- Save the file with
Ctrl+s
. - Exit the editor with
Ctrl+q
. - Print the file contents with
cat $HOME/test.micro
.- Verify that the original content and the added lines are printed.
Open a python file:
- Copy a python file to the home directory. (Because the snap is isolated and only has access to the home directory and it's own storage)
- Open the file with
micro $HOME/$FILENAME
.- Verify that the syntax is highlighted with different colors.
Use a plugin:
- Open micro with the
micro
command. - Enter
(
,{
and[
.- Verify that the closing symbol is automatically written.
Run a shell command:
- With the micro editor open, enter the command mode with
Ctrl+e
. - Enter
run snapcraft
.
Use the clipboard inside the editor:
- With the micro editor open and some text written, select a part of the text with the mouse.
- Enter
Ctrl+c
. - Move the cursor to a differet line in the editor.
- Enter
Ctrl+v
.- Verify that the selected text was pasted to the new line.
Use the clipboard from outside of the editor:
- With the micro editor open and some text wirtten, select a part of the text with the mouse.
- Enter
Ctrl+c
. - Open an editor with a graphical user interface, like
gedit
. - Enter
Ctrl+v
.- Verify that the selected text was pasted to the GUI editor.
Tested in a clean and up-to-date Ubuntu xenial virtual machine with kvm.
Some problems:
snapcraft exited with error: exec: not started:
It is being discussed in the mailing list how to securely give access to snaps to run other commands.