Live data from Hacker News

Ask HN Emacs Users: What's in your .emacs file?

news.ycombinator.com

61–67 of 67 posts

Re: Ask HN Emacs Users: What's in your .emacs file?

#61

Paredit, slime, magit, org-mode, eshell, and erc. The boring stuff is all in the Starter Kit: http://github.com/technomancy/emacs-starter-kit

Emacs Starter Kit allowed me to finally switch to Emacs last year. Thanks a lot technomancy!

I keep my customizations here: http://github.com/dirceu/emacs-starter-kit

Re: Ask HN Emacs Users: What's in your .emacs file?

#62
From my customizations, these are the most I use:

Pressing Return starts a new line at column 0, pressing Control j starts a new indented line. I prefer them the other way round, so I rebind:

    (global-set-key "\r" 'newline-and-indent)
    (global-set-key "\C-j" 'newline)
Also, very often I need to start a new line above or below the current line. So instead of Control e, Return to start a new indented line below the current line I use Control Return.

    (defun next-newline-and-indent ()
      (interactive)
      (end-of-line)
      (newline-and-indent))
    (global-set-key [C-return] 'next-newline-and-indent)
And to start a new indented line above the current line, instead of Control a, Control o, Control i, I use Control Shift Return.

    (defun prev-newline-and-indent ()
      (interactive)
      (beginning-of-line)
      (open-line 1)
      (indent-according-to-mode))
    (global-set-key [C-S-return] 'prev-newline-and-indent)

Re: Ask HN Emacs Users: What's in your .emacs file?

#63
post #23

My .emacs is on GitHub: http://github.com/avar/dotemacs/blob/master/.emacs along with the elisp library I use http://github.com/avar/elisp Some noteworthy things: It's a ~1200 line file (and expanding) this is how I navigate it: (defun show-dot-emacs-structure () "Show the outline-mode structure of ~/.emacs" (interactive) (occur "^;;;;+")) Which shows the outline of the file, e.g.: 74 matches for "^;;;;+" in buffer:…

If you want something that guesses indentation style automatically, you could try guess-style.el:

http://nschum.de/src/emacs/guess-style/

Re: Ask HN Emacs Users: What's in your .emacs file?

#64
I have my Emacs config here: http://github.com/nileshk/emacs

startup.el is the main starting point (I load that from my .emacs). Can't say it's the cleanest set of config files, but you might find something of use in it.

Some of the things I've configured:

- Detect whether Emacs is running in OS X, Linux, Windows (native), or Cygwin; and I do platform-specific configuration when necessary

- For OS X, I use fixpath.el to load my path by executing bash (I've tried various methods of doing this, and this was the most reliable)

- For Windows, I have Powershell configured

- I'm using guess-style ( http://nschum.de/src/emacs/guess-style/ ): auto-detects indentation style.

- I had a Clojure setup that was working nicely, but it's been a while since I used it and I need to update it for Clojure 1.2

- ido-mode is great. I have some specific settings for that. For example, enabling ido-enable-flex-matching makes it easier to quickly match files

- Backups go to ~/.emacs.d/backup instead of littering ~ files everywhere. The backup folder is created if necessary.

- YASnippets. I've created some snippets of my own, such as for wikipedia-mode

- I had problems using markdown-mode with YASnippets (both want to use the tab key), but was able to fix this. See my "eval-after-load 'markdown-mode" for this.

If you use YASnippet, I've taken Jeff Wheeler's Textmate-to-YASnippet conversion script and improved it here: http://github.com/nileshk/snippet-copier That also contains a Eclipse template to YASnippet convertor script I started on which kinda works, though not perfectly.

Re: Ask HN Emacs Users: What's in your .emacs file?

#65
Custom key bindings

  ;; Makes editing without Paredit more convenient... 
  ;; But if you're on linux, first prevent it from logging you out!
  (global-set-key [C-M-delete] 'backward-kill-sexp)
  (global-set-key [C-M-backspace] 'backward-kill-sexp)

  ;; Command key meta forever.
  (labels ((normal-mac-mods (&rest _) (setq ns-alternate-modifier 'none
                                            ns-command-modifier 'meta)))
    (add-hook 'after-make-frame-functions #'normal-mac-mods)
    (normal-mac-mods))
Aesthetics

  (setq-default ...

                ;; Make the default buffer a little shinier... also, put
                ;;   (message "Ready")
                ;; at the end of the file

                initial-major-mode 'text-mode
                initial-scratch-message (concat "                  ···"
                                                "--—=====   Welcome to Emacs"
                                                "   =====—--···\n===---···"
                                                "                 "
                                                "···---================---···"
                                                "                ···---===\n\n")
Post reply on HN