Overview
This article introduces some other text editing tools in the terminal command line besides vi
Under the Ubuntu system, there is an editor nano, which is also installed by default and is relatively simple to use
There is a situation where there is no vi editor in the system. For example, in a docker container, you can use redirection and sed commands to change the direction to achieve some file modification functions. If the situation is complicated, you can also use docker cp
such commands to Copy the files on the host to the container
Recently I learned that there is a brand new terminal editor micro, https://github.com/zyedidia/micro/releases
which is written in Go language and can run on most Linux platforms. It only needs a binary file to realize file editing, support CTRL+C
, CTRL+V
copy and paste functions, Support mouse operation, friends in need can find out
nano
Simple to use, almost no learning cost yum install nano
micro
# 快速安装步骤
wget https://github.com/zyedidia/micro/releases/download/v2.0.2/micro-2.0.2-linux64-static.tar.gz
tar xf micro-2.0.2-linux64-static.tar.gz
cd micro-2.0.2
[root@node1 micro-2.0.2]# ls
LICENSE LICENSE-THIRD-PARTY micro README.md
./micro --help
./micro file.txt
[root@node1 micro-2.0.2]# ls -lht --full-time micro
-rwxrwxr-x 1 1461 1462 13M 2020-02-26 10:11:39.000000000 +0800 micro
[root@node1 micro-2.0.2]# file micro
micro: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
After personally experiencing the convenience of micro, especially when compared with vi, it is indeed a lot more convenient:
- Mouse directly controls cursor movement
- CTRL+A to select all, then press the backspace key to delete all
- CTRL+C CTRL+V copy and paste
- CTRL+S save
- No dependencies, single binary file runs directly
Almost the functions and shortcut keys of Windows Notepad, micro have
more help
官网
https://micro-editor.github.io/
github首页
https://github.com/zyedidia/micro
常用快捷键
https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md
"CtrlA": "SelectAll"
"CtrlS": "Save"
"CtrlZ": "Undo"
"CtrlY": "Redo"
"CtrlC": "Copy"
"CtrlX": "Cut"
"CtrlV": "Paste"
"CtrlF": "Find"
"CtrlN": "FindNext" 按一下回车
"CtrlP": "FindPrevious"
"Home": "StartOfLine"
"End": "EndOfLine"
"PageUp": "CursorPageUp"
"PageDown": "CursorPageDown"
"CtrlR": "ToggleRuler" 开关行号
"CtrlQ": "Quit" 退出
"CtrlK": "CutLine"
"CtrlD": "DuplicateLine"
busybox
busybox is a single file super program, built-in vi, please refer to http://xingyongsheng.top/containerization/xdocker/#busybox
emacs
installation
yum install emacs
Open a file
emacs hello.txt
save document
CTRL+x s
exit the program
CTRL+x CTRL+c
Other commonly used shortcut keys
下一页 CTRL+V
上一页 ESC+V
Reference
21 Best Open Source Text Editors (GUI + CLI) in 2019
https://www.tecmint.com/best-open-source-linux-text-editors/
https://www.gnu.org/software/emacs/download.html#gnu-linux
https://blog.csdn.net/tanmx219/article/details/86726544