TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Emacs users on OS X, what's your setup?

73 点作者 shutter超过 16 年前
I'm slowly getting up to speed with Emacs, switching from TextMate. There are a lot of ways to use emacs on Mac, from Aquamacs to Carbon Emacs to the Cocoa port of GNU Emacs. I've dabbled in each a little bit.<p>I'm most interested to hear your thoughts on keybinding (and which Emacs distribution you use). I like the thought of keeping Mac shortcuts consistent a-la Aquamacs (having CMD-Q still bound to exit, etc), but it seems like the Option key is too poorly-placed to be a useful Meta key.<p>(I've bound Caps-lock to Ctrl.) It seems like binding CMD-&#62;Meta and CTRL as Control would provide the best placement ergonomically, but obviously you then lose the standard Mac keybindings when in Emacs.<p>What does your Emacs setup look like?

39 条评论

how_gauche超过 16 年前
I'm an old hand in Emacs and new to the Macintosh, so I use Cocoa Emacs.app because it's closest to the "standard" distribution, and override the Mac keybindings. I avoid using the mouse (those things are very bad for the wrists), so my .emacs turns the toolbar, menubar, and scrollbars off -- just a plain white screen.<p>I use a 25" widescreen LCD, and I like to jack up the font size until I get about 200 characters across; this lets me hold two 100x47 buffers side by side, which is how I prefer to work. Most of my interaction with the computer (besides web) goes through Emacs -- eshell, gnus, bbdb, calendar/diary, planner, etc.
jimbokun超过 16 年前
I seem to be the only one here who likes how Aquamacs uses both Mac and Emacs key bindings. I find myself using both. There is probably some reason I sometimes use the Emacs kill/yank/etc. vs. when I use Mac cut/copy/paste, but I'm not sure what it is.<p>I also use Emacs in Windows and Unix at work, but I imagine it is sitting in front of my Mac that triggers the cmd key bindings in my head. Maybe it's just that, with Aquamacs, whatever key binding first pops into my head will probably work, so I don't have to worry about context switching so much.<p>I also agree that Option is the right key to use for Meta. I don't think I would ever get used to pressing cmd and not having it activate the Mac key bindings. Probably because I have been using Macs in some capacity since 1987.<p>The other "Mac-like" thing about Aquamacs is how it pre-bundles so many of the useful modes. Going out and loading each mode you want one at a time and tweaking it just so seems so Linux to me. I like how Aquamacs tries to give you something that Just Works for most of what you want it to do, instead of something more bare bones that you are expected to configure out the wazoo. I discovered both SBCL and Aquamacs when I wanted to learn Common Lisp, and Aquamacs coming with SLIME pre-installed made one less thing I had to fuss with.
评论 #466422 未加载
评论 #466627 未加载
评论 #466883 未加载
tjweir超过 16 年前
Here are two setup descriptions from Clojure guys: <a href="http://paulbarry.com/articles/2008/07/02/getting-started-with-clojure-and-aquamacs" rel="nofollow">http://paulbarry.com/articles/2008/07/02/getting-started-wit...</a><p><a href="http://bc.tech.coop/blog/081205.html" rel="nofollow">http://bc.tech.coop/blog/081205.html</a><p>They are skewed to Clojure development, but you may be able to pick out a few tips.
mmc超过 16 年前
I long used emacs in X11, but recently switched to Aquamacs out of sheer laziness - not wanting to recompile emacs+gtk for my new intel mac. I've tried all the various ports, and Aquamacs is my favorite 'native' port, but I actually miss the X11+gtk build I used before. There's something to be said for an emacs that feels like emacs :)<p>I agree that the option key is no good as Meta - Cmd is Meta in my setup.<p>I absolutely override the Mac keybindings. I like having M-Q as fill-paragraph, and I found that other useful commands were being hijacked by useless OS X Text Services (like M-&#62; for end of buffer got stolen by OmniOutliner)<p>I have a large 1920x1200 display that I tend to use with one emacs frame maximized, and some arrangement of windows inside that frame - most often I have a full height window on the left, and two half-height windows on the right. Sometimes I use three columns of windows, and other times four equal-sized windows makes sense.<p>One of those windows is almost always running zsh inside ansi-term (M-x ansi-term). Some prefer shell-mode, but I think ansi-term and zsh are more useful. I don't think shell-mode and zsh cooperate too well.<p>Most of my work is done in python, and I just started using pymacs and ropemacs, which seem useful. Notes on them are here: <a href="http://www.enigmacurry.com/2008/05/09/emacs-as-a-powerful-python-ide/" rel="nofollow">http://www.enigmacurry.com/2008/05/09/emacs-as-a-powerful-py...</a>
评论 #466884 未加载
saikat超过 16 年前
Bill Clementson has a nice write up on his setup that has more to do with how not to get hurt using Emacs that I have found very helpful. Not necessarily specific to OS X, but he has a few suggestions that seem helpful for OS X (like making the right apple key your meta key):<p><a href="http://bc.tech.coop/blog/041024.html" rel="nofollow">http://bc.tech.coop/blog/041024.html</a><p><a href="http://bc.tech.coop/blog/041029.html" rel="nofollow">http://bc.tech.coop/blog/041029.html</a><p><a href="http://bc.tech.coop/blog/060116.html" rel="nofollow">http://bc.tech.coop/blog/060116.html</a><p><a href="http://bc.tech.coop/blog/060131.html" rel="nofollow">http://bc.tech.coop/blog/060131.html</a>
cpr超过 16 年前
I use Terminal-based Emacs exclusively. Couldn't stand all the "distractions" (bells and whistles) of Aquamacs. But, more importantly, with this mode I can use Emacs everywhere, including my servers over ssh, with exactly the same setup.<p>I bind Option to Meta in Terminal.app and that works very well.
评论 #466082 未加载
评论 #466402 未加载
评论 #466080 未加载
humanzee超过 16 年前
Carbon Emacs : <a href="http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html" rel="nofollow">http://www.apple.com/downloads/macosx/unix_open_source/carbo...</a><p>+ Emacs Starter Kit: <a href="http://github.com/technomancy/emacs-starter-kit/tree/master" rel="nofollow">http://github.com/technomancy/emacs-starter-kit/tree/master</a><p>+ yasnippet: <a href="http://code.google.com/p/yasnippet/" rel="nofollow">http://code.google.com/p/yasnippet/</a><p>+ paredit: <a href="http://www.emacswiki.org/emacs/ParEdit" rel="nofollow">http://www.emacswiki.org/emacs/ParEdit</a><p>+ Clojure mode: <a href="http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Started#Editors.2FIDEs" rel="nofollow">http://en.wikibooks.org/wiki/Clojure_Programming/Getting_Sta...</a><p>+ Re-mapped Ctrl to Caps. Carbon Emacs defaults Meta to the Command key, which I kept.
ivey超过 16 年前
I pull every now and then from git://repo.or.cz/emacs.git, and build my own with --with-ns. I was using CarbonEmacs, but multi-tty support is amazing. I have my main Emacs frames running, and if I need to pop into a quick session in a terminal, or SSHd in from another machine, it Just Works.<p>(Except the theme I'm using has very light colored comments, and I can't see them in 8 color terminal. Anyone have a suggestion for a 256 color terminal app?)<p>I don't use Mac copy-paste, etc, even though I was a Mac user long before I was an Emacs user. Using C-y and M-y reminds me of the kill ring everytime, where using C-v wouldn't. I <i>do</i> have the clipboard synced to the top of the kill ring though...not sure if that was a default.<p>I use Command as Meta, and have Caps Lock for Control system-wide.
评论 #467098 未加载
larrywright超过 16 年前
Here's mine: <a href="http://github.com/larrywright/emacs/" rel="nofollow">http://github.com/larrywright/emacs/</a><p>It's mostly stuff borrowed from other people, but it gives you a good starting point with Ruby/Rails support, Twitter integration, snippets, etc. I use it at home and work (Mac and Windows respectively), and it works well for me.
评论 #465905 未加载
1gor超过 16 年前
Don't worry too much about standard Mac keybindings.<p>Emacs shortcuts will soon be wired into your fingertips and you will be efficient on any platform - windows, linux and mac. In fact, you will very soon forget about the platform and focus on your work at hand.<p>That's the reason old hands prefer to stick with traditional emacs keyboard interface. Dumping some Mac idiosyncrasies is a small price to pay for the freedom and power.
ctp超过 16 年前
Cocoa Emacs.app built from CVS - followed instructions from here: <a href="http://www.emacswiki.org/emacs/EmacsForMacOS" rel="nofollow">http://www.emacswiki.org/emacs/EmacsForMacOS</a><p>Scroll down to section 'Build from source' - note the comment to build from the 'nextstep' directory. I just followed the instructions in 'nextstep/INSTALL')<p>This is working for me, so far... a good way to get a 'vanilla' install.
评论 #466097 未加载
wfarr超过 16 年前
Stay away from Aquamacs. It is for all intents and purposes, Emacs, but with all the useful stuff watered down in an attempt to make it fit in better with Mac OS.<p>My config is here: <a href="http://github.com/wfarr/dotfiles/" rel="nofollow">http://github.com/wfarr/dotfiles/</a>
tconfrey超过 16 年前
One thing I find useful is the Its All Text! add-on for Firefox. It lets me use emacs as an external editor for any browser text area. Its ideal for blog entries, web mail or any filling in text in a small text entry area (like this one on HN!).<p>In addition to giving me all the power of emacs editing, getting the text inside emacs means I can more easily use templates, save stuff off in text files etc.<p>You need to start an emacs server in your .emacs: (server-start). I also (add-hook 'text-mode-hook 'flyspell-mode) so that I get spell correction. With my setup I just control-e in any text area and it pops open a new buffer in my emacs session.
评论 #466831 未加载
spydez超过 16 年前
I use Cocoa Emacs.app. The only major keybinding change I've done so far (in 2 or 3 months of using Emacs on OS X) is Caps-&#62;Ctrl. Getting to alt/option is a thumb-contortion, so I'll probably try out Cmd-&#62;Meta soon. Only thing holding me back is the convenience of Cmd+C/X/V.<p>Cocoa Emacs /does/ have Mac shortcuts on by default. Not sure if they're all there, but save, cut, copy, and paste are certainly bound to the proper OS X shortcut.<p>As for Aquamacs, I tried it first, but had major issues trying to get it to accept my .emacs. It tries to save a ton of crap to custom-set-variables, including things I set via setq to keep my .emacs file logically laid out. It also tried to save my <i>entire color-theme</i> to custom-set-faces, which is an idiotic thing to do; the color-theme takes up 1111 lines in a nice elisp file off on it's own - why try to stuff it in custom-set-faces?<p>Anyways, just a warning - you may have issues if you try to give Aquamacs a largish .emacs file you've built up over the years on other systems. But that's probably not a problem for you since you're coming from TextMate.<p>I use the same .emacs at work (WinXP) as I do at home on my Mac and Linux machines, and Cocoa Emacs played well with it with minute adjustments, so I went with it.
marcher超过 16 年前
I started off with MacPorts&#x27; Emacs 22.3 package and just used it on the command line. Eventually I moved to a portfile that tracked Emacs CVS, and finally settled on Aquamacs.<p>I&#x27;ve tried Cocoa Emacs from CVS, but it has one major problem that makes it unusable for me: no fullscreen support. The latest version of Aquamacs does this perfectly. I have an entire space dedicated to Aquamacs, and I send files to it from Terminal with emacsclient.<p>I too have capslock bound to control. I don&#x27;t have any other keyboard modifications. I&#x27;m used to option&#x2F;alt working the same in Emacs and every other OS X application (try alt+left&#x2F;right&#x2F;backspace&#x2F;delete in an input box).<p>My ~&#x2F;.emacs doesn&#x27;t have a lot of OS X-specific settings. My favorite thing about my setup right now is having Pyflakes automatically highlight errors in my Python code as I write it. Flyspell in strings and comments is also great.<p>If you&#x27;re interested, my ~&#x2F;.emacs is here: [link redacted]
kapitti超过 16 年前
From Jim Weirich, of Rake fame:<p><a href="http://github.com/jimweirich/emacs-setup/tree/master" rel="nofollow">http://github.com/jimweirich/emacs-setup/tree/master</a><p>Also, a starter emacs kit for rubyists:<p><a href="http://github.com/jimweirich/emacs-starter-kit/tree/master" rel="nofollow">http://github.com/jimweirich/emacs-starter-kit/tree/master</a>
travisjeffery超过 16 年前
I'm using the Cocoa Emacs.app cause it's most like the old Emacs, no new keybindings like Aquamacs has.
tlb超过 16 年前
I've been using Emacs for 20 years, and fully converted my desktops to Mac last year.<p>I like Aquamacs OK with option-&#62;meta and caps lock -&#62; control like you have. With that setup, it's a bit of a twist to get my pinky finger onto meta, but it's tolerable on my Microsoft Natural keyboard.<p>The biggest nuisance is that I can't figure out how to bind function keys. I liked having F2 = goto-line (rather M-g g) and F3 = compile.<p>After 20 years of Emacs, I've actually started to like Cmd-c and Cmd-v rather than C-k and C-y.<p>Also, the scroll wheel on the Mighty Mouse works pretty well in Aquamacs. Though you do have to clean the scroll wheel (by rolling it around on your pants) every few days.
评论 #467261 未加载
jwr超过 16 年前
I use CVS builds of GNU Emacs, they work great. Just check the source out from CVS and './configure --with-ns; make install' will produce an Emacs.app for you to drag to Applications.<p>The only problems I have is a bug where if you resize your window at least once, it will cause annoying flashes during redraw (but I almost never resize my emacs window, so that's not an issue) and that I would like more integration with the OS.<p>On the latter front, I already started calling NS services from Emacs (ns-service-Things-add-item-as-Note). This is very cool. What I'd like is more of an ability to customize what Emacs does when it is called to open a file.<p>I remap Caps Lock to Ctrl.
dannywoodz超过 16 年前
I use Emacs on Windows, Mac and Linux, so I generally like the normal Emacs keybindings on everything. That way, it's equally alien/consistent on all platforms, and I just start 'thinking in Emacs'. I use Carbon Emacs on the Mac.<p>I keep my .emacs and a tree of elisp files (things like ecb, magit, slime, etc.) in my git repository, which I update and sync across the machines I use: this gives me a great deal of consistency across platforms.<p>One alteration I make on all platforms is to remap the caps lock key as a second control key: caps lock is useless, and the number of times you have to reach for control in Emacs makes it worthwhile making it easy.
martenveldthuis超过 16 年前
I use GNU Cocoa Emacs built from source. This port does the most common cmd-x,c,v,q etc, which helps me transition. I'm typing on an IBM Model M attached to my Mac, so I've mapped CAPS to Command to maintain that key. I'm fine with the placement of the ctrl and option keys.<p>My config is at <a href="http://www.github.com/marten/emacs.d/" rel="nofollow">http://www.github.com/marten/emacs.d/</a> It contains a couple of useful fixes (such as Cocoa apps not getting the PATH var from the shell). It's got plenty comments. I should try turning more stuff into autoloads, I'm finding it on the slow side to start up right now.
dilap超过 16 年前
I'm new to OS X (from Windows, mostly, with MinGW), but old to emacs. In my brief investigations, I have found Carbon Emacs to be the most friendly -- mainly because it makes no attempts what-so-ever to fit in with the Mac keystrokes, which suits me fine. Like most other people, I bind caps-lock to control, which I recommend whatever your platform.<p>Now a brief question of my own: is there any way to map command to meta in the apple terminal???<p>I know about mapping option to meta, but it just ain't the same, especially when I hit command-W hoping to copy text and accidentally close my whole frickin' terminal.
fendale超过 16 年前
I just have Aquamacs with all the default bindings. Then I installed ECB and all the rails goodies, of which I use very few actually! Flymake is the most useful as it highlights syntax errors without even compiling.
评论 #466362 未加载
评论 #466357 未加载
rickd超过 16 年前
I use emacs in a terminal window for probably 75% of my editing, and textmate for the other 25- I have Aquamacs but couldn't get into the flow with it for some reason. I keep all the default keys for ctrl/etc, and it does help a bit that they newest macs have changed the enter key that used to be to the right of spacebar to alt.<p>While it's not really emacs, I generally do most of my development in Eclipse- but I change the keybindings to Emacs mode (window\preferences\general\keys). Makes eclipse <i>almost</i> nice to use.
评论 #466619 未加载
alexott超过 16 年前
There are small differencies between my Emacs setup for Mac OS X &#38; for Linux. You can find my configuration at <a href="http://xtalk.msk.su/~ott/common/emacs/_emacs.html" rel="nofollow">http://xtalk.msk.su/~ott/common/emacs/_emacs.html</a>, and macosx-specific configurations at <a href="http://xtalk.msk.su/~ott/common/emacs/rc/emacs-rc-local-flash.lan.el.html" rel="nofollow">http://xtalk.msk.su/~ott/common/emacs/rc/emacs-rc-local-flas...</a>
bulanga超过 16 年前
I use the native OSX emacs in the terminal with the fonts increased a fair bit. It loads really fast (~ 1 second) I tried Aquamacs but didn't like the fact that it was significantly slower when starting. I'm a new emacs user so I don't really see the need for all the bells and whistles the larger packages tend to offer. If I need anything I just install it from emacswiki.org. Also I found dotfiles.com quite useful for customising my setup.
adoyle超过 16 年前
I run a vncserver (from MacPorts) on my MacBook. Then inside there I do all my coding with Emacs, generally two frames side-by side. I access it via Chicken of the VNC. I set up the same vncserver setup on all the machines I do work on, and can access each one from any other without losing context. I rarely find the need to cut/paste from the OS X desktop into/out of my vnc windows, but it can be done.
jimm超过 16 年前
Emacs.app GNU Emacs 22.2.1 (i386-apple-darwin9.4.0, Carbon Version 1.6.0)<p>All my init files are check in to a repository at <a href="https://github.com/jimm/elisp/tree" rel="nofollow">https://github.com/jimm/elisp/tree</a><p>See <a href="http://www.io.com/~jimm/emacs_tips.html#my-dot-emacs" rel="nofollow">http://www.io.com/~jimm/emacs_tips.html#my-dot-emacs</a> for how I've set up the repository for different machines.
toffer超过 16 年前
Question for everyone who binds the Caps Lock key to CTRL:<p>If you use the Caps Lock key as CTRL, then it feels pretty awkward for me to type some key combinations (like ctrl-x or ctrl-c) and still keep my fingers on the "home row".<p>Do you just get used to this? Do you type ctrl-x with your pinky and ring finger? Or, do you shift your hand away from the home row and type ctrl-x with your pinky and middle finger?
评论 #466958 未加载
评论 #467068 未加载
msg超过 16 年前
Just like you say, Carbon Emacs + Caps-&#62;Control + Cmd-&#62;Meta. I dislike using Option as Meta, as you say.<p>This keyboard and setup is exactly the setup I have for Gnu Emacs on Solaris 8 that I have to use every day at work, and if I ever do serious work on Windows, I'll be able to remap Alt and Caps without trouble. The consistency of key placement is definitely helpful.
zitterbewegung超过 16 年前
Carbon emacs package (latest) Aquamacs is unstable at least the last time I used it. Anything.el makes emacs feel like quicksilver (which is AMAZING!!!). I use redshank (hacked version for scheme) + quack.el + paredit.el for my main environment. I have been trying to use darcs and the wiki page for notes but I haven't gotten into it.
bretthoerner超过 16 年前
Nightly from here: <a href="http://atomized.org/wp-content/cocoa-emacs-nightly/" rel="nofollow">http://atomized.org/wp-content/cocoa-emacs-nightly/</a><p>Config: <a href="http://github.com/bretthoerner/emacs-dotfiles/tree/master" rel="nofollow">http://github.com/bretthoerner/emacs-dotfiles/tree/master</a><p>I maintain a very OS X-y feel, among other things.
tsetse-fly超过 16 年前
I use Carbon Emacs because Cocoa Emacs has a black square in the center of the frame for the visual bell. Also, there's no visual separator between windows when you have your scroll bar/fringes turned off. Aquamacs is too exotic.
评论 #467437 未加载
olegshaldybin超过 16 年前
I use Cocoa Emacs.app. Here's my emacs config, carefully crafted for Rails development:<p><a href="http://github.com/olegshaldybin/emacs-config/tree/master" rel="nofollow">http://github.com/olegshaldybin/emacs-config/tree/master</a>
icey超过 16 年前
Kirubakaran has his emacs posted on github:<p><a href="http://github.com/ki/my-dot-emacs/blob/master/dot-emacs.txt" rel="nofollow">http://github.com/ki/my-dot-emacs/blob/master/dot-emacs.txt</a><p>It looked quite good to me.
paddy_m超过 16 年前
carbon-emacs. It's my first emacs ( I never used emacs on unix or NT). Carbon-Emacs seemed to keep more with emacs' UI guidelines compared to aquamacs. Note I think I'm running carbon emacs, I run the one with the purple logo.<p>I have the option key (windows key on this keyboard) mapped to Hyper. I use Hyper to navigate around emacs. H-(n|p|b|f) move up, down, left, or right one window in a frame<p>H-(N|P|B|F) change the size of the current window height/width<p>other hyper bindings open apps that I use regularly (shell, anything, sql)
评论 #466092 未加载
malkia超过 16 年前
I'm emacs newbie, and I do use Aquamacs, with separately downloaded SLIME, and custom .emacs (borrowed from many people - mainly from comp.lang.lisp)
mariorz超过 16 年前
Aquamacs, fn key is meta, panic sans 10 font, &#60;3 fullscreen-mode.
access_denied超过 16 年前
- Caps-lock == Ctrl - plist hacked so the whole system (at least cocoa-apps) behave emacs-like (Apple is meta) - carbon emacs, because (fullscreen, extensions work, like to have the default GNU set-up as a starting point, and there was 1 thing Cocoa Emacs did not right but I forgot what it was) - I use color themes a lot, I plan to have each major mode auto-choosing one; most of my .emacs pets are not implemented yet, in a way the real work tends to be more fascinating - org-mode as "productivity app" and backbone for DTP
评论 #466207 未加载