首页 > 初级, 小技巧 > 快速include一个系统头文件

快速include一个系统头文件

2010年4月29日 ahei 发表评论 阅读评论

作者: 王纯业

输入inc, 然后按空格, 会提示输入文件名称.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;; 安装 abbrev
(mapc
 (lambda (mode)
   (define-abbrev-table mode '(
                               ("inc" "" skeleton-include 1)
                               )))
 '(c-mode-abbrev-table c++-mode-abbrev-table))
 
;; 输入 inc , 可以自动提示输入文件名称,可以自动补全.
(define-skeleton skeleton-include
  "generate include<>" ""
  > "#include <"
  (completing-read "Include File:"
                   (mapcar #'(lambda (f) (list f ))
                           (apply 'append
                                  (mapcar
                                   #'(lambda (dir)
                                       (directory-files dir))
                                   (list "/usr/include"
                                         "/usr/local/include"
                                         "/usr/include/g++-3")))))
  ">")

下面的这段代码的也许更加有用,当你发呆的时间超过 4 秒以上,
头文件的文件名称自动加一个下划线,在上面按回车,可以打开这个文件。

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
(defvar wcy-c/c++-hightligh-included-files-key-map nil)
(if wcy-c/c++-hightligh-included-files-key-map
    nil
  (setq wcy-c/c++-hightligh-included-files-key-map (make-sparse-keymap))
  (define-key wcy-c/c++-hightligh-included-files-key-map (kbd "<RET>") 'find-file-at-point))
 
(defun wcy-c/c++-hightligh-included-files ()
  (interactive)
  (when (or (eq major-mode 'c-mode)
            (eq major-mode 'c++-mode))
    (save-excursion
      (goto-char (point-min))
      ;; remove all overlay first
      (mapc (lambda (ov) (if (overlay-get ov 'wcy-c/c++-hightligh-included-files)
                             (delete-overlay ov)))
            (overlays-in (point-min) (point-max)))
      (while (re-search-forward "^#include[ \t]+[\"<]\\(.*\\)[\">]" nil t nil)
        (let* ((begin  (match-beginning 1))
               (end (match-end 1))
               (ov (make-overlay begin end)))
          (overlay-put ov 'wcy-c/c++-hightligh-included-files t)
          (overlay-put ov 'keymap wcy-c/c++-hightligh-included-files-key-map)
          (overlay-put ov 'face 'underline))))))
;; 这不是一个好办法,也可以把它加载到 c-mode-hook or c++-mode-hook 中。
(setq wcy-c/c++-hightligh-included-files-timer (run-with-idle-timer 4 t 'wcy-c/c++-hightligh-included-files))
分享家:Addthis中国
GD Star Rating
loading...
快速include一个系统头文件, 8.9 out of 10 based on 15 ratings 标签:ann, ann77, C/C++, face, keymap, lambda, 王纯业, 补全, 配色, 配色

相关日志

分类: 初级, 小技巧
  1. leon
    2013年9月6日17:06 | #1

    在哪里输入inc

    [回复]

  2. 2016年4月6日08:51 | #2

    Hield shot 7 of 12 from the field and had six rebounds and five assists in 22 minutes. The preseason first-team All-American is averaging 25.3 points through three games. http://www.raybansunglassesebay.us.com Wahid finished with 12 points to lead ArkansasMonticello and Goforth added 11. o coach outlet store
    WAL-MART SUPERCENTER ray ban sunglasses First lesson: just because your smartphone works when you land in a foreign country, doesn’t mean you should just use it as usual.
    Liberty sputtered for nearly a quarter after Wilsonville took the 21-14 lead. The Wildcats took advantage of a short punt and added a 42-yard field goal by Austin Kness to increase their lead to 24-14 with six minutes remaining. michael kors bags The back seats aren’t as big as expected. u http://www.coachfactorysoutlet.com
    ” But the ClinicAll board went on to explain, “This topic is one of the most important points on our strategic agenda, however, and is therefore at the forefront of our system development work. coach outlet store online Nevertheless, the slick scene changes, arresting background music, inspired direction and top-notch performances ensure its 75 odd-minute running time races by.
    q After the today, John Farrell spoke with Koji Uehara about returning to the setup role. oakley glasses Whereas fried chicken is all about the whole chicken and generally incorporates deepfrying and some sort of bread crumb or cornflake batter, “chickenfried” is a panfried pounded breast, and the batter is often a milk, flour, egg and seasoning concoction. michael kors outlet online
    Southbound traffic is being diverted onto Route 233 and then Route 11 oakley sunglasses Cardholders only; guests are not eligible for free admission. http://www.louisvuittonhandbagsbuy.us.com
    Warren agreed with some youth advocates who said that investing more in prevention and less in prisons can be a place to make a big change, and to focus more on helping youth stay out of trouble and out of jail. michael kors outlet online Mason was then taken to a hospital for medical clearance since he had been stunned. x coach outlet
    Dorian J. coach outlet store online But he’s really established himself in a significant manner.
    The school district now is actively recruiting seven or more members of the public to serve on the COC. coach factory The large parking lot was about half full not long after opening, and it only got busier from there.
    Why don t you like this ad ?It s offensive to meI keep seeing thisIt s not relevant to meSomething elseDoneTrending Pawn Stars figure jailed in Vegas on weapon, drug chargesAssociated PressPhotosPhotos of the day – March 9, 2016Yahoo NewsThis Site is SO Addicting!Thank you for your feedbackWe ll review and make changes needed. http://www.coachoutlet.cc To go out there and perform like that and have that kind of night with the bat is really impressive.
    Another point which the Vaxassination crowd ignore is that if you want to make millions of viruses float all over youre everywhere – you have to vaccinate. coach handbags “The spread is a talent equalizer,” said Gerry DiNardo, a Big Ten Network analyst and former coach at Vanderbilt, LSU and Indiana.
    v In addition, fullback Darrel Young and nose tackle Terrance “Pot Roast” Knighton indicated on Twitter that they would not be brought back coach outlet Since the council’s instructions, the committee has met six times .
    Marine Corporal Phillip Ray Orabuena paints a section of his 105 foot mural on Third Street near Monterey Street. cheap oakleys Why? Because his wife, Paola, has thrown him out of their home when she discovers he has had an affair with one of his clients at the gym where he is a trainer. u http://www.raybansunglassesbuy.co.uk
    Wecht pointed out that, according to the act, doctors couldn’t discuss symptoms at a conference or share information in a way that might help them learn more and offer better treatment michael kors outlet online Nearly half drank wine (including bubbly) on their heaviest drinking day of the week, compared with 40% who listed regular-strength beer, stout, lager or cider.
    k Juneau police in a statement identified the man as 70-year-old Stephen “Greg” Fisk, who handily defeated incumbent Merrill Sanford in the October election to become mayor. ray ban sunglasses Bugs of Spring, 2 p. v
    Sens. michael kors outlet Busch then used it all up with one big burnout. coach factory outlet
    John Michael McCloskey and John M. McCloskey to Todd J. Jediny and Julie Jediny, 27 Elwood Drive, $160,000. michael kors outlet store Tuesday at 10097 Rainbow Road in Lincoln. l michael kors outlet store
    Surveillance video shows 10 masked people raiding a gunstore in Houston after using a truck to break down the front door michael kors handbags government is proposing to divert some of the river’s effluent supply onto neighboring farmland, to reduce groundwater pumping for the crops.
    “I want standing-room-only to lift her up,” Bean said. http://www.raybansunglasses.name “I line it out so the director can follow along and I can help,” Schaap said. w michael kors outlet
    Penn State’s pre-seeds position it to have seven top-three finishes, an impressive number if form holds and its four top-seeded wrestlers actually finish on top http://www.cheapchinajerseysnfl.us.org The American Friends Service Committee, Grassroots Leadership and Southern Center for Human Rights released the report Tuesday titled “Treatment Industrial Complex: How for-profit Corporations are Undermining Efforts to Treat and Rehabilitate Prisoners for Corporate Gain.

    [回复]

  3. 2016年4月6日13:41 | #3

    What they say: “We wanted our egg nog to have our modern interpretation. It’s so much a part of the holiday — and this one has an approachable lightness and smokiness — it could be your regular winter warm-up!” (Greg Devine and Rian Nolan, bartenders) [url=http://www.raybansunglassesebay.us.com]http://www.raybansunglassesebay.us.com[/url] Four previous attempts to break the 3:05 Boston qualifying time for his age group were unsuccessful. a [url=http://www.michaelkorshandbagsup.us.com]michael kors outlet[/url]
    Evarint – Booth 14112 [url=http://www.cheapmichaelkorsbags.us.com]cheap michael kors bags[/url] Two meetings this month began with eight of 15 members present and more members arriving later.
    Three-year award winners: [url=http://o.storeonlinecc.com]o.storeonlinecc.com[/url] Kinsella was Chairman of the Board at the police academy for some of that period and, therefore, he had a clear conflict of interest when the the decision had to be made concerning the use of bond funds. y [url=http://www.michaelkorsoutletbuy.us.com]michael kors outlet online[/url]
    PHILADELPHIA (AP) – The Pennsylvania Supreme Court was urged Wednesday to revive a law that would let the National Rifle Association and other groups pursue lawsuits against towns and cities that enact gun-control measures [url=http://www.michaelkorshandbags.us.org]michael kors handbags[/url] In this grand set piece, the fate of the galaxy is decided, but not by the politicians who think they’re in charge.
    l Rachel B. Weiss to Evelyn Reda and Nicolas M. Reda, 4 Webster Court, $165,000. [url=http://www.louisvuittonhandbags.us.org]louis vuitton handbags[/url] III42 B. [url=http://www.louisvuittonhandbagsbuy.us.com]louis vuitton handbags[/url]
    We are here to stand up for the unborn and we are here to stand up for the rule of law,” Ryan said [url=http://www.louisvuittonhandbagsbuy.us.com]http://www.louisvuittonhandbagsbuy.us.com[/url] I don’t deal well with a room full of people. http://www.raybansunglasses.name
    Peter F. Leidt to Thomas P. Brennan, 150 South Quarter Road, $125,000. [url=http://www.coachoutletsonlines.us.org]coach outlet online[/url] NEW YORK Before they say “I do,” soontobe newlyweds are increasingly going online to ask, “Will you pay for our honeymoon?” h [url=http://www.coachoutletstores.net.co]coach outlet store[/url]
    Hikers stay for one night, maybe two, from May to July and from August to September [url=http://www.raybansunglassesebay.us.com]ray ban sunglasses[/url] In Martin’s memoir, he recalled demanding that the boys record a pair of hits, “She Loves You” and “I Want to Hold Your Hand,” in German, appealing to a country where the group had performed often in its early years.
    Kelly, who worked as a lawyer in Iowa, is considered a strong candidate because she has been supported by Republican Senator Charles Grassley of Iowa, the chairman of the Senate Judiciary Committee, which holds hearings on potential nominees. [url=http://www.coachhandbagsdeal.us.com]coach handbags[/url] It’s the same one he’ll have in New Orleans this weekend, too.
    While I didn’t do a formal test, I hammered the standard S7 by streaming the long movie Inception twice one day, streaming hours of music, and conducting lots of other normal phone tasks. [url=http://www.michaelkorshandbagsoutletup.us.com]michael kors outlet[/url] The Diamondbacks could slot Trumbo in left field, with Cody Ross’ return uncertain after his serious hip fracture in early August.
    The Seminoles (19-13) lost to fellow bubble team Virginia Tech in the ACC Tournament’s second round, and that 8-10 conference record could come back to haunt them on Sunday. [url=http://www.louisvuittonhandbags.us.org]louis vuitton handbags[/url] And with a charming old town, a pair of pictureperfect wooden bridges, a gaggle of fine museums, an ultramodern concert hall, and its famous weeping lion, there s still enough in Lucerne to earn it a place on any Swiss itinerary.
    t Bring to a boil and reduce to a simmer [url=http://o.storeonlinecc.com]oakley outlet[/url] We are down 6-7, with Sam McCauley serving and he comes over on the changeover, and says hey coach what do you think about serving and volleying this serve game, I said sounds great, that is what you are supposed to do, try it, but be careful and play smart! He did it to perfection winning a love serve game to make it 7 all.
    He was violently attacked and sustained major lacerations and puncture wounds. [url=http://www.michaelkorshandbagsup.us.com]www.michaelkorshandbagsup.us.com[/url] Collins called this an “unambiguous campaign pledge” made with state resources — and violation of state law that prohibits Huppenthal, as a publicly funded candidate, from taking this type of in-kind contribution. v [url=http://www.louisvuitton-outlet.us.org]louis vuitton handbags[/url]
    Unfortunately, not enough hikers are staying at the hotel to keep the business’ financials above water. [url=http://www.michaelkorshandbagsup.us.com]michael kors online[/url] Not by a long shot.
    w He connected on his second shot, a fading baseline jumper with 8:26 left in the second quarter, and finished with seven points, six rebounds and two assists in 21:46. Leonard shot 3-for-7 from the floor and connected on 1-of-5 three-point attempts. [url=http://www.coachoutletstoreonline.me]http://www.coachoutletstoreonline.me[/url] Anna but not Josh is expected to appear on the show, UPI reports. w
    com, LP. [url=http://www.michaelkorshandbagsoutletup.us.com]michael kors bags[/url] His ultimate goal, Munro said, is for Puerto Pe?asco to be recognized as a player in the economic development of the Arizona-Sonora mega-region. [url=http://www.michaelkorsoutletbuy.us.com]michael kors outlet online[/url]
    Sonjack Realty Limited Partner and William Foggle to Van Deusen Apts LLC, 40-42 Arnold St., $1,875,000. [url=http://www.coachoutlet.cc]www.coachoutlet.cc[/url] David Whitaker, DFayetteville, is the minority party whip for the state House of Representatives. m [url=http://www.raybansunglassesebay.us.com]ray ban sunglasses[/url]
    “I will not be scared because of this accident,” Zhang said [url=http://www.michaelkorsbags.me]michael kors handbags[/url] Rick Kleiner, with Picor, represented the landlord, and Mark Irvin, with Mark Irvin Commercial Real Estate Services, represented the tenant.
    12 – Drew Eubanks, 6-10, 240, Fr. Pts. – 16.0 Reb. – 6.5 Asts. – 0.5 [url=http://www.coachoutletssonline.us.org]coach outlet online[/url] Then, as is often demonstrated on dramas and other television, all the models walk the runway once again in close succession to much applause. n [url=http://o.westboroughpolice.com]cheap oakleys[/url]
    “Surveillance video at the store cited in the police report showed the shooter opening the door for Ramon and following him outside. [url=http://www.cheapjordanshoes.us.org]www.cheapjordanshoes.us.org[/url] Johnson was a mainstay in Houston for 12 years, making two All-Pro teams.

    [回复]

  4. 2016年4月7日10:27 | #4

    The Blazers finish their four-game road swing Wednesday against the Houston Rockets at the Toyota Center at 5 p.m. [url=http://www.coachhandbagsdeal.us.com]coach outlet[/url] But the weekend attack probably won’t diminish alShabab’s ability to continue a wave of bloodshed, analysts say. u [url=http://www.michaelkors.us.org]http://www.michaelkors.us.org[/url]
    Here are 15 effortless ways to shave 200 or more calories from meals and snacks. [url=http://www.cheapmichaelkorsbags.us.com]http://www.cheapmichaelkorsbags.us.com[/url] But he didn’t allow that.
    William G. Gallant and Gina R. Gallant to Thomas W. Wansleben and Lynn M. Tryba, 150 Leyden Road, $255,000. [url=http://www.coachhandbags.net.co]coach handbags[/url] The prostate gland is a small walnut-sized gland. l [url=http://www.coachoutletstores.net.co]www.coachoutletstores.net.co[/url]
    Vogt laid into Gawker, painted the news-gossip site as obsessed with “clicks” and out to destroy the image of celebrities like Hogan. [url=http://www.michaelkorsbags.me]michael kors bags[/url] Booths featuring SRP energy-efficiency and environmental programs were also featured along with other new water-saving products and services.
    y But Portland is Portland because of the wildlife and green space that dominates much of the city. Swart said he’s happy coyotes are here, calling them an awesome part of the landscape. [url=http://www.raybansunglassesebay.us.com]ray ban sunglasses[/url] Anticipate some 911 calls from your child as they adjust to singleparenthood. [url=http://www.coachoutletsonlines.us.org]coach outlet online[/url]
    Beyond that, the Yankees managed a mere five singles [url=http://www.coachhandbags.me]coach outlet store[/url] hr /Arizona has an RPI of 29 but is 0-4 against teams with a better RPI. http://www.louisvuittonhandbagsbuy.co.uk
    Garden Park LLC to Daniel J. Bedard, 16 Donald Ave., $160,000. [url=http://www.coachfactorysoutlet.com]coach factory[/url] “New everything,” Pharis said. i [url=http://www.raybansunglasses.name]ray ban sunglasses outlet[/url]
    According to its Web site, retail locations often hostin-store events like self-defense and free yoga classes [url=http://www.coachoutletstores.net.co]coach outlet store[/url] John Grunsfeld, head of NASA’s science mission directorate, said the scientific goals are compelling and the repair plans are sound.
    Trappers cannot legally relocate an animal they have trapped on your property. [url=http://o.westboroughpolice.com]cheap oakleys[/url] Per capita debt has been growing in the district since 2013, largely because of loans for vehicles and higher education.
    Isn’t magic wonderful? Because it wasn’t the vaccine that saved people – it was a redefinition of disease which allowed playing with statistics to deceive the American people. [url=http://www.michaelkorsbag.us.org]michael kors bags[/url] On Friday on his 10th hole (No.
    When more native trees were allowed to grow along the banks of the rivers, the banks were reinforced and the channels of the rivers deepened. [url=http://www.cheapmichaelkorsbags.us.com]michael kors outlet[/url] I saw a lot of people just in case, but it was clear that Anya was the only one who was Thomasin.
    y Facility does not have procedures for employees to follow when responding to an event involving vomitus or fecal matter discharge onto surfaces within the facility. [url=http://www.michaelkorshandbagsbuy.us.com]michael kors handbags[/url] Buena’s William Partridge has the top mark of the returning throwers at 58-3 3/4, but his previous best was a 51-1 mark and he failed to throw over 50-feet in his other meets.
    If you crossed your legs, they crossed their legs; if you touched your hair, they touch their hair. [url=http://www.coachhandbags.me]coach outlet[/url] But, for some reason, the Tennessee Titans took Murray, even though they were coming off being the worst team in the NFL. a [url=http://www.coachhandbagsdeal.us.com]coach handbags[/url]
    When asked “Do you believe you will ever get over it,” Andrews stated “no. [url=http://www.coachoutletssonline.us.org]coach outlet online[/url] Marquette.
    b He dubbed it the “Wall of Death.” [url=http://www.coachhandbags.me]coach bags[/url] Lori Robinson, the commander of the Pacific Air Forces, also urged other nations to exercise their freedom to fly and sail in international airspace and waters “or risk losing it throughout the region. c
    (AP) – The Seattle Mariners have finalized a $507,500, one-year contract with Cuban outfielder Guillermo Heredia [url=http://www.raybansunglassesebay.us.com]ray ban sunglasses[/url] The firm’s other brokers who assisted with the sale are Sean Doyle, Cory Villaume, Adam “A. [url=http://www.coachoutletstores.net.co]coach outlet online[/url]
    Using old photographs, architectural drawings, film and personal remembrances, he will take the audiences back in time and discuss how movie theaters played an important role in communities throughout America. [url=http://www.michaelkorshandbagsrack.us.com]michael kors outlet[/url] Tomorrow at 6:30 p. l [url=http://www.coachhandbagsdeal.us.com]coach outlet[/url]
    com%22%20%3E%3Ca%20href=%22http:us-presidents. [url=http://o.storeonlinecc.com]oakley sunglasses[/url] “We are not very much worried but it is a very big challenge for us, definitely,” Theodoridis said, when asked if clubs were seeking to exploit uncertainty at UEFA.
    The multi-platinum singer and actress will bring her “Revival Tour” to the Palace of Auburn Hills on Friday, June 24, 2016. [url=http://www.michaelkorshandbagsrack.us.com]michael kors outlet online[/url] These “passionate renderings,” as Wagner calls them, are done in a kind of magical realism that is far different from the realistic work in this show. f [url=http://www.coachhandbags.net.co]coach handbags[/url]
    Illinois’ Zac Brunson itching for a rematch with Nickal [url=http://www.louisvuitton-outlet.us.org]http://www.louisvuitton-outlet.us.org[/url] “Each year the state gets about 1,000 cases reported to public health departments,” he said.

    [回复]

  1. 2010年4月29日05:50 | #1
  2. 2012年4月3日22:22 | #2
:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: