In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the emacs command of Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to use the emacs command of Linux.
Linux common command emacs command is a powerful full-screen text editor developed by Richard Stallman, the founder of GNU organization. It supports a variety of programming languages and has many excellent features. Many system administrators and software developers use emacs.
Syntax emacs (options) (parameters) option +: start the emacs editor and move the cursor to the line where the line number is set;-Q: start the emacs editor without loading the initialization file;-u: load the initialization file for the specified user when the emacs editor is started;-t: when the emacs editor is started, the specified file is used as the middle, and standard input (stdin) and standard output (stdout) are not applicable -f: execute the specified lisp (programming language widely used in artificial intelligence) function;-l: load the specified lisp code file;-batch: run the emacs editor in batch mode. Parameter file: specifies the text file to edit.
Examples make Emacs's modifier keys more meaningful on the PC keyboard, the Ctrl key is called the C _ MagneAlt key is called the M key, these keys are not C and M keys, and because they are always paired with the corresponding letter or symbol key, they are easily identified in the document.
For example, Cmurx means Ctrl+X,M-x is Alt+X in modern keyboard symbols. Just like when you cut text from any application, press both keys at the same time.
However, there is another level of keyboard shortcuts that are completely different from anything on a modern computer. Sometimes, keyboard shortcuts are not just a combination of keys, but a series of keys.
For example, Cmurx Cmurf means to press Ctrl+X as usual, and then press Ctrl+C.
Sometimes, a keyboard shortcut has a mixed key type. The key combination Cmurx 3 means pressing Ctrl+X as usual, and then pressing the number 3.
Emacs is able to make these gaudy and powerful combinations because some keys put Emacs into a special command mode. If you press Ctrl+X X, you tell Emacs to enter the idle state and wait for the second key or keyboard shortcut.
Emacs documentation, both official and unofficial, has many keyboard shortcuts. Practice translating C keys into Ctrl keys and M keys into Alt keys in your mind, and these documents will become more meaningful to you.
Alternative shortcuts to cut, copy, and paste from the specification, copying text is done through a series of keyboard shortcuts, depending on how you want to copy or cut.
For example, you can cut an entire word with Mmurd (Alt+d 's Emacs jargon), or cut an entire line with Clyk (Ctrl+K), or cut a highlighted area with Mmurm (Alt+M). You can get used to it if you want, but if you like Ctrl+C and Ctrl+X and Ctrl-V, you can use these instead.
Enabling modern cut-copy-paste requires activating a feature called CUA (Universal user access (Common User Access)). To activate CUA, click the options menu and select use CUA key. When enabled, Cmurc copies the highlighted text, Cmurx cuts the highlighted text, and Cmurv pastes the text. This mode is not actually activated until you have selected the text, so you can still learn the Cmurx and Cmurc bindings commonly used by Emacs.
Either way Emacs is an application that doesn't realize your feelings or loyalty to it. If you want to use only Emacs to accomplish tasks that "feel" right for Emacs, and use different editors (such as Vim) to accomplish other tasks, you can do so.
Your interaction with an application can affect the way you work, so if the keystroke mode required in Emacs is not consistent with a particular task, don't force yourself to use Emacs to accomplish that task. Emacs is just one of many open source tools available to you, and there is no reason to limit yourself to one tool.
Most of the work that Emacs does to explore new features is an elisp function that can be called from menu selections and keyboard shortcuts, or in some cases from specific events. All functions can be executed from the mini-buffer (the command line at the bottom of the Emacs framework). In theory, you can even navigate the cursor by typing functions such as forward-word and backward-word and next-line and previous-line. This is certainly extremely inefficient, but this is a way to directly access the code you are running. To some extent, Emacs is its own API.
You can learn about new functions by reading about Emacs on community blogs, or you can take a more direct approach and use descriptive functions (describe-function). For help with any function, press Mmurx (that is, Alt+X), type describe-function, and then press enter. You will be prompted to enter a function name and then display a description of the function.
You can get a list of all available functions by typing Mmurx (Alt+X) and then typing? `.
You can also get a pop-up description of the function by pressing the Mmurx key, then typing auto-complete-mode, and then pressing enter when entering the function. After activating this mode, when you type any Emacs function into the document, you will be provided with the auto-completion option, as well as a description of the function.
When you find a useful function and use it, Emacs will tell you its keyboard binding, if any. If not, you can assign one yourself by opening your $HOME/.emacs configuration file and typing keyboard shortcuts. The syntax is global-set-key, followed by the keyboard shortcut you want to use, and then the function you want to call.
For example, to assign a keyboard binding to the screenwriter-slugline function:
(global-set-key (kbd "Cmerc's") 'screenwriter-slugline) reload the configuration file, and keyboard shortcuts can be used:
Mmurx load-file ~ / .emacs Emergency Button when you use Emacs and try a new function, you are sure to start calling something you don't want to call. The common emergency button in Emacs is Cmurg (Ctrl+G).
I remember this by associating G with GNU, and I think I'm calling on GNU to save me from a bad decision, but feel free to make up your own memory symbols.
If you click on the mini-buffer of CmurgMagol Emacs, it will return to the lurking state, the pop-up window will be hidden, and you will return to the safe state of a normal, boring text editor.
Ignore keyboard shortcuts there are too many potential keyboard shortcuts to summarize one by one here, let alone do not want you to remember. It was designed. The purpose of Emacs is to customize, when people write plug-ins for Emacs, they can define their own special keyboard shortcuts.
Our idea is not to remember all the shortcuts right away. Instead, your goal is to make you feel comfortable using Emacs. The more comfortable you become in Emacs, the more you will get tired of always turning to the menu bar, and you will begin to remember the key combinations that are important to you.
Depending on what you usually do in Emacs, everyone has their own favorite shortcuts. A person who writes code in Emacs all day may know all the keyboard shortcuts that run the debugger or start a particular language mode, but know nothing about Org mode or Artist mode. It's natural and good.
One of the benefits of practicing Emacs to learn about Emacs keyboard shortcuts when using Bash is that many of these shortcuts also apply to Bash.
Cmura: to the beginning of the line
Cmure: to the end of the line
Cmurk: cut the whole line
Mmurf: one word forward
Mmurb: one word backward
Mmurd: cut a word
Cmury: paste back (paste) the most recent cut
M-Shift-U: capitalize one word
Cmurt: swap two characters (for example, sl becomes ls)
There are more examples that allow you to interact with Bash terminals faster than you can imagine.
The package Emacs has a built-in package manager to help you discover new plug-ins. Its package manager contains modes that help you edit specific types of text (for example, if you edit JSON files frequently, you can try to use ejson mode), embedded applications, themes, spell checking options, linter, etc. This is why Emacs can be the key to your daily computing; once you find a good Emacs package, you may not be able to do without it.
You can press the Alt+X key, then enter the package-list-packages command, and then press enter to browse the package. The package manager updates the cache every time it starts, so wait patiently for it to download the list of available packages when you use it for the first time. Once loaded, you can navigate with the keyboard or mouse (remember, Emacs is a GUI application). The name of each package is a button, so you can move the cursor over it and press enter, or click it directly with the mouse. You can read about the package in a new window that appears in the Emacs framework, and then install it with the install button.
Some packages require special configuration and are sometimes listed in its description, but sometimes you need to visit the package's home page to read more information. For example, the autocomplete package ac-emoji is easy to install, but requires you to define a symbol font. You can use either way, but you can only see the corresponding emoji if you have the font installed, and you may not know unless you visit its home page.
Tetris Emacs has games, believe it or not. There are Sudoku, puzzles, minesweeping, a fun psychotherapist, and even Tetris. These are not particularly useful, but interacting with Emacs at any level is good practice, and games are a good way for you to spend time in Emacs.
Tetris is also the way I first came into contact with Emacs, so of all the versions of the game, Emacs is my real favorite.
EmacsGNU Emacs is popular because of its flexibility and high degree of extensibility. People are so used to Emacs keyboard shortcuts that they habitually try to use them in all other applications, and they build applications into Emacs, so they never have to leave. If you want Emacs to play an important role in your computing life, the ultimate key is to embrace the unknown and start using Emacs. Stumble until you figure out how to make it work for you, and then settle down and enjoy 40 years of comfortable life.
At this point, I believe you have a deeper understanding of "how to use the emacs command of Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.