Usage of GNU Emacs by non-programmers ...... Shell mode 13th sets to return my kill-ring back to me

Source: Internet
Author: User

Kill-ring is definitely a wonderful design in Emacs. Many times I hate to add the clipboard of X Window
Kill-ring. However, when I enter M-y
There will always be a lot of boring things in it. I may never post those things, because they are not complete, and many of them are broken fragments.

However, the initial design of Emacs is obviously to put everything in the kill-ring. Therefore, he wrote so many functions that are loaded into the kill-ring. the commonly used command seems to have only one Delete-region which can not be entered into the kill-ring.

To facilitate management and access to a large amount of content in these kill-rings, some cool people also write a browse-kill-ring extension. I also installed this item. However, I still want my kill-ring to be cleaner. Only put the things that I think are worth putting in it.

Fang
Method is not complex. Write extensions by yourself. Replace the default edit commands of Emacs. In kill-ring
The content that you do not want to put in is something wrong. Quick clearing and correction are actually a huge advantage of Emacs. I used to drive this in many places.
Telecommunication joke. This is because when many people make a mistake in this word, they will tirelessly press the backspace key for 18 times and then
Repeat the word telecommunication. In Emacs, we all know how to correct this error, right? We have M-DEL
Haha, right? Even if it is vim, do you have to switch to the command mode before entering the DB shortcut key, or switch to the command mode for at least 18 times?
Backspace is much cheaper. The problem is that you have to switch back after the DB is complete, isn't it?

Okay, not that far away. The problem is actually located here.
M-DEL is one of our most commonly used tools to deal with finger cramps. However, the wrong things occupy my kill-ring
This is really unpleasant. This must be intolerable. What can I do if I cannot bear it? Then use your own function to set the default M-DEL of Emacs
Replace the mess so that the mess no longer enters the cute kill-ring hut.

The code is actually very simple. Now that I have written it back, I can easily change the definition of M-D. Although this is not correct or used, for me, it is rare to put a word in kill-ring. Why? You can see that this article goes beyond copying and pasting, because I usually do this.

If you don't need to talk about it, you can directly access the code. You can't stop complaining about it. It's really uncomfortable to paste LIsp in the place of Cu, so you have to continue the texture...

Then the two functions are bound to the M-DEL and M-d key combination, from then on, kill-ring clean.

View
Here, some people will say, what should I do if I really want to delete a word to kill-ring? Of course, select the word and then C-W
This kind of thing... Haha, right? I will not talk about it. OK. If you really need a Kill word, Set M-D
The function is retained. The world is not white or black. Life has many colors.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.