I’m sure other people have equally clever tricks, but this lets me use one repository for one Emacs configuration that varies slightly on each host. The custom-file trick there ensures that if I make the mistake of using M-x customize the changes wind up cordoned off in the per-host file. This file is really establishing two naming conventions: one for all my mode-specific crap and one for all my host-specific crap. (let ((host-file (format "~/.emacs.d/hosts/%s.el" system-name))) (dolist (file (file-expand-wildcards "~/.emacs.d/init/*.el")) My ~/.emacs.d/init.el is actually very short: load all my initialization files So it happens that I have a fairly complex configuration now, but most of my settings are either host-specific or mode-specific. Every other editor on earth proudly advertises that it will indent properly by doing it after a newline, so Emacs should too: (global-set-key (kbd "RET") 'newline-and-indent)įinally, because Emacs has more keybindings than you can ever hope to master, let it tell you when it has a quicker way to do something than the M-x long-ass-name abomination you just used: (setq suggest-key-bindings t) Now global key bindings are a treacherous territory but I think this one is completely obvious. In practice nobody wants this ever, so shut it down: (setq indent-tabs-mode nil) (setq make-backup-files nil)Įmacs by default is configured to be some kind of idiot savant about indentation, switching between tabs and spaces as necessary to achieve the layout of your dreams. Now let’s disable those hideous backup files. Fundamental mode is even more useless than Lisp mode to me. Of course you could put a language mode in there if you mostly edit a particular language, but I find I usually have no idea what I’m up to when I start it up so text mode is more honest. Let’s make it sensible: (setq default-major-mode 'text-mode) (setq inhibit-startup-message 't)Įmacs defaults, in a depressingly predictable manner, to Lisp mode, as if that’s something you give a shit about. (setq column-number-mode t)Įmacs loves to tell you that it is Emacs and how proud you should feel for using it, so you actually have to modify bunches of settings to really make it clear to Emacs that you just don’t care about it or its feelings. Impossibly, it will tell you the current line but not the current column by default. But it’s 2013, and nobody does this, and nobody should, because everything that matters either ignores the extra space (HTML) or typesets properly despite it (TeX). (setq visible-bell t)Įmacs by default thinks that you use the computer as if you emerged from some kind of 1970s typing class and your instructor took points off if you put a single space after the period. While learning Emacs, it’s going to beep at you a lot. If you don’t set this Emacs may think you’re some kind of ISO-9660-1 jackass. My life with Emacs utterly sucked until I found out about the following settings. So it’s a real shame that I continue this post by telling you how I set up Emacs and how amazing it is, finally, after basically a decade of ignoring it, to actually use it. It has a console mode, sensible modern keybindings, and it’s scripted in freaking Lua. Let me take a break here to make something really clear. Most recently this culminated in trying out Textadept. So I’ve slowly grown to resent Emacs over the years, and I made a point of trying out new editors pretty frequently. I never really achieved the fluence I had with Vim after switching from Emacs (though I did lose what I had with Vim). In 2003 I had already had my first glimpse of RSI so I switched to the Dvorak keyboard layout and bought myself a beautiful Kinesis Ergo keyboard.įor some reason I decided this would be a good time to switch to Emacs, so I did. When I first started getting serious about Unix around the turn of the century I got really hard into Vim.
0 Comments
Leave a Reply. |