From e320f142636c5db25f0f3a786ce6c2ea41c36c06 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 5 Aug 2013 15:17:23 +0200 Subject: * removed dotfiles stuff, this is emacs.d only --- emacs.d/init-bindings.el | 46 -------- emacs.d/init-custom.el | 31 ----- emacs.d/init-eshell.el | 98 --------------- emacs.d/init-functions.el | 130 -------------------- emacs.d/init-mail.el | 18 --- emacs.d/init-modes.el | 51 -------- emacs.d/init-settings.el | 210 --------------------------------- emacs.d/init.el | 84 ------------- fish/config.fish | 23 ---- fish/functions/edit.fish | 3 - fish/functions/runhoogle.fish | 5 - fish/functions/runirc.fish | 3 - init-bindings.el | 46 ++++++++ init-custom.el | 31 +++++ init-eshell.el | 98 +++++++++++++++ init-functions.el | 130 ++++++++++++++++++++ init-mail.el | 18 +++ init-modes.el | 51 ++++++++ init-settings.el | 210 +++++++++++++++++++++++++++++++++ init.el | 84 +++++++++++++ plists/com.googlecode.iterm2.plist | Bin 13417 -> 0 bytes plists/org.pqrs.KeyRemap4MacBook.plist | Bin 394 -> 0 bytes plists/org.pqrs.PCKeyboardHack.plist | Bin 223 -> 0 bytes xnomad | 20 ---- zshrc | 63 ---------- 25 files changed, 668 insertions(+), 785 deletions(-) delete mode 100644 emacs.d/init-bindings.el delete mode 100644 emacs.d/init-custom.el delete mode 100644 emacs.d/init-eshell.el delete mode 100644 emacs.d/init-functions.el delete mode 100644 emacs.d/init-mail.el delete mode 100644 emacs.d/init-modes.el delete mode 100644 emacs.d/init-settings.el delete mode 100644 emacs.d/init.el delete mode 100644 fish/config.fish delete mode 100644 fish/functions/edit.fish delete mode 100644 fish/functions/runhoogle.fish delete mode 100644 fish/functions/runirc.fish create mode 100644 init-bindings.el create mode 100644 init-custom.el create mode 100644 init-eshell.el create mode 100644 init-functions.el create mode 100644 init-mail.el create mode 100644 init-modes.el create mode 100644 init-settings.el create mode 100644 init.el delete mode 100644 plists/com.googlecode.iterm2.plist delete mode 100644 plists/org.pqrs.KeyRemap4MacBook.plist delete mode 100644 plists/org.pqrs.PCKeyboardHack.plist delete mode 100644 xnomad delete mode 100644 zshrc diff --git a/emacs.d/init-bindings.el b/emacs.d/init-bindings.el deleted file mode 100644 index 2593ddd6d010..000000000000 --- a/emacs.d/init-bindings.el +++ /dev/null @@ -1,46 +0,0 @@ -;; Various keybindings, most of them taken from starter-kit-bindings - -;; 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 "M-%") 'query-replace-regexp) -(global-set-key (kbd "C-M-s") 'isearch-forward) -(global-set-key (kbd "C-M-r") 'isearch-backward) -(global-set-key (kbd "C-M-%") 'query-replace) - -;; Jump to a definition in the current file. (Protip: this is awesome.) -(global-set-key (kbd "C-x C-i") 'imenu) - -;; Ace-jump-mode -(global-set-key (kbd "M-j") 'ace-jump-char-mode) - -;; Jump to next occurence of char -(global-set-key (kbd "M-m") 'iy-go-to-char) - -;; Window switching. (C-x o goes to the next window) -(windmove-default-keybindings) ;; Shift+direction - -;; 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))) - -;; Eval sexp and replace it with result -(global-set-key (kbd "C-c e") 'esk-eval-and-replace) - -;; Start a regular shell if you prefer that. -(global-set-key (kbd "C-x C-m") 'shell) - -;; So good! -(global-set-key (kbd "C-c g") 'magit-status) - -;; Add a fullscreen toggle -(global-set-key (kbd "M-RET") 'toggle-frame-fullscreen) - -;; Replace standard goto-line with goto-line-with-feedback -(global-set-key (kbd "M-g g") 'goto-line-with-feedback) diff --git a/emacs.d/init-custom.el b/emacs.d/init-custom.el deleted file mode 100644 index 2b2916143f6d..000000000000 --- a/emacs.d/init-custom.el +++ /dev/null @@ -1,31 +0,0 @@ -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(custom-safe-themes - (quote - ("854dc57026d3226addcc46b2b460034a74609edbd9c14e626769ac724b10fcf5" "8eaa3bce3c618cd81a318fcf2d28c1cd21278531f028feb53186f6387547dfb4" "ea0c5df0f067d2e3c0f048c1f8795af7b873f5014837feb0a7c8317f34417b04" "a234f91f9be6ed40f6ce0e94dce5cea1b9f1ccec2b9ccd42bb71c499867a3fcc" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" "1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" "d6a00ef5e53adf9b6fe417d2b4404895f26210c52bb8716971be106550cea257" default))) - '(erc-modules - (quote - (autojoin button completion dcc irccontrols list log match menu move-to-prompt netsplit networks noncommands notifications readonly ring scrolltobottom stamp track))) - '(haskell-mode-hook - (quote - (capitalized-words-mode turn-on-haskell-decl-scan turn-on-haskell-doc turn-on-hi2))) - '(it-mode-google-cmd "/usr/local/share/python/google") - '(ns-alternate-modifier (quote none)) - '(ns-command-modifier (quote meta))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(rainbow-delimiters-depth-1-face ((t (:foreground "#2aa198")))) - '(rainbow-delimiters-depth-2-face ((t (:foreground "#b58900")))) - '(rainbow-delimiters-depth-3-face ((t (:foreground "#268bd2")))) - '(rainbow-delimiters-depth-4-face ((t (:foreground "#dc322f")))) - '(rainbow-delimiters-depth-5-face ((t (:foreground "#859900")))) - '(rainbow-delimiters-depth-6-face ((t (:foreground "#268bd2")))) - '(rainbow-delimiters-depth-7-face ((t (:foreground "#cb4b16")))) - '(rainbow-delimiters-depth-8-face ((t (:foreground "#d33682")))) - '(rainbow-delimiters-depth-9-face ((t (:foreground "#839496"))))) diff --git a/emacs.d/init-eshell.el b/emacs.d/init-eshell.el deleted file mode 100644 index 239a9980ce3e..000000000000 --- a/emacs.d/init-eshell.el +++ /dev/null @@ -1,98 +0,0 @@ -;; EShell configuration - -(require 'eshell) - -;; Generic settings -;; Hide banner message ... -(setq eshell-banner-message "") - -(defvar home-dir) -(setq home-dir (expand-file-name "~")) - -(defun eshell-mode-hook-setup () - "Sets up EShell when it is loaded" - - (setq eshell-path-env (concat - "/usr/local/bin:" - (concat home-dir "/bin:") - "/usr/local/share/python:" - eshell-path-env)) - - (setenv "PATH" eshell-path-env)) - -(add-hook 'eshell-mode-hook 'eshell-mode-hook-setup) - -;; Prompt configuration - -(defun clean-pwd (path) - "Turns a path of the form /foo/bar/baz into /f/b/baz - (inspired by fish shell)" - (message path) - (let* ((current-dir (split-string path "/")) - (cdir (last current-dir)) - (head (butlast current-dir))) - (concat (mapconcat (lambda (s) - (if (string= "" s) nil - (substring s 0 1))) - head - "/") - (if head "/" nil) - (car cdir)))) - -(setq eshell-pwd-convert-function - (lambda (path) - (clean-pwd (replace-regexp-in-string - home-dir - "~" - path)))) - -(defun vcprompt (&optional args) - "Call the external vcprompt command with optional arguments. - VCPrompt" - (replace-regexp-in-string - "\n" "" - (shell-command-to-string (concat "vcprompt" args)))) - -(defmacro with-face (str &rest properties) - `(propertize ,str 'face (list ,@properties))) - -(defun prompt-f () - "My EShell prompt displaying VC info and such" - (concat - (with-face (concat (eshell/pwd) " ") :foreground "#96a6c8") - (with-face (vcprompt " -f \"(%s:%b%a%m) \"") :foreground "#5f627f") - (if (= 0 (user-uid)) - (with-face "#" :foreground "#f43841") - (with-face "$" :foreground "#73c936")) - (with-face " " :foreground "#95a99f"))) - - -(setq eshell-prompt-function 'prompt-f) -(setq eshell-highlight-prompt nil) -(setq eshell-prompt-regexp "^.+? \\((\\(git\\|svn\\|hg\\|darcs\\|cvs\\|bzr\\):.+?) \\)?[$#] ") - -;; Ignore version control folders in autocompletion -(setq eshell-cmpl-cycle-completions nil - eshell-save-history-on-exit t - eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\|\\.svn\\|\\.git\\)/\\'") - -;; Load some EShell extensions -(eval-after-load 'esh-opt - '(progn - (require 'em-term) - (require 'em-cmpl) - ;; More visual commands! - (add-to-list 'eshell-visual-commands "ssh") - (add-to-list 'eshell-visual-commands "tail") - (add-to-list 'eshell-visual-commands "sl"))) - -(setq eshell-directory-name "~/.config/eshell/") - -;; EShell functions that come in handy - -;; clear in eshell -(defun eshell/clear () - "clear the eshell buffer." - (interactive) - (let ((inhibit-read-only t)) - (erase-buffer))) diff --git a/emacs.d/init-functions.el b/emacs.d/init-functions.el deleted file mode 100644 index dfdfee08389a..000000000000 --- a/emacs.d/init-functions.el +++ /dev/null @@ -1,130 +0,0 @@ -;; A few handy functions I use in init.el (or not, but they're nice to -;; have) - -(defun custom-download-theme (url filename) - "Downloads a theme through HTTP and places it in ~/.emacs.d/themes" - - ;; Ensure the directory exists - (unless (file-exists-p "~/.emacs.d/themes") - (make-directory "~/.emacs.d/themes")) - - ;; Adds the themes folder to the theme load path (if not already - ;; there) - (unless (member "~/.emacs.d/themes" custom-theme-load-path) - (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")) - - ;; Download file if it doesn't exist. - - (let ((file - (concat "~/.emacs.d/themes/" filename))) - (unless (file-exists-p file) - (url-copy-file url file)))) - -(defun custom-download-script (url filename) - "Downloads an Elisp script, places it in ~/.emacs/other and then loads it" - - ;; Ensure the directory exists - (unless (file-exists-p "~/.emacs.d/other") - (make-directory "~/.emacs.d/other")) - - ;; Download file if it doesn't exist. - (let ((file - (concat "~/.emacs.d/" filename))) - (unless (file-exists-p file) - (url-copy-file url file)) - - (load file))) - -;; This clones a git repository to 'foldername in .emacs.d -;; if there isn't already a folder with that name -(defun custom-clone-git (url foldername) - "Clones a git repository to .emacs.d/foldername" - (let ((fullpath (concat "~/.emacs.d/" foldername))) - (unless (file-exists-p fullpath) - (shell-command (concat "git clone " url " " fullpath)))) - ) - -;; These come from magnars, he's got some awesome things. - -(defun goto-line-with-feedback () - "Show line numbers temporarily, while prompting for the line number input" - (interactive) - (unwind-protect - (progn - (linum-mode 1) - (call-interactively 'goto-line)) - (linum-mode -1))) - -(defun rotate-windows () - "Rotate your windows" - (interactive) - (cond ((not (> (count-windows)1)) - (message "You can't rotate a single window!")) - (t - (setq i 1) - (setq numWindows (count-windows)) - (while (< i numWindows) - (let* ( - (w1 (elt (window-list) i)) - (w2 (elt (window-list) (+ (% i numWindows) 1))) - - (b1 (window-buffer w1)) - (b2 (window-buffer w2)) - - (s1 (window-start w1)) - (s2 (window-start w2)) - ) - (set-window-buffer w1 b2) - (set-window-buffer w2 b1) - (set-window-start w1 s2) - (set-window-start w2 s1) - (setq i (1+ i))))))) - -(defun untabify-buffer () - (interactive) - (untabify (point-min) (point-max))) - -(defun indent-buffer () - (interactive) - (indent-region (point-min) (point-max))) - -(defun cleanup-buffer () - "Perform a bunch of operations on the whitespace content of a buffer. -Including indent-buffer, which should not be called automatically on save." - (interactive) - (untabify-buffer) - (delete-trailing-whitespace) - (indent-buffer)) - -;; These come from the emacs starter kit -(defun esk-pretty-lambdas () - (font-lock-add-keywords - nil `(("(?\\(lambda\\>\\)" - (0 (progn (compose-region (match-beginning 1) (match-end 1) - ,(make-char 'greek-iso8859-7 107)) - nil)))))) - -(defun esk-eval-and-replace () - "Replace the preceding sexp with its value." - (interactive) - (backward-kill-sexp) - (condition-case nil - (prin1 (eval (read (current-kill 0))) - (current-buffer)) - (error (message "Invalid expression") - (insert (current-kill 0))))) - -(defun esk-add-watchwords () - (font-lock-add-keywords - nil '(("\\<\\(FIX\\(ME\\)?\\|TODO\\|HACK\\|REFACTOR\\|NOCOMMIT\\)" - 1 font-lock-warning-face t)))) - -(defun esk-sudo-edit (&optional arg) - (interactive "p") - (if (or arg (not buffer-file-name)) - (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: "))) - (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) - -(defun speak (m &optional voice) - (shell-command (if 'voice (concat "say -v " voice " \"" m "\"") - (concat "say " m)))) diff --git a/emacs.d/init-mail.el b/emacs.d/init-mail.el deleted file mode 100644 index 982b78156ff3..000000000000 --- a/emacs.d/init-mail.el +++ /dev/null @@ -1,18 +0,0 @@ -(require 'gnus) - -(setq gnus-select-method '(nnimap "gmail" - (nnimap-address "imap.gmail.com") - (nnimap-server-port 993) - (nnimap-stream ssl))) - -(setq message-send-mail-function 'smtpmail-send-it - smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) - smtpmail-auth-credentials '(("smtp.gmail.com" 587 "vincent@spotify.com" nil)) - smtpmail-default-smtp-server "smtp.gmail.com" - smtpmail-smtp-server "smtp.gmail.com" - smtpmail-smtp-service 587 - smtpmail-local-domain "spotify.com") - - ;; Make Gnus NOT ignore [Gmail] mailboxes -(setq gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]") - diff --git a/emacs.d/init-modes.el b/emacs.d/init-modes.el deleted file mode 100644 index 3e9cff999654..000000000000 --- a/emacs.d/init-modes.el +++ /dev/null @@ -1,51 +0,0 @@ -(mapc 'require '(projectile hi2)) -;; Initializes modes I use. - -(add-hook 'prog-mode-hook 'esk-pretty-lambdas) -(add-hook 'prog-mode-hook 'esk-add-watchwords) -(add-hook 'prog-mode-hook 'idle-highlight-mode) - -;; Configure markdown-mode -(autoload 'markdown-mode "markdown-mode" - "Major mode for editing Markdown files" t) -(add-to-list 'auto-mode-alist '("\\.txt\\'" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) - -;; Add keybindings to move nested blocks with C-, rsp. C-. -(define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-left) -(define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right) - -;; Configure nrepl (Clojure REPL) and clojure-mode -;; Paredit in clojure - -(add-hook 'clojure-mode-hook 'paredit-mode) - -;; eldoc in clojure -(add-hook 'nrepl-interaction-mode-hook - 'nrepl-turn-on-eldoc-mode) - -;; Don't annoy me -(setq nrepl-hide-special-buffers t) -(setq nrepl-popup-stacktraces nil) - -;; Enable projectile for all things programming -(add-hook 'prog-mode-hook 'projectile-on) - -;; Enable rainbow-delimiters for all things programming -(add-hook 'prog-mode-hook 'rainbow-delimiters-mode) - -;; Enable Paredit in Emacs Lisp mode -(add-hook 'emacs-lisp-mode-hook 'paredit-mode) - -;; Always highlight matching brackets -(show-paren-mode 1) - -;; Undo-Tree at all times! -(undo-tree-mode) - -;; Keep track of recent files -(recentf-mode) - -;; Enable Nyan mode -(nyan-mode 1) diff --git a/emacs.d/init-settings.el b/emacs.d/init-settings.el deleted file mode 100644 index e2c7e6249bd4..000000000000 --- a/emacs.d/init-settings.el +++ /dev/null @@ -1,210 +0,0 @@ -;; ## Generic settings ## - -(tool-bar-mode -1) -(scroll-bar-mode -1) - -(flx-ido-mode 1) -(setq ido-use-faces nil) -(setq gc-cons-threshold 20000000) - -;;; Code: - -(add-to-list 'exec-path "/usr/local/bin") -(add-to-list 'exec-path (expand-file-name "~/bin")) -(add-to-list 'exec-path "/Applications/Racket/bin") - - -(when window-system - (setq frame-title-format '(buffer-file-name "%f" ("%b"))) - (tooltip-mode -1) - (mouse-wheel-mode t) - (blink-cursor-mode -1)) - -;; can't do it at launch or emacsclient won't always honor it -(add-hook 'before-make-frame-hook 'esk-turn-off-tool-bar) - -(setq visible-bell t - inhibit-startup-message t - color-theme-is-global t - sentence-end-double-space nil - shift-select-mode nil - mouse-yank-at-point t - uniquify-buffer-name-style 'forward - whitespace-style '(face trailing lines-tail tabs) - whitespace-line-column 80 - ediff-window-setup-function 'ediff-setup-windows-plain - oddmuse-directory (concat user-emacs-directory "oddmuse") - save-place-file (concat user-emacs-directory "places") - backup-directory-alist `(("." . ,(concat user-emacs-directory "backups"))) - diff-switches "-u") - -(setq smex-save-file (concat user-emacs-directory ".smex-items")) -(smex-initialize) -(global-set-key (kbd "M-x") 'smex) - -(add-to-list 'safe-local-variable-values '(lexical-binding . t)) -(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80)) - -;; ido-mode is like magic pixie dust! -(ido-mode t) -(ido-ubiquitous t) -(setq ido-enable-prefix nil - ido-enable-flex-matching t - ido-auto-merge-work-directories-length nil - ido-create-new-buffer 'always - ido-use-filename-at-point 'guess - ido-use-virtual-buffers t - ido-handle-duplicate-virtual-buffers 2 - ido-max-prospects 10) - -;; Swedish! -(set-language-environment 'Swedish) - -(require 'ffap) -(defvar ffap-c-commment-regexp "^/\\*+" - "Matches an opening C-style comment, like \"/***\".") - -(defadvice ffap-file-at-point (after avoid-c-comments activate) - "Don't return paths like \"/******\" unless they actually exist. - -This fixes the bug where ido would try to suggest a C-style -comment as a filename." - (ignore-errors - (when (and ad-return-value - (string-match-p ffap-c-commment-regexp - ad-return-value) - (not (ffap-file-exists-string ad-return-value))) - (setq ad-return-value nil)))) - -(defalias 'yes-or-no-p 'y-or-n-p) -(defalias 'auto-tail-revert-mode 'tail-mode) - -;; Hippie expand: at times perhaps too hip -(eval-after-load 'hippie-exp - '(progn - (dolist (f '(try-expand-line try-expand-list try-complete-file-name-partially)) - (delete f hippie-expand-try-functions-list)) - - ;; Add this back in at the end of the list. - (add-to-list 'hippie-expand-try-functions-list 'try-complete-file-name-partially t))) - -;; ## Look and feel ## - -;; Themes! I download and install the ones I like and default the one -;; I currently like most. This changes a lot because I hate -;; everything. (It's in my nature, don't judge) -(custom-download-theme "https://raw.github.com/owainlewis/emacs-color-themes/master/themes/hickey-theme.el" - "hickey-theme.el") - -(custom-download-theme "https://raw.github.com/rexim/gruber-darker-theme/master/gruber-darker-theme.el" - "gruber-darker-theme.el") - -(load-theme 'gruber-darker t) - -(global-hl-line-mode -1) - -(set-default-font "Source Code Pro 13") - -;; Don't make the nyan cat too long ... I have other stuff in the mode -;; bar as well! -(set-variable 'nyan-bar-length 15) -;; Not the real deal without this ... -(set-variable 'nyan-wavy-trail t) - -(setq linum-format (lambda (line) - (propertize - (format (concat " %" - (number-to-string - (length (number-to-string - (line-number-at-pos (point-max))))) - "d ") - line) - 'face 'linum))) - -;; Hiding JOIN, QUIT, PART -(setq erc-hide-list '("JOIN" "PART" "QUIT")) - -(eval-after-load 'diff-mode - '(progn - (set-face-foreground 'diff-added "green4") - (set-face-foreground 'diff-removed "red3"))) - -(eval-after-load 'magit - '(progn - (set-face-foreground 'magit-diff-add "green4") - (set-face-foreground 'magit-diff-del "red3"))) - -;; ## Mac specific settings ## - -;; Enable mouse support on OS X -(unless window-system - (require 'mouse) - (xterm-mouse-mode t) - (global-set-key [mouse-4] '(lambda () - (interactive) - (scroll-down 1))) - (global-set-key [mouse-5] '(lambda () - (interactive) - (scroll-up 1))) - (defun track-mouse (e)) - - (setq mouse-sel-mode t) -) - -;; Use clipboard properly -(setq x-select-enable-clipboard t) - -;; Settings for Emacs.app (Cocoa Emacs) -;; Menu bar doesn't take up additional space, so lets use it. -(menu-bar-mode 1) - -;; Don't use Apple's native fullscreen (FIXME: Change with Mavericks) -(setq ns-use-native-fullscreen nil) - -(defun toggle-native-fullscreen () - "Toggles between native and non-native OS X fullscreen" - (interactive) - (setq ns-use-native-fullscreen (not ns-use-native-fullscreen))) - -;; ## Navigation and key bindings ## - -;; Navigate windows with M- -(windmove-default-keybindings 'meta) -(setq windmove-wrap-around t) - -;; Load ace-jump-mode -(autoload - 'ace-jump-mode - "ace-jump-mode" - "Emacs quick move minor mode" - ) - -(define-key global-map [?] 'ace-jump-mode) - -;; Quick jump back -(autoload - 'ace-jump-mode-pop-mark - "ace-jump-mode" - "Ace jump back:-)" - ) - -(eval-after-load "ace-jump-mode" - '(ace-jump-mode-enable-mark-sync)) -(define-key global-map (kbd "C-x ö") 'ace-jump-mode-pop-mark) - -;; Keep your backup files in tmp, emacs! -(setq backup-directory-alist - `((".*" . ,temporary-file-directory))) -(setq auto-save-file-name-transforms - `((".*" ,temporary-file-directory t))) - -;; Eshell -;; Start/join -(global-set-key (kbd "C-x m") 'eshell) -;; Always start -(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t))) - -;; Git -(global-set-key (kbd "C-c g") 'magit-status) - -(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function) diff --git a/emacs.d/init.el b/emacs.d/init.el deleted file mode 100644 index 4551a7b9adad..000000000000 --- a/emacs.d/init.el +++ /dev/null @@ -1,84 +0,0 @@ -;; Configure package manager -(require 'package) - -;; Add Marmalade repo -(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) - -;; ... and melpa. Melpa packages that exist on marmalade will have -;; precendence. -(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) - -(package-initialize) - -(when (not package-archive-contents) - (package-refresh-contents)) - -(defvar my-pkgs - '(ace-jump-mode - browse-kill-ring - clojure-mode - flycheck - flx-ido - haskell-mode - hi2 - idle-highlight-mode - ido-ubiquitous - leuven-theme - magit - magit - markdown-mode - multiple-cursors - nrepl - paredit - projectile - rainbow-delimiters - rainbow-mode - smex - undo-tree - geiser - quack) - "A list of packages to install at launch.") - -(dolist (p my-pkgs) - (when (not (package-installed-p p)) - (package-install p))) - - -(load "~/.emacs.d/init-functions.el") - -(add-to-list 'load-path "~/.emacs.d/scripts/") - -(setq custom-file "~/.emacs.d/init-custom.el") -(load custom-file) - -;; Other packages that need manual installation -(custom-download-script "https://raw.github.com/dimitri/switch-window/master/switch-window.el" - "switch-window.el") - -(custom-download-script "https://raw.github.com/doitian/iy-go-to-char/master/iy-go-to-char.el" - "goto-char.el") - -;; NYAN CAT! -(custom-clone-git "https://github.com/TeMPOraL/nyan-mode" "nyan-mode") -(load "~/.emacs.d/nyan-mode/nyan-mode.el") - -(load "~/.emacs.d/init-settings.el") -(load "~/.emacs.d/init-modes.el") -(load "~/.emacs.d/init-bindings.el") -(load "~/.emacs.d/init-eshell.el") - -;; A file with machine specific settings -(load "~/.emacs.d/init-local.el") - -;; IRC configuration (erc) -;; Actual servers and such are loaded from irc.el -(load "~/.emacs.d/irc") - -;; Load magnars' string manipulation library -(require 's) - -;; Seed RNG -(random t) - -;; Start server for emacsclient -(server-start) diff --git a/fish/config.fish b/fish/config.fish deleted file mode 100644 index 1fdeb0e92f63..000000000000 --- a/fish/config.fish +++ /dev/null @@ -1,23 +0,0 @@ -function fish_prompt - set_color magenta - echo -n (vcprompt -f "(%s:%b%a%m)") - set_color cyan - echo -n '> ' -end - -function fish_right_prompt - set_color --bold yellow - echo -n '[' - set_color --bold blue - echo -n (prompt_pwd) - set_color --bold yellow - echo -n ']' -end - -set -gx EDITOR "emacsclient -n -create-frame" -set -gx ALTERNATE_EDITOR emacs -set -gx VISUAL emacsclient - -set fish_greeting "" - -set PATH /usr/local/share/python /usr/local/bin ~/Library/Haskell/bin ~/bin/ /Users/vincent/Source/management-scripts/google-apps/ $PATH diff --git a/fish/functions/edit.fish b/fish/functions/edit.fish deleted file mode 100644 index 61bf37345686..000000000000 --- a/fish/functions/edit.fish +++ /dev/null @@ -1,3 +0,0 @@ -function edit - emacsclient -no-wait -create-frame $argv -end \ No newline at end of file diff --git a/fish/functions/runhoogle.fish b/fish/functions/runhoogle.fish deleted file mode 100644 index 45160062e3fb..000000000000 --- a/fish/functions/runhoogle.fish +++ /dev/null @@ -1,5 +0,0 @@ -function runhoogle - cd ~/.hoogle - screen -dm hoogle server -p 4000 - cd - -end diff --git a/fish/functions/runirc.fish b/fish/functions/runirc.fish deleted file mode 100644 index d16234268388..000000000000 --- a/fish/functions/runirc.fish +++ /dev/null @@ -1,3 +0,0 @@ -function runirc - screen -S irssi irssi -end diff --git a/init-bindings.el b/init-bindings.el new file mode 100644 index 000000000000..2593ddd6d010 --- /dev/null +++ b/init-bindings.el @@ -0,0 +1,46 @@ +;; Various keybindings, most of them taken from starter-kit-bindings + +;; 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 "M-%") 'query-replace-regexp) +(global-set-key (kbd "C-M-s") 'isearch-forward) +(global-set-key (kbd "C-M-r") 'isearch-backward) +(global-set-key (kbd "C-M-%") 'query-replace) + +;; Jump to a definition in the current file. (Protip: this is awesome.) +(global-set-key (kbd "C-x C-i") 'imenu) + +;; Ace-jump-mode +(global-set-key (kbd "M-j") 'ace-jump-char-mode) + +;; Jump to next occurence of char +(global-set-key (kbd "M-m") 'iy-go-to-char) + +;; Window switching. (C-x o goes to the next window) +(windmove-default-keybindings) ;; Shift+direction + +;; 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))) + +;; Eval sexp and replace it with result +(global-set-key (kbd "C-c e") 'esk-eval-and-replace) + +;; Start a regular shell if you prefer that. +(global-set-key (kbd "C-x C-m") 'shell) + +;; So good! +(global-set-key (kbd "C-c g") 'magit-status) + +;; Add a fullscreen toggle +(global-set-key (kbd "M-RET") 'toggle-frame-fullscreen) + +;; Replace standard goto-line with goto-line-with-feedback +(global-set-key (kbd "M-g g") 'goto-line-with-feedback) diff --git a/init-custom.el b/init-custom.el new file mode 100644 index 000000000000..2b2916143f6d --- /dev/null +++ b/init-custom.el @@ -0,0 +1,31 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(custom-safe-themes + (quote + ("854dc57026d3226addcc46b2b460034a74609edbd9c14e626769ac724b10fcf5" "8eaa3bce3c618cd81a318fcf2d28c1cd21278531f028feb53186f6387547dfb4" "ea0c5df0f067d2e3c0f048c1f8795af7b873f5014837feb0a7c8317f34417b04" "a234f91f9be6ed40f6ce0e94dce5cea1b9f1ccec2b9ccd42bb71c499867a3fcc" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" "1e7e097ec8cb1f8c3a912d7e1e0331caeed49fef6cff220be63bd2a6ba4cc365" "d6a00ef5e53adf9b6fe417d2b4404895f26210c52bb8716971be106550cea257" default))) + '(erc-modules + (quote + (autojoin button completion dcc irccontrols list log match menu move-to-prompt netsplit networks noncommands notifications readonly ring scrolltobottom stamp track))) + '(haskell-mode-hook + (quote + (capitalized-words-mode turn-on-haskell-decl-scan turn-on-haskell-doc turn-on-hi2))) + '(it-mode-google-cmd "/usr/local/share/python/google") + '(ns-alternate-modifier (quote none)) + '(ns-command-modifier (quote meta))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(rainbow-delimiters-depth-1-face ((t (:foreground "#2aa198")))) + '(rainbow-delimiters-depth-2-face ((t (:foreground "#b58900")))) + '(rainbow-delimiters-depth-3-face ((t (:foreground "#268bd2")))) + '(rainbow-delimiters-depth-4-face ((t (:foreground "#dc322f")))) + '(rainbow-delimiters-depth-5-face ((t (:foreground "#859900")))) + '(rainbow-delimiters-depth-6-face ((t (:foreground "#268bd2")))) + '(rainbow-delimiters-depth-7-face ((t (:foreground "#cb4b16")))) + '(rainbow-delimiters-depth-8-face ((t (:foreground "#d33682")))) + '(rainbow-delimiters-depth-9-face ((t (:foreground "#839496"))))) diff --git a/init-eshell.el b/init-eshell.el new file mode 100644 index 000000000000..239a9980ce3e --- /dev/null +++ b/init-eshell.el @@ -0,0 +1,98 @@ +;; EShell configuration + +(require 'eshell) + +;; Generic settings +;; Hide banner message ... +(setq eshell-banner-message "") + +(defvar home-dir) +(setq home-dir (expand-file-name "~")) + +(defun eshell-mode-hook-setup () + "Sets up EShell when it is loaded" + + (setq eshell-path-env (concat + "/usr/local/bin:" + (concat home-dir "/bin:") + "/usr/local/share/python:" + eshell-path-env)) + + (setenv "PATH" eshell-path-env)) + +(add-hook 'eshell-mode-hook 'eshell-mode-hook-setup) + +;; Prompt configuration + +(defun clean-pwd (path) + "Turns a path of the form /foo/bar/baz into /f/b/baz + (inspired by fish shell)" + (message path) + (let* ((current-dir (split-string path "/")) + (cdir (last current-dir)) + (head (butlast current-dir))) + (concat (mapconcat (lambda (s) + (if (string= "" s) nil + (substring s 0 1))) + head + "/") + (if head "/" nil) + (car cdir)))) + +(setq eshell-pwd-convert-function + (lambda (path) + (clean-pwd (replace-regexp-in-string + home-dir + "~" + path)))) + +(defun vcprompt (&optional args) + "Call the external vcprompt command with optional arguments. + VCPrompt" + (replace-regexp-in-string + "\n" "" + (shell-command-to-string (concat "vcprompt" args)))) + +(defmacro with-face (str &rest properties) + `(propertize ,str 'face (list ,@properties))) + +(defun prompt-f () + "My EShell prompt displaying VC info and such" + (concat + (with-face (concat (eshell/pwd) " ") :foreground "#96a6c8") + (with-face (vcprompt " -f \"(%s:%b%a%m) \"") :foreground "#5f627f") + (if (= 0 (user-uid)) + (with-face "#" :foreground "#f43841") + (with-face "$" :foreground "#73c936")) + (with-face " " :foreground "#95a99f"))) + + +(setq eshell-prompt-function 'prompt-f) +(setq eshell-highlight-prompt nil) +(setq eshell-prompt-regexp "^.+? \\((\\(git\\|svn\\|hg\\|darcs\\|cvs\\|bzr\\):.+?) \\)?[$#] ") + +;; Ignore version control folders in autocompletion +(setq eshell-cmpl-cycle-completions nil + eshell-save-history-on-exit t + eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\|\\.svn\\|\\.git\\)/\\'") + +;; Load some EShell extensions +(eval-after-load 'esh-opt + '(progn + (require 'em-term) + (require 'em-cmpl) + ;; More visual commands! + (add-to-list 'eshell-visual-commands "ssh") + (add-to-list 'eshell-visual-commands "tail") + (add-to-list 'eshell-visual-commands "sl"))) + +(setq eshell-directory-name "~/.config/eshell/") + +;; EShell functions that come in handy + +;; clear in eshell +(defun eshell/clear () + "clear the eshell buffer." + (interactive) + (let ((inhibit-read-only t)) + (erase-buffer))) diff --git a/init-functions.el b/init-functions.el new file mode 100644 index 000000000000..dfdfee08389a --- /dev/null +++ b/init-functions.el @@ -0,0 +1,130 @@ +;; A few handy functions I use in init.el (or not, but they're nice to +;; have) + +(defun custom-download-theme (url filename) + "Downloads a theme through HTTP and places it in ~/.emacs.d/themes" + + ;; Ensure the directory exists + (unless (file-exists-p "~/.emacs.d/themes") + (make-directory "~/.emacs.d/themes")) + + ;; Adds the themes folder to the theme load path (if not already + ;; there) + (unless (member "~/.emacs.d/themes" custom-theme-load-path) + (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")) + + ;; Download file if it doesn't exist. + + (let ((file + (concat "~/.emacs.d/themes/" filename))) + (unless (file-exists-p file) + (url-copy-file url file)))) + +(defun custom-download-script (url filename) + "Downloads an Elisp script, places it in ~/.emacs/other and then loads it" + + ;; Ensure the directory exists + (unless (file-exists-p "~/.emacs.d/other") + (make-directory "~/.emacs.d/other")) + + ;; Download file if it doesn't exist. + (let ((file + (concat "~/.emacs.d/" filename))) + (unless (file-exists-p file) + (url-copy-file url file)) + + (load file))) + +;; This clones a git repository to 'foldername in .emacs.d +;; if there isn't already a folder with that name +(defun custom-clone-git (url foldername) + "Clones a git repository to .emacs.d/foldername" + (let ((fullpath (concat "~/.emacs.d/" foldername))) + (unless (file-exists-p fullpath) + (shell-command (concat "git clone " url " " fullpath)))) + ) + +;; These come from magnars, he's got some awesome things. + +(defun goto-line-with-feedback () + "Show line numbers temporarily, while prompting for the line number input" + (interactive) + (unwind-protect + (progn + (linum-mode 1) + (call-interactively 'goto-line)) + (linum-mode -1))) + +(defun rotate-windows () + "Rotate your windows" + (interactive) + (cond ((not (> (count-windows)1)) + (message "You can't rotate a single window!")) + (t + (setq i 1) + (setq numWindows (count-windows)) + (while (< i numWindows) + (let* ( + (w1 (elt (window-list) i)) + (w2 (elt (window-list) (+ (% i numWindows) 1))) + + (b1 (window-buffer w1)) + (b2 (window-buffer w2)) + + (s1 (window-start w1)) + (s2 (window-start w2)) + ) + (set-window-buffer w1 b2) + (set-window-buffer w2 b1) + (set-window-start w1 s2) + (set-window-start w2 s1) + (setq i (1+ i))))))) + +(defun untabify-buffer () + (interactive) + (untabify (point-min) (point-max))) + +(defun indent-buffer () + (interactive) + (indent-region (point-min) (point-max))) + +(defun cleanup-buffer () + "Perform a bunch of operations on the whitespace content of a buffer. +Including indent-buffer, which should not be called automatically on save." + (interactive) + (untabify-buffer) + (delete-trailing-whitespace) + (indent-buffer)) + +;; These come from the emacs starter kit +(defun esk-pretty-lambdas () + (font-lock-add-keywords + nil `(("(?\\(lambda\\>\\)" + (0 (progn (compose-region (match-beginning 1) (match-end 1) + ,(make-char 'greek-iso8859-7 107)) + nil)))))) + +(defun esk-eval-and-replace () + "Replace the preceding sexp with its value." + (interactive) + (backward-kill-sexp) + (condition-case nil + (prin1 (eval (read (current-kill 0))) + (current-buffer)) + (error (message "Invalid expression") + (insert (current-kill 0))))) + +(defun esk-add-watchwords () + (font-lock-add-keywords + nil '(("\\<\\(FIX\\(ME\\)?\\|TODO\\|HACK\\|REFACTOR\\|NOCOMMIT\\)" + 1 font-lock-warning-face t)))) + +(defun esk-sudo-edit (&optional arg) + (interactive "p") + (if (or arg (not buffer-file-name)) + (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: "))) + (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) + +(defun speak (m &optional voice) + (shell-command (if 'voice (concat "say -v " voice " \"" m "\"") + (concat "say " m)))) diff --git a/init-mail.el b/init-mail.el new file mode 100644 index 000000000000..982b78156ff3 --- /dev/null +++ b/init-mail.el @@ -0,0 +1,18 @@ +(require 'gnus) + +(setq gnus-select-method '(nnimap "gmail" + (nnimap-address "imap.gmail.com") + (nnimap-server-port 993) + (nnimap-stream ssl))) + +(setq message-send-mail-function 'smtpmail-send-it + smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) + smtpmail-auth-credentials '(("smtp.gmail.com" 587 "vincent@spotify.com" nil)) + smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-smtp-service 587 + smtpmail-local-domain "spotify.com") + + ;; Make Gnus NOT ignore [Gmail] mailboxes +(setq gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]") + diff --git a/init-modes.el b/init-modes.el new file mode 100644 index 000000000000..3e9cff999654 --- /dev/null +++ b/init-modes.el @@ -0,0 +1,51 @@ +(mapc 'require '(projectile hi2)) +;; Initializes modes I use. + +(add-hook 'prog-mode-hook 'esk-pretty-lambdas) +(add-hook 'prog-mode-hook 'esk-add-watchwords) +(add-hook 'prog-mode-hook 'idle-highlight-mode) + +;; Configure markdown-mode +(autoload 'markdown-mode "markdown-mode" + "Major mode for editing Markdown files" t) +(add-to-list 'auto-mode-alist '("\\.txt\\'" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) + +;; Add keybindings to move nested blocks with C-, rsp. C-. +(define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-left) +(define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right) + +;; Configure nrepl (Clojure REPL) and clojure-mode +;; Paredit in clojure + +(add-hook 'clojure-mode-hook 'paredit-mode) + +;; eldoc in clojure +(add-hook 'nrepl-interaction-mode-hook + 'nrepl-turn-on-eldoc-mode) + +;; Don't annoy me +(setq nrepl-hide-special-buffers t) +(setq nrepl-popup-stacktraces nil) + +;; Enable projectile for all things programming +(add-hook 'prog-mode-hook 'projectile-on) + +;; Enable rainbow-delimiters for all things programming +(add-hook 'prog-mode-hook 'rainbow-delimiters-mode) + +;; Enable Paredit in Emacs Lisp mode +(add-hook 'emacs-lisp-mode-hook 'paredit-mode) + +;; Always highlight matching brackets +(show-paren-mode 1) + +;; Undo-Tree at all times! +(undo-tree-mode) + +;; Keep track of recent files +(recentf-mode) + +;; Enable Nyan mode +(nyan-mode 1) diff --git a/init-settings.el b/init-settings.el new file mode 100644 index 000000000000..e2c7e6249bd4 --- /dev/null +++ b/init-settings.el @@ -0,0 +1,210 @@ +;; ## Generic settings ## + +(tool-bar-mode -1) +(scroll-bar-mode -1) + +(flx-ido-mode 1) +(setq ido-use-faces nil) +(setq gc-cons-threshold 20000000) + +;;; Code: + +(add-to-list 'exec-path "/usr/local/bin") +(add-to-list 'exec-path (expand-file-name "~/bin")) +(add-to-list 'exec-path "/Applications/Racket/bin") + + +(when window-system + (setq frame-title-format '(buffer-file-name "%f" ("%b"))) + (tooltip-mode -1) + (mouse-wheel-mode t) + (blink-cursor-mode -1)) + +;; can't do it at launch or emacsclient won't always honor it +(add-hook 'before-make-frame-hook 'esk-turn-off-tool-bar) + +(setq visible-bell t + inhibit-startup-message t + color-theme-is-global t + sentence-end-double-space nil + shift-select-mode nil + mouse-yank-at-point t + uniquify-buffer-name-style 'forward + whitespace-style '(face trailing lines-tail tabs) + whitespace-line-column 80 + ediff-window-setup-function 'ediff-setup-windows-plain + oddmuse-directory (concat user-emacs-directory "oddmuse") + save-place-file (concat user-emacs-directory "places") + backup-directory-alist `(("." . ,(concat user-emacs-directory "backups"))) + diff-switches "-u") + +(setq smex-save-file (concat user-emacs-directory ".smex-items")) +(smex-initialize) +(global-set-key (kbd "M-x") 'smex) + +(add-to-list 'safe-local-variable-values '(lexical-binding . t)) +(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80)) + +;; ido-mode is like magic pixie dust! +(ido-mode t) +(ido-ubiquitous t) +(setq ido-enable-prefix nil + ido-enable-flex-matching t + ido-auto-merge-work-directories-length nil + ido-create-new-buffer 'always + ido-use-filename-at-point 'guess + ido-use-virtual-buffers t + ido-handle-duplicate-virtual-buffers 2 + ido-max-prospects 10) + +;; Swedish! +(set-language-environment 'Swedish) + +(require 'ffap) +(defvar ffap-c-commment-regexp "^/\\*+" + "Matches an opening C-style comment, like \"/***\".") + +(defadvice ffap-file-at-point (after avoid-c-comments activate) + "Don't return paths like \"/******\" unless they actually exist. + +This fixes the bug where ido would try to suggest a C-style +comment as a filename." + (ignore-errors + (when (and ad-return-value + (string-match-p ffap-c-commment-regexp + ad-return-value) + (not (ffap-file-exists-string ad-return-value))) + (setq ad-return-value nil)))) + +(defalias 'yes-or-no-p 'y-or-n-p) +(defalias 'auto-tail-revert-mode 'tail-mode) + +;; Hippie expand: at times perhaps too hip +(eval-after-load 'hippie-exp + '(progn + (dolist (f '(try-expand-line try-expand-list try-complete-file-name-partially)) + (delete f hippie-expand-try-functions-list)) + + ;; Add this back in at the end of the list. + (add-to-list 'hippie-expand-try-functions-list 'try-complete-file-name-partially t))) + +;; ## Look and feel ## + +;; Themes! I download and install the ones I like and default the one +;; I currently like most. This changes a lot because I hate +;; everything. (It's in my nature, don't judge) +(custom-download-theme "https://raw.github.com/owainlewis/emacs-color-themes/master/themes/hickey-theme.el" + "hickey-theme.el") + +(custom-download-theme "https://raw.github.com/rexim/gruber-darker-theme/master/gruber-darker-theme.el" + "gruber-darker-theme.el") + +(load-theme 'gruber-darker t) + +(global-hl-line-mode -1) + +(set-default-font "Source Code Pro 13") + +;; Don't make the nyan cat too long ... I have other stuff in the mode +;; bar as well! +(set-variable 'nyan-bar-length 15) +;; Not the real deal without this ... +(set-variable 'nyan-wavy-trail t) + +(setq linum-format (lambda (line) + (propertize + (format (concat " %" + (number-to-string + (length (number-to-string + (line-number-at-pos (point-max))))) + "d ") + line) + 'face 'linum))) + +;; Hiding JOIN, QUIT, PART +(setq erc-hide-list '("JOIN" "PART" "QUIT")) + +(eval-after-load 'diff-mode + '(progn + (set-face-foreground 'diff-added "green4") + (set-face-foreground 'diff-removed "red3"))) + +(eval-after-load 'magit + '(progn + (set-face-foreground 'magit-diff-add "green4") + (set-face-foreground 'magit-diff-del "red3"))) + +;; ## Mac specific settings ## + +;; Enable mouse support on OS X +(unless window-system + (require 'mouse) + (xterm-mouse-mode t) + (global-set-key [mouse-4] '(lambda () + (interactive) + (scroll-down 1))) + (global-set-key [mouse-5] '(lambda () + (interactive) + (scroll-up 1))) + (defun track-mouse (e)) + + (setq mouse-sel-mode t) +) + +;; Use clipboard properly +(setq x-select-enable-clipboard t) + +;; Settings for Emacs.app (Cocoa Emacs) +;; Menu bar doesn't take up additional space, so lets use it. +(menu-bar-mode 1) + +;; Don't use Apple's native fullscreen (FIXME: Change with Mavericks) +(setq ns-use-native-fullscreen nil) + +(defun toggle-native-fullscreen () + "Toggles between native and non-native OS X fullscreen" + (interactive) + (setq ns-use-native-fullscreen (not ns-use-native-fullscreen))) + +;; ## Navigation and key bindings ## + +;; Navigate windows with M- +(windmove-default-keybindings 'meta) +(setq windmove-wrap-around t) + +;; Load ace-jump-mode +(autoload + 'ace-jump-mode + "ace-jump-mode" + "Emacs quick move minor mode" + ) + +(define-key global-map [?] 'ace-jump-mode) + +;; Quick jump back +(autoload + 'ace-jump-mode-pop-mark + "ace-jump-mode" + "Ace jump back:-)" + ) + +(eval-after-load "ace-jump-mode" + '(ace-jump-mode-enable-mark-sync)) +(define-key global-map (kbd "C-x ö") 'ace-jump-mode-pop-mark) + +;; Keep your backup files in tmp, emacs! +(setq backup-directory-alist + `((".*" . ,temporary-file-directory))) +(setq auto-save-file-name-transforms + `((".*" ,temporary-file-directory t))) + +;; Eshell +;; Start/join +(global-set-key (kbd "C-x m") 'eshell) +;; Always start +(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t))) + +;; Git +(global-set-key (kbd "C-c g") 'magit-status) + +(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function) diff --git a/init.el b/init.el new file mode 100644 index 000000000000..4551a7b9adad --- /dev/null +++ b/init.el @@ -0,0 +1,84 @@ +;; Configure package manager +(require 'package) + +;; Add Marmalade repo +(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) + +;; ... and melpa. Melpa packages that exist on marmalade will have +;; precendence. +(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) + +(package-initialize) + +(when (not package-archive-contents) + (package-refresh-contents)) + +(defvar my-pkgs + '(ace-jump-mode + browse-kill-ring + clojure-mode + flycheck + flx-ido + haskell-mode + hi2 + idle-highlight-mode + ido-ubiquitous + leuven-theme + magit + magit + markdown-mode + multiple-cursors + nrepl + paredit + projectile + rainbow-delimiters + rainbow-mode + smex + undo-tree + geiser + quack) + "A list of packages to install at launch.") + +(dolist (p my-pkgs) + (when (not (package-installed-p p)) + (package-install p))) + + +(load "~/.emacs.d/init-functions.el") + +(add-to-list 'load-path "~/.emacs.d/scripts/") + +(setq custom-file "~/.emacs.d/init-custom.el") +(load custom-file) + +;; Other packages that need manual installation +(custom-download-script "https://raw.github.com/dimitri/switch-window/master/switch-window.el" + "switch-window.el") + +(custom-download-script "https://raw.github.com/doitian/iy-go-to-char/master/iy-go-to-char.el" + "goto-char.el") + +;; NYAN CAT! +(custom-clone-git "https://github.com/TeMPOraL/nyan-mode" "nyan-mode") +(load "~/.emacs.d/nyan-mode/nyan-mode.el") + +(load "~/.emacs.d/init-settings.el") +(load "~/.emacs.d/init-modes.el") +(load "~/.emacs.d/init-bindings.el") +(load "~/.emacs.d/init-eshell.el") + +;; A file with machine specific settings +(load "~/.emacs.d/init-local.el") + +;; IRC configuration (erc) +;; Actual servers and such are loaded from irc.el +(load "~/.emacs.d/irc") + +;; Load magnars' string manipulation library +(require 's) + +;; Seed RNG +(random t) + +;; Start server for emacsclient +(server-start) diff --git a/plists/com.googlecode.iterm2.plist b/plists/com.googlecode.iterm2.plist deleted file mode 100644 index 667361b2f7ec..000000000000 Binary files a/plists/com.googlecode.iterm2.plist and /dev/null differ diff --git a/plists/org.pqrs.KeyRemap4MacBook.plist b/plists/org.pqrs.KeyRemap4MacBook.plist deleted file mode 100644 index c6be298394b7..000000000000 Binary files a/plists/org.pqrs.KeyRemap4MacBook.plist and /dev/null differ diff --git a/plists/org.pqrs.PCKeyboardHack.plist b/plists/org.pqrs.PCKeyboardHack.plist deleted file mode 100644 index 4e4b74cb6eec..000000000000 Binary files a/plists/org.pqrs.PCKeyboardHack.plist and /dev/null differ diff --git a/xnomad b/xnomad deleted file mode 100644 index 4a2adc02588a..000000000000 --- a/xnomad +++ /dev/null @@ -1,20 +0,0 @@ -{ - "Ratio": 0.7, - "WindowsInMaster": 1, - "Hotkeys": { - "Swap": { "key": "s", "modifiers": [ "option", "control" ] }, - "SelectPrev": { "key": "j", "modifiers": [ "option", "control" ] }, - "SelectNext": { "key": "k", "modifiers": [ "option", "control" ] }, - "SwapPrev": { "key": "j", "modifiers": [ "option", "control", "command" ] }, - "SwapNext": { "key": "k", "modifiers": [ "option", "control", "command" ] }, - "FocusDisplay1": { "key": "e", "modifiers": [ "option", "control" ] }, - "FocusDisplay2": { "key": "w", "modifiers": [ "option", "control" ] }, - "ToDisplay1": { "key": "e", "modifiers": [ "option", "control", "command" ] }, - "ToDisplay2": { "key": "w", "modifiers": [ "option", "control", "command" ] }, - "CycleLayouts": { "key": " ", "modifiers": [ "option", "control", "command" ] }, - "IncreaseRatio": { "key": "l", "modifiers": [ "option", "control" ] }, - "DecreaseRatio": { "key": "h", "modifiers": [ "option", "control" ] }, - "MoreMasters": { "key": ".", "modifiers": [ "option", "control" ] }, - "FewerMasters": { "key": ",", "modifiers": [ "option", "control" ] } - } -} diff --git a/zshrc b/zshrc deleted file mode 100644 index 15846cbbe05f..000000000000 --- a/zshrc +++ /dev/null @@ -1,63 +0,0 @@ -zmodload -a colors -zmodload -a autocomplete -autoload -U age && age - -export EDITOR='subl -w' - -[ -x /usr/bin/dircolors ] && eval $(dircolors) -zstyle ':completion:*' menu select=2 -zstyle ':completion:*' verbose true -zstyle ':completion:*' extra-verbose true -zstyle ':completion:*' use-cache on -zstyle ':completion:*' cache-path ~/.zsh/cache -zstyle ':completion:*:approximate:*' max-errors 1 numeric -zstyle ':completion:*:functions' ignored-patterns '_*' -zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate - -autoload -Uz compinit && compinit - -setopt autocd autopushd pushdminus pushdsilent pushdtohome -setopt HIST_REDUCE_BLANKS HIST_IGNORE_SPACE SHARE_HISTORY inc_append_history -setopt no_hup no_clobber print_exit_value -setopt extendedglob glob_dots -setopt correct -setopt completealiases -setopt prompt_subst - -case $TERM in - rxvt|*term) - precmd() { print -Pn "\e]0;%m:%~\a" } - preexec () { print -Pn "\e]0;$1\a" } - ;; -esac - -autoload -U colors && colors -#vincent: PS1="%{%B$fg[blue]%}%n%{$reset_color%B%}@%{%b$fg[magenta]%}%1~ %{$reset_color%}\$(vcprompt -f '%b:%r ')%# " - -#PS1="%n@%1~ \$(vcprompt -f '%b:%r ') %# " -PS1="%{$fg[green]%}%n%{$fg[cyan]%}@%{$fg[magenta]%}%1~ %{$fg[yellow]%}\$(vcprompt -f '%b:%r ')%{$fg[cyan]%}%# %{$reset_color%}" -RPS1="%{$fg[cyan]%}%B[%M:%d]%b%{$reset_color%}" - - -alias ls="ls -liFG" - -autoload -Uz compinit && compinit - -source ~/.zsh/plugins/history-substring-search.zsh -source ~/.zsh/plugins/git.plugin.zsh -source ~/.zsh/plugins/git-extras.plugin.zsh - -# Customize to your needs... -export PATH=/Users/vincent/Library/Haskell/bin:/Users/vincent/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki - -source /opt/boxen/env.sh - - -alias google.py="/Users/vincent/Source/management-scripts/google-apps/google.py" - -alias runhoogle="screen -dm hoogle server -p 4000" - -alias irssi="screen -S irssi irssi" - -HISTFILE="$HOME/.zsh_history" -- cgit 1.4.1