If you are tired of Vi and Vim's strange interface and cumbersome key bindings, why not try the Micro editor?
The command line text editor proves the usefulness of the Linux terminal, allowing you to edit files without leaving the terminal. These editors use fewer resources and are very fast, making them perfect for some quick edits.
Some popular command line text editors include Vi, Vim, and Nano. They come pre-installed on most Linux distributions. However, for beginners, learning Vi or Vim's curves and keybindings can be somewhat difficult. At this time, Micro text editor becomes an easier choice.
Micro claims to be a modern and intuitive terminal-based text editor, and rightly so. Micro's main advantage over the likes of Vi or Vim is simplicity. Vim is not for the faint of heart and requires you to learn all the different modes and keybindings.
Although Vim is worth learning and mastering, it can be overwhelming for beginners. The Nano is relatively simple to use, but still falls short of the simplicity of the Micro. Take saving a file as an example. With Nano, you need to pressCtrl/Cmd O, which is usually a shortcut for opening files in popular word processors like Microsoft Word. Not very intuitive!
With Micro, saving a file is as easy as pressingCtrl/Cmd S, a keyboard shortcut you're probably already used to. Even if you've never used a terminal-based text editor, you'll feel right at home using Micro. However, that's not all. It has its own set of features that further enrich the user experience.
In addition to being simple and easy to use, Micro is not shy about adding some useful features. Let's look at these in detail.
By default, Micro comes with some key bindings similar to those on popular word processors. But as an advanced user, you can customize these bindings to your liking and configure them the way you want.
One of the features missing from most command line text editors is mouse and trackpad support. With Micro, you don't have to worry. You can click and drag to select text, double-click to select words, and triple-click to select lines.
Micro supports syntax highlighting for more than 130 programming languages, including popular languages such as JavaScript, Python, and C. In addition to this, you can choose your theme from seven available default color schemes.
Don't like the existing themes? You can even make your own theme to use with Micro.
Similar to Sublime Text’s multi-cursor functionality, you can also use Micro to edit multiple instances of the same word. Additionally, you can split the editor horizontally and vertically to view and edit multiple files at once.
To go further, you can add plugins to Micro and enhance the editor. You can view all available plug-ins from the Plugins page of the Micro Text Editor website. It comes with six default plugins for automatically closing brackets and quotes, inspecting code, and more.
With Micro, you can run an interactive shell within the editor itself. This is especially useful when you want to split the editor in half, with the code on one side and the shell's output display on the other.
Installing the Micro editor is simple and straightforward. You can choose any of several installation methods depending on the Linux distribution you are running. You can download the latest pre-built binaries for all distributions using:
rumenz.com@rumenz.com /home/rumenz.com/www.rumenz.com.com ⚡curl https://getmic.ro | bash
For distributions such as Ubuntu that support snap packages, you can install Micro's snap variant using the following command:
rumenz.com@rumenz.com /home/rumenz.com/www.rumenz.com.com ⚡ snap install micro --classic
If you don't likesnaporcurl, you can download the pre-builtDEBbinaries from thereleases page and install them on Debian-based Linux on the release version.
To get clipboard support, you need to install the xclip and xsel packages. In Ubuntu and other Ubuntu-based Linux distributions, you can install it using the following command:
rumenz.com@rumenz.com /home/rumenz.com/www.rumenz.com.com ⚡ sudo apt install xclip
现在您已经安装了 Micro,是时候熟悉它的使用了。为此,您可以尝试使用 Micro 创建一个新的文本文件,编辑它,找到一个词,并在完成后保存文件。要启动 Micro,请运行以下命令:
⚡ micro rumenz.txt
这将创建一个名为rumenz的新文本文件,扩展名为TXT。要打开现有文件而不是创建新文件,你可以将命令中的rumenz.txt替换为你需要的文件名和扩展名。
运行命令时,Micro 将使用传统的文本编辑器界面迎接您。由于您创建了一个新文件,因此该文件的内容将为空白。继续添加一两句话以熟悉界面。
您可以分别使用 Ctrl/Cmd + Z和Ctrl/Cmd+ Y撤消和重做您的操作 ,就像您在文字处理器中所做的那样。要查找单词,您可以使用Ctrl + F快捷键。
最后,您可以使用 Ctrl/Cmd+ S快捷方式 保存文本文件, 并使用Ctrl/Cmd+ Q快捷方式退出 Micro。
如果 Micro 不是您想要的并且您不再需要它,您可以通过 从**/usr/bin** 目录中删除micro可执行文件来 轻松卸载它。
sudo rm /usr/bin/micro
但是,如果您使用 snap 安装 Micro,则必须使用以下命令将其卸载:
sudo snap remove micro
如果您因为害怕而推迟使用命令行文本编辑器,那就试试 Micro。这是一个很好的工具,可以让您熟悉终端并在使用过程中获得更高效的体验。
The above is the detailed content of A more modern and intuitive Linux text editor than Vim. For more information, please follow other related articles on the PHP Chinese website!