首页 > IDE, 中级 > Emacs才是世界上最强的IDE - 智能的改变光标形状

Emacs才是世界上最强的IDE - 智能的改变光标形状

2009年11月22日 ahei 发表评论 阅读评论

Emacs默认情况下, Emacs的光标是一个小方块, 相比一般程序里面的一个小长条形状, 可以很快的在一大片文字中看到当前光标在哪, 但是缺点就是, 在编辑的时候不太方便, 因为那个小方块是覆盖在整个字母上的, 很多人刚开始用的时候都不知道当他敲进一个字母的时候, 这个字母是插到当前字母的后面还是前面, 这点, 光标显示为小长条就比较容易分辨了, 那么我们怎么结合它们两者的优点呢? Emacs再一次体现了它那强大的扩展性, cursor-chg正是利用了Emacs的扩展性, 得以成功结合上述两种光标的优点, 它在以下方面进行改进:

  • 当你在Emacs中操作的时候, 光标为长条状, 就像这样:
    在Emacs中显示长条状光标

    在Emacs中显示长条状光标


    一旦你不操作Emacs, Emacs处于空闲状态时, 光标就由长条状变成方块状, 这样方便你定位光标, 因为Emacs处于空闲状态, 说明你正在盯着Emacs看文本, 或者你离开了一会, 不在编辑状态, 变成方块状方便你定位光标.
  • 当当前buffer为只读buffer, 或者当前编辑模式为覆写模式(你按了一下insert键), 或者你进入了`view-mode’, 说明你正在浏览buffer, 或者是键入的字符要覆盖掉当前的字符, 这时候光标会由长条状变成方块状, 合情合理!

经过以上改进, 我们编辑, 定位光标都方便极了.

我加了一个小函数, 更方便的控制是否使用cursor-chg. 我增加的代码在这里, 内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
;;; dired-lis.el --- Change cursor smartly
 
;; Copyright (C) 2009 ahei
 
;; Author: ahei <ahei0802@126.com>
;; Keywords: cursor
 
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
 
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
 
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
 
;;; Commentary:
;;
;; Change cursor smartly
 
;;; Installation:
;;
;; Copy cursor-change.el to your load-path and add following statement to
;; your .emacs:
;;
;; (require 'cursor-change)
;;
;; then M-x cursor-change-mode to use this library.
 
;;; History:
;;
;; 2009-11-22
;;      * initial version 1.0.
 
;;; Code:
 
(require 'cursor-chg)
 
(defgroup cursor-change nil
  "Group for cursor-change."
  :group 'cursor
  :prefix "cursor-change-")
 
(defvar cursor-change-old-cursor-type nil "Cursor type before toggle on function `cursor-change-mode'.")
(defvar cursor-change-old-blink-cursor-mode nil "`blink-cursor-mode' before toggle on function `crsor-change-mode'.")
 
(setq curchg-default-cursor-color "green")
 
;;;###autoload
(define-minor-mode cursor-change-mode
  "Toggle `cursor-change-mode'."
  :global t
  :group 'cursor-change
  (if cursor-change-mode
      (progn
        (setq cursor-change-old-cursor-type (cursor-change-get-cursor-type))
        (setq cursor-change-old-blink-cursor-mode blink-cursor-mode))
    (blink-cursor-mode (if cursor-change-old-blink-cursor-mode 1 -1)))
  (toggle-cursor-type-when-idle cursor-change-mode)
  (change-cursor-mode cursor-change-mode)
  (unless cursor-change-mode
    (curchg-set-cursor-type cursor-change-old-cursor-type)))
 
(defun cursor-change-get-cursor-type (&optional frame)
  "Get cursor type of frame FRAME."
  (cdr (assq 'cursor-type (frame-parameters frame))))
 
(defun curchg-change-cursor-on-overwrite/read-only ()
  "Set cursor type differently for overwrite mode, function `view-mode', and read-only buffer.
That is, use one cursor type for overwrite mode and read-only buffers,
and another cursor type otherwise."
  (curchg-set-cursor-type
   (if (or buffer-read-only overwrite-mode view-mode)
       curchg-overwrite/read-only-cursor-type
     curchg-default-cursor-type)))
 
(provide 'cursor-change)
 
;;; cursor-change.el ends here
分享家:Addthis中国
GD Star Rating
loading...
Emacs才是世界上最强的IDE - 智能的改变光标形状, 7.0 out of 10 based on 4 ratings 标签:ahei, autoload, buffer, cursor, cursor-change, cursor-chg, DEA, Emacs, erc, IDE, lightbox, lisp, mode, org, screenshot, se, term, vi, 光标, 扩展, 配色, 配色

相关日志

分类: IDE, 中级
  1. 2016年4月7日03:29 | #1

    The Lincoln County judge determined that it appeared Zekan’s intention was to alarm and frighten Campola and her customers, according to a summary of the case included in the appeals court opinion. coach factory outlet Tavion Revels, who led the Pirates with 23 points, scored 10 in the second quarter, including eight in a row, as the Pirates closed the gap to 2624 at halftime. n louis vuitton outlet online
    I think the scarves may have actually been made ofdecorated sandpaper, they were that unsoft. ray ban sunglasses Johnson’s a good player.
    Toby A. O. Holmes to Angela Smith-LaClaire, 7-9 Franklin St., $135,500. michael kors outlet online Many experts have questioned whether the North has the know-how to mount a miniaturised nuclear warhead on a missile and complete a functioning weapons system. r michael kors bags
    com coach outlet store The biggest statistical impact came from Westbrook, who put up 25 points (9-of-15 FG, 7-of-7 FT), 11 rebounds, and a career-high 20 assists for his 11th triple-double of the season.
    n Permits now will be required for access, according to the USFWS. http://www.raybansunglassesbuy.co.uk However, I fully understand why people have voted for him. michael kors outlet
    MAHTOOK MAGIC michael kors bags According to Bay:On Jan. http://www.michaelkorsbags.me
    Westin Myles led East Lansing with 25 points, and Malik Jones made 10-of-11 free throws. louis vuitton outlet online The game was tied twice more in the first 2:30 of the second half, but a jumper by Aly Hudgins gave East Central the lead for good with 17:26 remaining. z coach handbags
    An aging board and changing times have forced The Gardeners of Tucson to close up shop after 56 years. michael kors outlet With a corporate antivirus program, an administrator has a dashboard that allows them to monitor updates from a single screen.
    “He added: “We have identified four priority areas where we can make the biggest environmental and economic impact: food and drink, energy infrastructure, remanufacturing and construction. michael kors handbags “I love our veterans, so I want to give back to them as well,” says Mullinax, a member of the ASTPS who is from a family of veterans.
    Lentz the chocolatier will be at hand with caramels created in a copper cauldron. michael kors bags onceagain, brand new, never opened, has package seal on it andeverything.
    Again, as a fan, I take for granted that a hero’s very appearance usually includes some kind of armament, from Batman’s utility belt to Wolverine’s claws. cheap air jordans Those are simple and doable and both minimalist and compelling.
    u Red kidney beans are full of protein, fiber, vitamins and minerals. cheap nfl jerseys He also threatened to post the girl’s images on social media and networking sites if she did not send him more sexually explicit photos and engage in sexually explicit video web chats over Skype with him.
    Lovato, they are not currently aware of anyone losing their mind while playing the infamous game at Starfighters, but they have noticed “a black late model sedan with tinted windows trolling the parking lot ever since it’s been here. coach handbags Resident Kayla Alexander told WPXI-TV that she heard a barrage of gunshots — more than 20 — in the neighborhood, which usually is quiet. w michael kors bags
    In the hours here, we saw no sign of Border Patrol, but we did see how easy it is to cross http://www.coachhandbags.net.co Costa, who had been labelled a ‘fraud’ in a post on one of PSG’s official social media accounts in the build-up to the game, scored against his antagonists but it was not enough to keep Chelsea in the competition.
    p Kevin Moore (7) of Acadiana scores a TD against Ponchatoula during the 5A prep football playoff at Ponchatoula Friday, November 21, 2014. coach outlet I am now a senior citizen. p
    “Eyebrows are in the spotlight now so more than ever because of social media; everybody is focused on brows right now,” Emily Joy, owner of emDollisticem, says. http://www.louisvuittonhandbagsbuy.co.uk There are a host of Tucson teams who will also be primed to compete, led by Sahuaro, Ironwood Ridge and Canyon del Oro. wholesale nfl jerseys
    Listen to . michael kors bags The only drugstore closed in August. n michael kors outlet store
    Despite the majority of men s names listed on bottles, more and more women are also finding their place on wine labels as well, such as Isabelle and Nathalie Oudin or even L C Poitout, with the C standing for Catherine. michael kors outlet online He struck out three and walked one.
    Karen M. Michalski, representative, and Frederick A. Urdzela, estate, to Michael J. Dubois and Lisa M. Alward, 118 Sheehan Drive, $172,000. michael kors outlet James GayRees, left, and Asif Kapadia pose in the press room with the award for best documentary feature for “Amy” at the Oscars on Sunday, Feb. e cheap nfl jerseys
    This lineup of the planets and the moon in the morning sky is of no specific astronomical importance but certainly worth arising on a cold winter morning to see louis vuitton outlet “As a kid growing up, I looked up to (Broncos super fan) “The Barrel Man”; who would’ve thought I’d be in there with that guy? That doesn’t seem real to me.

    [回复]

  2. 2016年4月7日11:47 | #2

    After all, Edwards defeatedU.S. Sen. David Vitter, R-La., who was wounded by a messy prostitution scandal and not-so-secretly by many of his fellow Republicans for years. cheap michael kors bags Since November 2012, Aéropostale, Inc. k coach outlet online
    “Where’s the ‘you’ and ‘our’? We’ve lost track of that. ray ban sunglasses outlet Send information to Star reporter Gabriela Rico at grico@tucson.
    – Bloomberg News louis vuitton outlet Gularte made the semifinals of the CCS Championships last year in the shot put, and newcomer Richard Justo is expected to make a strong contribution in that event as well. m coach outlet store online
    com and historypress. michael kors outlet store I’ve transformed myself to become a feline “mommy”—suiting up in a full-body costume, deodorized with bobcat urine and placing a big, furry bobcat mask on my head.
    l 04-07-12-14-FREE-19-22-28-32 louis vuitton outlet A victory against the Aggies would go a long way to erasing all the turbulence of the regular season. louis vuitton outlet
    But believe me, I asked http://www.coachhandbags.com.co “Coming to Los Angeles was fine for me, and settling in off the pitch is not a problem,” Gerrard said. http://www.coachoutletstores.net.co
    It can also be argued that gratitude is a privilege of those who have their health, enriching personal and family relationships, wealth, and the opportunity to live in peaceful and prosperous nations or neighborhoods. coach outlet online Views are not doomed I believe Philip Martin errs in finding himself and others likeminded in the majority in this country in his recent column, proclaiming himself on the right side of history and society, in opposition to the late Antonin Scalia. k http://www.michaelkorsbags.me
    The other local left alive, Nadim Shabou, has just 20,000 chips,meaning he’ll need to get on a serious hot streak in order to reachthe money. coach handbags Also, far from deteriorating, the private road heading to Gunsight from the east is in better shape than it used to be, said Stan Hart, a Save the Scenic Santa Ritas board member.
    The Meramec and the country around about was a kind of battlefield all the years of the Civil War. louis vuitton outlet George said while he always pulls for the Razorbacks, he understands the SEC can’t have a public address announcer who shows favoritism for another team.
    State media has previously made that claim, which has been widely questioned and never independently verified. oakley glasses Tempe police say the crash happened?March 2 on Hayden Lane near Kenwood Circle.
    That puts Westbrook even with the ‘ for the most in the league. coach outlet store online “You’re getting Congress to amend the system to require that drug samples be shared under the penalty of actual sanctions,” he said.
    k At TeamHealth (NYSE: TMH), our purpose is to perfect our physicians ability to practice medicine, every day, in everything we do. coach outlet online Now, Gensini has predicted higher than normal tornado activity from Sunday through March 19.
    This is the third year the Intero Foundation Inc. coach outlet store online Remember, cigarettes are a drug. w louis vuitton outlet
    Either way, time for prepping and primping is tight. ray ban sunglasses outlet Plus it’s kind of a comic creators dream to print on newsprint.
    h All faculty and staff go through annual cultural competency training and evaluation michael kors outlet “The major averages closed lower, driven by the latest round of domestic and international economic uncertainties,” said Bob Williams, senior vice president and managing director of Simmons First Investment Group Inc. s
    Sharon, who is planning to cut, chop and bake as many of the menu ingredients as she can prior to the day, said she is not feeling stress, only excitement. michael kors outlet online “To see the draft list of qualities the ideal job candidate willpossess, click on Related Documents (above). ray ban glasses
    Edward C. Hough and James A. Gianfelice to Nicholas J. Axiotis and Cidalia M. Axiotis, 12 Meadowview Road, $260,000. cheap louis vuitton bags Nippon Professional Baseball Commissioner Katsuhiko Kumazaki on Wednesday demanded the Yomiuri Giants investigate their players. u michael kors outlet
    Her playing partners were Dee Zimmerman, Karen Walsh, and Mary Anne Gill coach outlet store Her adoption fee is $85.
    Jeffrey D. Sias and Andrea Sias to Ibtisam D. Qasem, 41 Overhill Drive, $157,000. http://www.louisvuittonbagsbuy.us.com “When I look back on my NFL career, I’ll know without a doubt that I gave everything I had to help my teams walk away with a win,” Manning said. k louis vuitton bags
    I look forward to working with the team to grow and dominate the urban space. ray ban outlet Meoni/Jo.

    [回复]

  3. 2016年4月7日23:08 | #3

    The NOOA had to negotiate a significant bump last week, when its originally -scheduled Eisenstein, Kyle Pfortmiller, had to withdraw for medical reasons. After a bit of scrambling, the company engaged baritone Liam Bonner, who has sung the role with Houston Grand Opera and Lyric Opera of Kansas City, to replace him. coach outlet They are going by sea, and many of them are dying. n michael kors outlet
    Media Contact:Kelley Bonsall, 480-457-2170Media@lifelock. michael kors handbags The police went into action.
    DODGERS TV coach factory outlet The best way to make sure all Americans have access to the medical care they need it to implement single-payer universal health coverage. p michael kors outlet store
    Wise, the Safe Haven project and outreach case manager for the coach outlet online circumstances, medical marijuana and/or recreational pot does not rise to anywhere that level.
    j Chicago Cubs right-hander Jake Ariettawon the National League Cy Young Award. He beat out Zack Greinke and Clayton Kershaw. http://www.michaelkorshandbagsoutletup.us.com Founded in 1995, HGU enrolls more than 4,000 undergraduate students from 35 countries. http://www.coachhandbags.com.co
    Washington will finish the NBA’s only three-game, three-day stretch at fellow playoff contender Miami on Saturday http://www.michaelkorshandbagstrade.us.com Sanger was warning the world of a bomb that many fear more than nuclear power the population bomb. http://www.coachoutlet.cc
    A handful of politically powerful special interests want to cut the pay and benefits going to skilled trades workers by eliminating prevailing wage policies, even though research shows taxpayers won’t save a dime. cheap oakleys And I said, “But that’s just for cars. a coach factory outlet
    A surprise for the Virginia runner of the year michael kors outlet Walkable communities are important, for sure.
    You can’t beat that with a barrel mallet!The more you know: Starfighters Arcade is one of only places in the world that you can play the legendary “” video-game, known for its ability to drive mortal game players “insane. http://www.coachoutlet.cc Extensive interviews with industry personnel, scientists, professional and trade organizations, government agencypersonnel, observers, scientists and industry professionals were conducted.
    Meanwhile, the Orange (19-13) have already begun their campaign for an at-large bid. michael kors outlet FIFA will soon appoint members for a committee system made more focused in the reforms process to cut costs and limit patronage.
    People who were there to support their children and family members applauded many times as the students performed over a thousand techniques. ray ban sunglasses continued
    g She was crowned prom queen coach outlet store online Nor does it create a path to citizenship.
    On Wednesday, U. coach outlet online It doesn’t seem reasonable to invest for the needed infrastructure and expect to get all that back in one year and pay the city $200k. m michael kors bags
    II-33 Sports Utility Vehicle (SUV) – A Definition II-33 Vehicle Classification System. coach outlet Items you can use to fill your tray: Photos, Christmas cards, tags, wrapping paper, ornaments, postage stamps, old film, trinkets, thimbles, fake flowers, miniature items, sequins, buttons, small toy-like cars or trains, costume jewelry, stamped images, and the list could go on and on.
    k Brenda M. Silva and Anthony D. Lamitie to Kate A. Sypek and Kevin J. Sypek, 29 Old Pelham Road, $260,000. michael kors outlet “I’ll tell you this, I’m proud of the way we scored some runs,” Farmington coach Randy Osnes said. c
    Meanwhile, the State Department IG’s credibility is suffering and they are wasting resources over what are so far unsubstantiated allegations. coach bags No one has better Tucson basketball bloodlines. http://www.coachhandbags.me
    Each UAW-Ford local will now vote on the contract. The full agreement details can be michael kors handbags Despite a more challenging economic environment, China will remain the largest and one of the fastest growing markets for cement and concrete additives. s cheap nfl jerseys
    Nancy’s role as asaavypolitician and a key adviser toPresident Ronald Reaganseemsto be less wellremembered michael kors bags Blatter has also pledged to appeal his six-year ban at CAS.
    Kevin M. Brown to Paul E. Kida and Tracey M. Kida, 270 Silver St., $180,000. coach outlet online Additional content is available on . g louis vuitton outlet
    The President laughed and stretched out his hand to take hers. http://www.cheapjordanshoes.us.org “I’ve never heard of anything like this, where armed Mexican police is brought to this side to actually stage an operation into Mexico,” he said.

    [回复]

评论分页
1 2 36837
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: