Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingmachine committed Aug 6, 2013
0 parents commit 15b6c82
Show file tree
Hide file tree
Showing 25 changed files with 2,923 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*~*
*#*
elpa
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

141 changes: 141 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Emacs Starter Kit

The Starter Kit provides a more pleasant set of defaults than you get
normally with Emacs. It was originally intended for beginners, but it
offers a nicely augmented working environment for anyone using Emacs.

The latest release is at http://marmalade-repo.org/packages/starter-kit
with the source at http://github.com/technomancy/emacs-starter-kit

## Learning

This won't teach you Emacs, but it'll make it easier to get
comfortable. To access the tutorial, press control-h followed by t.

You may also find the commercial [PeepCode Meet Emacs
screencast](http://peepcode.com/products/meet-emacs) helpful. The
[Emacs Wiki](http://emacswiki.org) is also very handy.

## Installation

You'll need Emacs 24, which comes with package.el. It's not hard to
compile [from source](http://github.com/emacsmirror/emacs), but
precompiled versions are readily available for
[Debian-based systems](http://emacs.naquadah.org/),
[Mac OS X](http://emacsformacosx.com/builds), and
[Windows](http://code.google.com/p/emacs-for-windows/updates/list).

If you need to maintain compatibility with Emacs 23 or 22, you need to
use [version 1](https://github.com/technomancy/emacs-starter-kit/tree/master).

Add Marmalade as a package archive source in ~/.emacs.d/init.el:

```Lisp
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
````
Then you can install it:
M-x package-refresh-contents
M-x package-install RET starter-kit RET
Other modules are also available:
* starter-kit-bindings (spun out due to concerns about keybinding conventions)
* starter-kit-eshell
* starter-kit-js
* starter-kit-ruby
* starter-kit-perl
* starter-kit-lisp (enhances Emacs Lisp, Clojure, Scheme, and Common Lisp)
These modules are installed separately from the base Starter Kit package.
It's recommended to create a list of packages in init.el which will be
installed if they are found to not be present:
```Lisp
(when (not package-archive-contents)
(package-refresh-contents))
;; Add in your own as you wish:
(defvar my-packages '(starter-kit starter-kit-lisp starter-kit-bindings)
"A list of packages to ensure are installed at launch.")
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
```
That way you can be ensured of a consistent experience across machines.

There are a few conventions for naming files which will get loaded
automatically. ~/.emacs.d/$USER.el as well as any files in the
~/.emacs.d/$USER/ directory. Finally, the Starter Kit will look for a
file named after the current hostname ending in ".el" which will allow
host-specific configuration.

The Starter Kit used to be a git repository that you checked out and
used as your own personal .emacs.d directory, but it's been
restructured so that it can be treated like any other package, freeing
you up to structure your .emacs.d directory as you wish. See
"Upgrading" below.

## FAQ

**Q:** When I try to create a new file or buffer, the autocompletion is eager and tries to use the name of an existing file or buffer.
**A:** That's called <tt>ido-mode</tt>, and it's awesome! But sometimes it
gets in the way. To temporarily disable it, press C-f while the
prompt is open. You can also press C-j while it's still enabled to
force the creation of the name.

**Q:** When I'm writing Javascript, all my functions show up as ƒ. Am I going insane?
**A:** That's actually a render-time hack. The file on disk shows as
"function", but it's just rendered using the script F in order to
tone down the verbosity inherent in the language a bit. The same
happens with <tt>fn</tt> in Clojure and <tt>lambda</tt> to λ in
other lisps.

**Q:** I can't delete parentheses in Lisp!
**A:** To be specific, you can't delete parenthesis if deleting the
parentheses would result in invalid structure. That's called
Paredit, and once you get used to it, you'll wonder how you ever did
anything without it. But it can be disorienting at first. When
paredit tries to stop you from deleting something, you're probably
trying to delete something you shouldn't. Use C-k to kill whole
expressions. Two things to remember: you can always use C-w to kill
a region regardless of Paredit's rules, and you can always insert a
single character like a close-paren by prefixing it with C-q. You
may find
[the Paredit cheat sheet](http://www.emacswiki.org/emacs/PareditCheatsheet)
or
[this Paredit walkthrough](https://github.com/technomancy/paredit-screencast/blob/master/outline.markdown)
helpful. You can also enable paredit for non-lisp modes using the
<tt>esk-paredit-nonlisp</tt> function.

**Q:** How awesome is Emacs?
**A:** So awesome.

## Upgrading

Users of the old version of the Starter Kit (version 1) should be able
to upgrade easily. Move your old Starter Kit checkout at
<tt>~/.emacs.d</tt> out of the way and create a new directory
containing <tt>init.el</tt> with the lines above. Copy your
<tt>username.el</tt> and <tt>username</tt> directory from your old
checkout into the new <tt>~/.emacs.d</tt>. You should be able to check
this new directory into your main dotfiles repository instead of
keeping it separate.

The main difference in version 2 is that the new one doesn't pull in a
bunch of other package.el dependencies; users may pick and choose
which they want, including language-specific modules. Read
[more about the differences with version 1](http://technomancy.us/153).

## Copyright

Copyright © 2008-2011 Phil Hagelberg and contributors

Files are licensed under the same license as Emacs unless otherwise
specified. See the file COPYING for details.
20 changes: 20 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Emacs Starter Kit — History of User-Visible Changes

## 2.0.3 / 2011-10-11

* Update ido-ubiquitous to work better with M-x rgrep.
* Save smex command history between Emacs launches.

## 2.0.2 / 2011-09-13

* Add elisp-slime-nav dependency.
* Add smex dependency.
* Add find-file-in-project dependency.
* Make pretty-fn and pretty-lambda easier to disable.
* Spin off eshell into its own module
* Remove functionality deprecated by ubiquitous-ido.
* Enable ido virtual buffers.

## 2.0.1 / 2011-06-21

* First version 2 release as package.
25 changes: 25 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
'("tromey" . "http://tromey.com/elpa/") t)
(package-initialize)

(when (not package-archive-contents)
(package-refresh-contents))

;; Add in your own as you wish:
(defvar my-packages '(starter-kit
starter-kit-lisp
starter-kit-bindings
starter-kit-ruby
clojure-mode
clojure-test-mode
nrepl
auto-complete
ac-nrepl)
"A list of packages to ensure are installed at launch.")

(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
121 changes: 121 additions & 0 deletions modules/starter-kit-bindings.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
;;; starter-kit-bindings.el --- Saner defaults and goodies: bindings
;;
;; Copyright (c) 2008-2010 Phil Hagelberg and contributors
;;
;; Author: Phil Hagelberg <[email protected]>
;; URL: http://www.emacswiki.org/cgi-bin/wiki/StarterKit
;; Version: 2.0.2
;; Keywords: convenience
;; Package-Requires: ((starter-kit "2.0.2"))

;; This file is not part of GNU Emacs.

;;; Commentary:

;; "Emacs outshines all other editing software in approximately the
;; same way that the noonday sun does the stars. It is not just bigger
;; and brighter; it simply makes everything else vanish."
;; -Neal Stephenson, "In the Beginning was the Command Line"

;; This file just contains key bindings.

;;; License:

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

;;;###autoload
(progn
;; It's all about the project.
(global-set-key (kbd "C-c f") 'find-file-in-project)

;; You know, like Readline.
(global-set-key (kbd "C-M-h") 'backward-kill-word)

;; Completion that uses many different methods to find options.
(global-set-key (kbd "M-/") 'hippie-expand)

;; Perform general cleanup.
(global-set-key (kbd "C-c n") 'esk-cleanup-buffer)

;; Turn on the menu bar for exploring new modes
(global-set-key (kbd "C-<f10>") 'menu-bar-mode)

;; Font size
(define-key global-map (kbd "C-+") 'text-scale-increase)
(define-key global-map (kbd "C--") 'text-scale-decrease)

;; Use regex searches by default.
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "\C-r") 'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") 'isearch-forward)
(global-set-key (kbd "C-M-r") 'isearch-backward)

;; Jump to a definition in the current file. (Protip: this is awesome.)
(global-set-key (kbd "C-x C-i") 'imenu)

;; File finding
(global-set-key (kbd "C-x M-f") 'ido-find-file-other-window)
(global-set-key (kbd "C-c y") 'bury-buffer)
(global-set-key (kbd "C-c r") 'revert-buffer)

;; Window switching. (C-x o goes to the next window)
(windmove-default-keybindings) ;; Shift+direction
(global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1))) ;; back one
(global-set-key (kbd "C-x C-o") (lambda () (interactive) (other-window 2))) ;; forward two

;; Start eshell or switch to it if it's active.
(global-set-key (kbd "C-x m") 'eshell)

;; Start a new eshell even if one is active.
(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t)))

;; Start a regular shell if you prefer that.
(global-set-key (kbd "C-x C-m") 'shell)

;; If you want to be able to M-x without meta (phones, etc)
(global-set-key (kbd "C-c x") 'execute-extended-command)

;; Help should search more than just commands
(global-set-key (kbd "C-h a") 'apropos)

;; Should be able to eval-and-replace anywhere.
(global-set-key (kbd "C-c e") 'esk-eval-and-replace)

;; M-S-6 is awkward
(global-set-key (kbd "C-c q") 'join-line)

;; So good!
(global-set-key (kbd "C-c g") 'magit-status)

;; This is a little hacky since VC doesn't support git add internally
(eval-after-load 'vc
(define-key vc-prefix-map "i"
'(lambda () (interactive)
(if (not (eq 'Git (vc-backend buffer-file-name)))
(vc-register)
(shell-command (format "git add %s" buffer-file-name))
(message "Staged changes.")))))

;; Activate occur easily inside isearch
(define-key isearch-mode-map (kbd "C-o")
(lambda () (interactive)
(let ((case-fold-search isearch-case-fold-search))
(occur (if isearch-regexp isearch-string (regexp-quote isearch-string)))))))

(provide 'starter-kit-bindings)
;;; starter-kit-bindings.el ends here
Loading

0 comments on commit 15b6c82

Please sign in to comment.