首页 > 初级, 小技巧 > Emacs中快速访问远程主机的文件

Emacs中快速访问远程主机的文件

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

作者: bood

工作中因为要经常用dired访问远程主机上的文件,每次都要输入一大堆的主机名和路径,比如为了访问远程机器home目录下的一个文件,我需要输入:

/bood@remote.host.com:~/working/filename.pl

每次输入一遍主机名不仅难记,而且效率十分低下。

后来发现了一段lisp程序,可以在Emacs中给那些常用的路径起别名,比如可以将

/bood@remote.host.com:~

命名为home,那么以后就可以直接用

@home/working/filename.pl

来访问上面的那个文件了。

最近我把这段程序整理成了一个单独的扩展,并做了一些改进(主要是让别名列表成为custom variable),就拿出来跟大家分享一下(这里下载)。
扩展使用起来很简单,下载以后放到Emacs的site-lisp目录下,然后修改你的.emacs,加入:

(require 'drkm-fav)

随后用setq命令便可以给路径定制自己的别名了,比如:

1
2
3
(setq drkm-fav:favourite-directories-alist
  '(("home"  . "/bood@remote.host.com:~")
    ("kernow-src" . "~/xslt/kernow/svn-2007-09-29/kernow/trunk/src/net/sf/kernow")))

这样就建立了home和kernow-src两个别名。

要是嫌编辑.emacs麻烦的话,也可以通过Emacs的Custom Variable机制来设置和保存drkm-fav:favourite-directories-alist(M-x customize-option),不过要注意的是设置的时候每个字符串都需要加上双引号。

最后附上我的一部分设置,大家可以参考其中的一些技巧,比如如何重用主机名:

1
2
3
4
5
(setq drkm-userhost "bood@remote.host.com")
(setq drkm-root (concat "/" (concat drkm-userhost ":")))
(setq drkm-fav:favourite-directories-alist
  (list (cons "home"  (concat drkm-root "~"))
        (cons "root"  drkm-root)))
分享家:Addthis中国
GD Star Rating
loading...
Emacs中快速访问远程主机的文件, 8.8 out of 10 based on 5 ratings 标签:Emacs, org, 配色

相关日志

分类: 初级, 小技巧
  1. 2016年4月7日02:56 | #1

    Andrew Wiggins scored 15 points on 5-for-17 shooting for the Wolves (7-8), who won their second home game in a row after an 0-6 start at Target Center. The Wolves entered the night last in 3-point field goals, but went 9 for 21 against the Hawks. louis vuitton outlet online That’s really what you’re trying to do. w louis vuitton handbags
    Also, today’s factory jobs require more education and skills, leaving many less-educated Americans on the sidelines ray ban sunglasses “There are things that come to me, maybe the script is good but you don’t really need me in this movie to stand at the door and say, ‘Drive carefully.
    West Meadow Homes Inc. to John D. Eaton and Danny W. Eaton, 6 Austin Lane, $460,000. http://www.michaelkorshandbagsoutletbuy.us.com San Benito went from fourth place to second in one week, and the team isn’t looking to stop there. w michael kors outlet online
    Hopefully the success of “La Boheme” will spill over toTucson’s other arts groups, like the Tucson SymphonyOrchestra’s concertnext week with violinist Vadim Gluzman;?orArizona Theatre Company’s run later thismonth of “The Glass Menagerie. cheap louis vuitton bags According to an agenda report for the Tuesday meeting, many police chiefs and sheriffs will attend.
    h Bryant finished with a season-high 21 points on 7-for-20 shooting. He was his predictable aggressive, ball-dominant self against the Blazers. The thousands wearing his jerseys in the stands gave Bryant a loud ovation when he was introduced before Blazers fans countered by booing him every time he touched the ball. On a night where the floundering Lakers (2-13) lost their fifth straight game, it was still clearlyKobe’s show. cheap jordans “How many believe you can accurately tie student achievement scores to all the teachers in your school building?” Abernathy asked. http://www.cheapchinajerseysnfl.us.org
    Roselle is in northwestern Illinois near Chicago ray ban sunglasses 400 Barrios, DOUG, 1:05. http://www.cheapjordanshoes.us.org
    Carroll likes having Shead on the field for his ability to make plays. Just minutes after he replaced Williams, Shead forced a fumble from 49ers Bruce Ellington during a kick return. The ball rolled out of bounds, but it’s the type of play Carroll said he’s seen often from Shead during practice. http://www.coachoutletstores.net.co The Arkansas Court of Appeals released opinions Wednesday. z coach outlet
    Combative Democrats grilled witnesses who criticized fetal tissue research after abortion michael kors outlet The rules are silent about sharing a copy with the buyers’ realty agent.
    What makes annuities so attractive? They alleviate the worry that you will outlive your money, but it is important to note that when you select an annuity, you lose access to your principal. http://www.louisvuitton-outlet.us.org “It’s going to be an amazing two months,” he told a raucous crowd at a Las Vegas casino.
    Chelsea must consider it’s short-term future now and how to handle this, but they knew that beforehand. http://www.coachoutletstoreonline.me There’s nothing more exciting than settling into your brand new home.
    I’m just really thankful that the worst part is over and that I’m able to spend time with my loved ones. coach outlet store online But James has evolved into a consistent scoring threat by realizing her limitations.
    z SEATTLE (AP) – Seahawks wide receiver Ricardo Lockette says the neck injury he suffered last November against Dallas was so serious that he could have died if not for proper treatment from athletic trainers and medics on the field michael kors bags Each dish features ingredients with deep roots here cholla buds, huitlacoche, chiltepin chiles.
    View gallery Israeli emergency personnel evacuate the body of one of the two Palestinian assailants whom police s On Tuesday, Biden was meeting former Israeli President Shimon Peres several blocks from where the Palestinian was running along the Tel Aviv beachfront stabbing pedestrians and motorists stuck in traffic. http://www.raybansunglassesbuy.co.uk Violence from criminals usually follows. u louis vuitton bags
    Even regular everyday appliances have apps. http://www.michaelkorsbag.us.org We all love football.
    g Erik Leen and Carlin J. Leen to Gunnar J. Collier and Anna C. Collier, 80 Pine St., $149,000. coach outlet store online The analysis provided in this report includes:Market size and forecast for foodservice tea sales, as well as related menu pricing and import pricing trend analysis. e
    “I think the science on concussion is nonexistent. coach outlet store 4 all-time)3,200 10:25. http://www.michaelkorsoutletbuy.us.com
    The proposed agreement gives traditional workers, or those hired before 2007, their first wage increase in 10 years. And, like the dealsandworkers hired after 2007 have a clear path to traditional wages. michael kors outlet store Saudi Arabia and the Emirates also are involved in a war in Yemen against Shiite rebels who have received Iranian support, raising fears of a regional war. x michael kors online
    PSP? (PlayStation?Portable) broadened the entertainment experiences into the portable arena. coach outlet records, thanks to the combination of El Nino and man-made global warming.
    But Dallas has won only 10 games against teams that would be in the playoffs if the season ended today. michael kors online The entire field got emptied in a single day, so some rules were needed. o michael kors outlet online
    Big mistake. michael kors outlet online that one might be juggling chain saws.

    [回复]

  2. 2016年4月7日08:56 | #2

    Gregory M. Stewart to PNC Mortgage and PNC Bank, NA, 98 Turnpike Road, and Lot 76, Turnpike Road, $136,000. michael kors outlet “Top secret” is the highest level of classification, reserved for material whose release could cause “exceptionally grave damage to the national security. q louis vuitton handbags
    (AP) – There are few jobs in the NFL that offer less potential playing time than backup quarterback on the Baltimore Ravens, the role Matt Schaub has assumed in the twilight of a lengthy and productive career. oakley sunglasses The officer then asked both for their tickets and, according to the police report, Carey responded, “Don’t you know who I am? I am an All American.
    Adam S. Metsch and Jennifer P. Metsch to Justino Lopez, 14 Larkspur St., $141,000. http://www.louisvuittonhandbags.us.org I’m just chilled out. y http://www.louisvuittonhandbagsbuy.co.uk
    “Recognize that yes, these things are happening, however, you are limited as what you can do so focus on what is important to you in this moment. http://o.storeonlinecc.com FOSTER KLUGAPMarch 10, 20163:03 AM ETMINAMISOMA, Japan (AP) — The ashes of half a dozen unidentified laborers ended up at a Buddhist temple in this town just north of the crippled Fukushima nuclear plant.
    n Some Oregonian speak Sinhalese, Oriya, Trukese, Karen http://www.michaelkorshandbagsoutletup.us.com The signs and labels are clear and crisp; the colors complement the pieces; and there is plenty of text that expands on the work on the walls. coach outlet store online
    (AP) — Digging out from a scandal and weary of having its football program mired near the bottom of the Big Ten, Illinois made a splash Monday by hiring former NFL coach Lovie Smith to lead the Illini coach outlet store “It’s a very, very open season,” said West Ham manager Slaven Bilic and Leicester being at the summit sums that up perfectly. http://www.coachoutletssonline.us.org
    “I talked to my sister and some friends and everybody is all right,” Batum said. “They’re shocked. They told me Paris is like a war outside. Everybody is outside. The police is outside. The army is outside.” coach outlet store online Knight will start Saturday and McKinney on Sunday. q http://www.coachoutletstoreonline.me
    She has never talked to a man except in the sexual fencing conversation. louis vuitton outlet “Nothing’s changed.
    Instead of falling back on typical arguments against such building ventures – such as safety concerns or favoritism toward more mainstream sports – parks commissioners and council members showed they aren’t so out of touch with younger generations in Hollister, a city that is often generalized as a place with little to provide in the way of positive activities for minors. michael kors outlet Because most puzzles are too small, with insufficient writing space, I use my computer and printer to “blow them up.
    Termination of your Yahoo account includes any or all of the following: (a) removal of access to all or part of the offerings within the Yahoo Services, (b) deletion of your password and all related information, files and content associated with or inside your account (or any part thereof), and (c) barring of further use of all or part of the Yahoo Services. http://www.michaelkorshandbagsbuy.us.com On Arizona’s sideline, as the coach embraced everybody but the security guards, he surely thought back to March 1992, when the Pitt crowd began a similar ovation.
    His experiences will keep him focused on curtailing the rising cost of higher education, making sure veterans get timely health care and improving the lives of the poor if he’s elected, he said. louis vuitton bags Neither officer was injured.
    g ” Eight years later, police searching Armstrong’s home discovered six firearms and ammunition coach outlet online “I coached my son Paul for four years at Pueblo and then for two more at Pima College,” he says.
    He empowers the weak, the lonely and the unloved. http://www.michaelkorshandbagsoutletbuy.us.com Undergraduate students in the College of Liberal Arts and Sciences, the College of Engineering, and the Tippie College of Business who achieve a grade point average of 3. q michael kors outlet
    Among them:Ragged rockflowerAn early spring bloomer with sweet-scented white flowers, ragged rockflower is a woody shrub that prefers rocky canyons, often growing from cracks in rocks. michael kors outlet store sanctions against the isolated state.
    e The goals by Green, Glendening and Datsyuk were their first this season. michael kors outlet The sort of man I presume to understand. t
    McLarenon board and overseeing all clinical review efforts. http://www.coachhandbagsdeal.us.com Kellner, a left-hander, eagerly reminisced about his career. wholesale nfl jerseys
    Samuel C. Chevalier and Stacey L. Chevalier to Daniel A. Storrs and Andrea J. Storrs, 391 College Highway, $200,000. coach outlet store online Cups matching the description given during his interview were found at the home, authorities said in the affidavit. u michael kors outlet online
    LAWRENCEBURG, Ind. michael kors handbags From every direction the planes came in diving in long, steep power dives.
    Stotts laughed after his quip, because, well, what else could he do? The Blazers trailed by as many as 29 points and, although they fought back and trimmed the lead to single digits in thefourth quarter, their performance was a laugher. michael kors outlet Wallace said Monday that the request for the Legislature to increase the state treasurer’s office spending authority for professional fees in fiscal 2017 is to cover the treasurer’s office’s legal fees in the lawsuit filed by Singer as well as for a legal adviser specializing in laws covering the state’s investments. z http://www.michaelkorsoutletbuy.us.com
    The announcement was made today by Michael?Scott, Partner, Pure Flix?and John Morici, Managing Director – U. http://www.michaelkorshandbagsbuy.us.com “When she first started to take this back in 2006, she made sure it was approved, that it wasn’t on the banned list, and checked in future years.

    [回复]

  3. 2016年4月7日19:43 | #3

    Anna Houser, Marist, senior coach outlet stores Tirrell Brown, a firstteam allconference selection, led the Tigers with 21 points on 7of10 shooting from the floor. t coach outlet store online
    “We were living on fumes,” Ramirez said in a telephone interview about the weeks after the series when he was out of work coach outlet The final decision would be up to Gov.
    Atlanta Hawks 116, MEMPHIS GRIZZLIES 101 coach outlet store online Good luck. x coach outlet
    JDA Connect emfor SAP HANAem isa pre-packaged solution enabling rapid integration between JDAManufacturing PlanningTM and SAP ECC running SAP HANA. coach outlet Without stronger wage growth, debt will continue to be a burden for all buyers.
    x Huff owns , one of two dispensaries in the central Oregon community where leaders last spring decided to impose a 5 percent tax on medical marijuana transactions. coach outlet So things are looking up for religious freedom in China? If so, what did it mean when the Rev. coach outlet
    The company s website will continue to function, and the chain plans to honor warranties on items purchased at its stores or online 锘?a href=http://www.coachonlineoutlet.us.com/>coach outlet online It’s anyone’s guess as to what she might be … most think she has some cattle dog relatives out there but the only way to know for sure is a DNA test. http://www.coachonlineoutlet.us.com
    “The crowd was very worked up — and not in a good way,” she said. “It was like something you’d expect to see in Germany in the ’30s.” coach outlet store online Eurest Pushcart No. l coach outlet stores
    The veteran found the end zone twice in a win over Atlanta last week and logged a season-high nine carries that he turned into 32 yards. http://www.coachonlineoutlet.us.com Arizona Wildcats running back Ka’Deem Carey pleaded not guilty Thursday to misdemeanor assault and disorderly conduct charges stemming from a December domestic violence incident involving his pregnant ex-girlfriend.
    President <a href="http://www. coach outlet stores Such a collision could have been “catastrophic,” they added.
    The book seemed to be a hit at Pulpcon and the attendees there quickly learned who I was. coach outlet “I can tell you for a fact Gary (Bettman, the NHL’s commissioner), in making this decision, had the situation in St.
    Last year, it , offering them for free online. 锘?a href=http://www.coachonlineoutlet.us.com/>coach outlet online Sponsor is CHI St.
    y They are attracted to light and may try to sneak in on you. coach outlet com and follow her on Facebook.
    “Rather, instead, a look of surprise, and then concern, before someone steps in and shows you the way. coach outlet Winners will be contacted with their ticket details. f http://www.coachonlineoutlet.us.com
    Actressperformer (BravoTV s “The New Atlanta”) Africa Miranda ) coach outlet “There’s less mollycoddling of children in Denmark.
    y Erving J. Laware, Thomas G. Laware, Donald F. Laware and Mary A. Pias to Anthony J. Tranghese, 80 Main St., $175,000. coach outlet store online Soon after we married, his job changed and we moved to Las Vegas. s
    And then Sanders just changes the subject. coach outlet stores Barr have of that?” he asked Warner. coach outlet
    “I am not able to recall all the details of what transpired, but I do know there was an altercation involving myself and two or three other individuals. Security was called and I was arrested for misdemeanor simple battery by NOPD,” the statement reads, though using the wrong charge. Brown was arrested for domestic simple battery. http://www.coachonlineoutlet.us.com Katherine Durham from the Unity Health Cardiology Clinic. k 锘?a href=http://www.coachonlineoutlet.us.com/>coach outlet online
    ” But while Jack Bauertries to save the world — through whatever means possible — in 24hours, I have about 24 emminutesem to shop when I’ve got a kidin tow. coach outlet store online Quarterfinals, 2 p.
    Inside, visitors are greeted by a light-filled room with windows extending from the floor level up the 18-foot wall that swoops down to nine feet at the kitchen level. http://www.coachonlineoutlet.us.com EllisWatson shared her award with Mississippi State’s Cornelia Griesche. h coach outlet
    AVAILABLE ON DIGITAL HD FEBRUARY 2, 2016 BLU-RAY? COMBO PACK, DVD AND ON DEMAND FEBRUARY 16, 2016 FROM UNIVERSAL PICTURES HOME ENTERTAINMENT 锘?a href=http://www.coachonlineoutlet.us.com/>coach outlet online A lot of the economy was also devastated.

    [回复]

评论分页
1 2 41240
  1. 2010年4月30日05:33 | #1
:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: