762 lines
29 KiB
EmacsLisp
762 lines
29 KiB
EmacsLisp
(add-to-list 'load-path "~/.emacs.d/elisp-git/color-moccur/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/dired-toggle-sudo/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/evil/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/window-numbering/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/evil-snipe/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/magit/lisp/")
|
|
;; (add-to-list 'load-path "~/.emacs.d/elisp-git/yafolding.el/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/god-mode/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/es-lib/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/es-windows")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/project-explorer/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/slime/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/smartparens/")
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/Emacs-wgrep/")
|
|
(add-to-list 'load-path "~/.emacs.d/user/")
|
|
|
|
(add-to-list 'load-path "~/.emacs.d/contrapunctus/")
|
|
|
|
|
|
;;;; UTF-8 magic
|
|
(setq locale-coding-system 'utf-8)
|
|
(set-terminal-coding-system 'utf-8)
|
|
(set-keyboard-coding-system 'utf-8)
|
|
(set-selection-coding-system 'utf-8)
|
|
(prefer-coding-system 'utf-8)
|
|
|
|
;;;; Simplify the GUI, thanks
|
|
;;;; http://www.masteringemacs.org/articles/2010/10/04/beginners-guide-to-emacs/
|
|
(menu-bar-mode -1)
|
|
(tool-bar-mode -1)
|
|
(scroll-bar-mode -1)
|
|
(setq focus-follows-mouse t)
|
|
(setq mouse-autoselect-window t)
|
|
|
|
|
|
;;;; Linewrapping
|
|
(defun line-trunc-set ()
|
|
(visual-line-mode -1)
|
|
;(setq-default truncate-partial-width-windows t)
|
|
;(setq-default truncate-lines t))
|
|
(setq truncate-partial-width-windows t)
|
|
(setq truncate-lines t))
|
|
;; (defun line-trunc-set ()
|
|
;; (interactive)
|
|
;; (if (or truncate-lines
|
|
;; visual-line-mode)
|
|
;; (progn
|
|
;; (visual-line-mode -1)
|
|
;; (setq truncate-lines t))
|
|
;; (progn
|
|
;; (visual-line-mode 1)
|
|
;; (setq truncate-lines nil))))
|
|
;(add-hook 'text-mode-hook 'line-trunc-set)
|
|
(add-hook 'emacs-lisp-mode-hook 'line-trunc-set)
|
|
(add-hook 'org-mode-hook 'visual-line-mode)
|
|
(add-hook 'erc-mode-hook 'visual-line-mode)
|
|
;(global-set-key (kbd "C-x t") 'toggle-truncate-lines)
|
|
(global-visual-line-mode 1)
|
|
|
|
(add-hook 'markdown-mode-hook 'auto-fill-mode)
|
|
(add-hook 'text-mode-hook 'auto-fill-mode)
|
|
;; (add-hook 'paredit-mode-hook 'auto-fill-mode)
|
|
|
|
;;;; Tab settings
|
|
(setq default-tab-width 4)
|
|
;(define-key text-mode-map (kbd "TAB") 'self-insert-command)
|
|
(setq-default indent-tabs-mode nil)
|
|
;;;; Fix scrolling
|
|
(setq scroll-conservatively 10000
|
|
scroll-preserve-screen-position t)
|
|
(setq auto-window-vscroll nil)
|
|
;;; Recenter screen on isearch matches
|
|
(add-hook 'isearch-mode-hook 'recenter)
|
|
(add-hook 'isearch-update-post-hook 'recenter)
|
|
(defadvice isearch-repeat-forward
|
|
(after isearch-repeat-forward-recenter activate) (recenter))
|
|
(defadvice isearch-repeat-backward
|
|
(after isearch-repeat-backward-recenter activate) (recenter))
|
|
|
|
(ad-activate 'isearch-repeat-forward)
|
|
(ad-activate 'isearch-repeat-backward)
|
|
|
|
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
|
|
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
|
|
|
|
;;;; While we're at it, let's add that to next-error as well
|
|
;;;; (this affects jumping to match from M-x grep , too)
|
|
(add-hook 'next-error-hook 'recenter)
|
|
|
|
;;;; ...and to magit-toggle-section
|
|
;;; It'd be really cool to (recenter 3) when you /open/ a section,
|
|
;;; and (recenter) when you close a section
|
|
(defadvice magit-section-toggle
|
|
(after magit-section-toggle-recenter activate) (recenter 3))
|
|
(ad-activate 'magit-section-toggle)
|
|
(defadvice magit-unstage-item
|
|
(after magit-unstage-item-move) (next-line))
|
|
(ad-activate 'magit-unstage-item)
|
|
(defadvice magit-goto-next-section
|
|
(after magit-next-section-recenter activate) (recenter 3))
|
|
(ad-activate 'magit-goto-next-section)
|
|
(defadvice magit-goto-previous-section
|
|
(after magit-previous-section-recenter activate) (recenter 3))
|
|
(ad-activate 'magit-goto-previous-section)
|
|
|
|
;;;; Fix Emacs' definition of a sentence
|
|
(setq sentence-end-double-space nil)
|
|
;;;; Highlight current line
|
|
(global-hl-line-mode 1)
|
|
|
|
|
|
(load "cp-editing")
|
|
|
|
|
|
;;;; Vim-style prompt-less tag jumping
|
|
;;;; http://stackoverflow.com/questions/12074897/automatically-jump-to-tag-in-emacs
|
|
(global-unset-key (kbd "M-t"))
|
|
(defun find-tag-no-prompt-other-window ()
|
|
"Jump to the tag at point in the other window without prompting."
|
|
(interactive)
|
|
(find-tag-other-window (find-tag-default)))
|
|
(defun find-tag-no-prompt ()
|
|
"Jump to the tag at point without prompting."
|
|
(interactive)
|
|
(find-tag (find-tag-default)))
|
|
(global-set-key (kbd "M-t M-t") 'find-tag-no-prompt-other-window)
|
|
(global-set-key (kbd "M-t M-g") 'find-tag-no-prompt)
|
|
(global-set-key (kbd "M-t M-p") 'pop-tag-mark)
|
|
(global-set-key (kbd "M-t M-f") 'find-tag)
|
|
(global-set-key (kbd "M-t M-s") 'tags-search)
|
|
(global-set-key (kbd "M-t M-c") 'tags-loop-continue)
|
|
|
|
(require 'view)
|
|
(global-set-key (kbd "C-v") 'View-scroll-half-page-forward)
|
|
(global-set-key (kbd "M-v") 'View-scroll-half-page-backward)
|
|
;; (global-set-key (kbd "M-v") 'scroll-down)
|
|
;; (global-set-key (kbd "C-v") 'scroll-up)
|
|
|
|
;;;; Need to make maps for
|
|
;;;; mark-* commands (-sexp, -page, -word, etc)
|
|
;;;; mark ring
|
|
|
|
;;;; Other custom keys
|
|
(global-set-key (kbd "C-x C-1") 'delete-other-windows)
|
|
(global-set-key (kbd "C-x C-2") 'split-window-below)
|
|
(global-set-key (kbd "C-x C-3") 'split-window-right)
|
|
(global-set-key (kbd "C-x C-0") 'delete-window)
|
|
(global-set-key (kbd "C-x C-4 C-f") 'find-file-other-window)
|
|
;(global-set-key (kbd "C-`") 'point-to-register)
|
|
;(global-set-key (kbd "C-'") 'jump-to-register)
|
|
(global-set-key (kbd "C-x C-d") 'dired-jump)
|
|
(require 'dired)
|
|
(define-key dired-mode-map (kbd "b") 'dired-up-directory)
|
|
(add-hook 'dired-mode-hook 'visual-line-mode)
|
|
;(global-set-key (kbd "C-,") 'string-rectangle 'TAB)
|
|
(global-unset-key (kbd "C-x d"))
|
|
|
|
;; (require 'dired-toggle-sudo)
|
|
;; (define-key dired-mode-map (kbd "C-c C-s") 'dired-toggle-sudo)
|
|
;; (eval-after-load 'tramp
|
|
;; '(progn
|
|
;; ;; Allow to use: /sudo:user@host:/path/to/file
|
|
;; (add-to-list 'tramp-default-proxies-alist
|
|
;; '(".*" "\\`.+\\'" "/ssh:%h:"))))
|
|
(global-set-key (kbd "C-x df") 'delete-frame)
|
|
;;;; make-frame key is after Helm's config
|
|
|
|
;(setq compilation-read-command nil)
|
|
(defun contrapunctus-open-init ()
|
|
"Open the init.el file."
|
|
(interactive)
|
|
(find-file "~/.emacs.d/init.el"))
|
|
;; todo - store current file name → kill the buffer →
|
|
;; find-file-literally with the stored filename. also, find out if you
|
|
;; can open it without modes but with the proper encoding.
|
|
(defun contrapunctus-fcf-literally ()
|
|
"Find the current file literally. Like find-file-literally but
|
|
does not prompt for a file name."
|
|
(interactive)
|
|
(find-file-literally (buffer-file-name)))
|
|
(defun contrapunctus-kill-buffer ()
|
|
"Kill the current buffer without prompting."
|
|
(interactive)
|
|
(kill-buffer nil))
|
|
|
|
(global-set-key (kbd "M-<f2>") 'compile)
|
|
(global-set-key (kbd "<f2> p") 'grep)
|
|
(global-set-key (kbd "<f2> o") 'find-grep)
|
|
(global-set-key (kbd "<f2> i") 'find-dired)
|
|
(global-set-key (kbd "M-<f3>") 'run-scheme)
|
|
(global-set-key (kbd "M-<f4>") 'run-lisp)
|
|
(global-set-key (kbd "<f5> <f5>") 'eval-buffer)
|
|
(global-set-key (kbd "M-<f5>") 'ielm)
|
|
(global-set-key (kbd "<f5> i") 'contrapunctus-open-init)
|
|
(global-set-key (kbd "<f5> p") 'list-packages)
|
|
(global-set-key (kbd "<f5> v") 'visual-line-mode)
|
|
(global-set-key (kbd "<f5> f") 'contrapunctus-fcf-literally)
|
|
(global-set-key (kbd "<f5> c") 'calendar)
|
|
(global-set-key (kbd "s-k") 'contrapunctus-kill-buffer)
|
|
(global-set-key (kbd "C-`") 'eshell)
|
|
(setq eshell-history-size nil)
|
|
(global-set-key (kbd "<f1> A") 'info-apropos)
|
|
|
|
;;;; Lilypond editing
|
|
(require 'lilypond-mode)
|
|
(add-hook 'LilyPond-mode-hook 'subword-mode)
|
|
(global-set-key (kbd "C-c C-i") 'LilyPond-info)
|
|
(defun contrapunctus-toggle-selective-display ()
|
|
(interactive)
|
|
(set-selective-display (if selective-display nil 1)))
|
|
(global-set-key (kbd "M-]") 'contrapunctus-toggle-selective-display)
|
|
(defun contrapunctus-backward-def ()
|
|
(interactive)
|
|
(re-search-backward "\\(^[a-zA-Z]\\|^}\\)")
|
|
(beginning-of-line))
|
|
(defun contrapunctus-forward-def ()
|
|
(interactive)
|
|
(forward-char)
|
|
(re-search-forward "\\(^[a-zA-Z]\\|^}\\)")
|
|
(beginning-of-line))
|
|
(defun contrapunctus-upper-level ()
|
|
(interactive)
|
|
(re-search-backward "{"))
|
|
(defun contrapunctus-lower-level ()
|
|
(interactive)
|
|
(if (equal (string (char-after))
|
|
"{")
|
|
(forward-char))
|
|
(if (not (re-search-forward "{"))
|
|
(message "At deepest level."))
|
|
(backward-char))
|
|
(define-key LilyPond-mode-map (kbd "M-p") 'contrapunctus-backward-def)
|
|
(define-key LilyPond-mode-map (kbd "M-n") 'contrapunctus-forward-def)
|
|
(define-key LilyPond-mode-map (kbd "M-P") 'contrapunctus-upper-level)
|
|
(define-key LilyPond-mode-map (kbd "M-N") 'contrapunctus-lower-level)
|
|
|
|
;;;; More convenient Unicode keys
|
|
;; make a macro, global-set-keys -
|
|
;; (global-set-keys (keybinding-pair1) (keybinding-pair2) ...)
|
|
;; =>
|
|
;; (global-set-key keybinding-pair1)
|
|
;; (global-set-key keybinding-pair2)
|
|
;; ...
|
|
;; where each (keybinding-pair) is
|
|
;; ((kbd ...) function)
|
|
;;
|
|
;; It'd also be nice to abstract away the lambda, and directly write
|
|
;; the command you want to run.
|
|
|
|
(global-unset-key (kbd "M-["))
|
|
(define-key key-translation-map (kbd "M-[ a") (kbd "ä"))
|
|
(define-key key-translation-map (kbd "M-[ A") (kbd "Ä"))
|
|
(define-key key-translation-map (kbd "M-[ u") (kbd "ü"))
|
|
(define-key key-translation-map (kbd "M-[ U") (kbd "Ü"))
|
|
(define-key key-translation-map (kbd "M-[ o") (kbd "ö"))
|
|
(define-key key-translation-map (kbd "M-[ O") (kbd "Ö"))
|
|
(define-key key-translation-map (kbd "M-[ s") (kbd "ß"))
|
|
|
|
(define-key key-translation-map (kbd "M-[ r") (kbd "₹"))
|
|
(define-key key-translation-map (kbd "M-[ e") (kbd "€"))
|
|
(define-key key-translation-map (kbd "M-[ b") (kbd "←"))
|
|
(define-key key-translation-map (kbd "M-[ f") (kbd "→"))
|
|
(define-key key-translation-map (kbd "M-[ p") (kbd "↑"))
|
|
(define-key key-translation-map (kbd "M-[ n") (kbd "↓"))
|
|
(define-key key-translation-map (kbd "M-[ t") (kbd "™"))
|
|
(define-key key-translation-map (kbd "M-[ l") (kbd "λ"))
|
|
(define-key key-translation-map (kbd "M-[ F") (kbd "ƒ"))
|
|
|
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
|
|
|
(setq backup-by-copying t
|
|
backup-directory-alist
|
|
'(("." . "~/.emacs.d/saves/"))
|
|
delete-old-versions t
|
|
kept-new-versions 6
|
|
kept-old-versions 2
|
|
version-control t)
|
|
|
|
(setq scheme-program-name "csi -:c")
|
|
(setq comint-prompt-read-only t)
|
|
|
|
(setq browse-url-browser-function 'browse-url-xdg-open)
|
|
|
|
|
|
(require 'time)
|
|
(setq display-time-next-load-average t)
|
|
(add-to-list 'display-time-world-list '("Europe/Berlin" "Berlin"))
|
|
|
|
|
|
;;;; Marmalade
|
|
(require 'package)
|
|
(add-to-list 'package-archives
|
|
'("marmalade" . "https://marmalade-repo.org/packages/"))
|
|
|
|
;//// //// //// //// //// ////
|
|
;//// PACKAGE INITIALIZE ////
|
|
;//// //// //// //// //// ////
|
|
(package-initialize)
|
|
|
|
;;;; Set theme
|
|
;(load-theme 'distinguished t)
|
|
;(require 'github-theme)
|
|
;(require 'heroku-theme)
|
|
;;;; Good theme but uses different font sizes in org-mode, and (I think) some weird non-monospace font
|
|
;(require 'monokai-theme)
|
|
(require 'molokai-theme)
|
|
|
|
|
|
(require 'chicken)
|
|
|
|
|
|
(load "cp-adb")
|
|
|
|
|
|
(require 'dot-mode)
|
|
(dot-mode 1)
|
|
(define-key dot-mode-map (kbd "C-.") nil)
|
|
(define-key dot-mode-map (kbd "M-.") 'dot-mode-execute)
|
|
|
|
;; (load "cp-evil")
|
|
|
|
;; Comment out if using Evil, uncomment if not
|
|
(require 'undo-tree)
|
|
(global-undo-tree-mode)
|
|
|
|
|
|
(require 'org)
|
|
(global-set-key (kbd "<f5> o") 'org-mode)
|
|
;(setq org-M-RET-may-split-line 'nil)
|
|
(add-hook 'org-mode-hook 'org-display-inline-images)
|
|
(define-key org-mode-map (kbd "C-,") nil)
|
|
(define-key org-mode-map (kbd "M-n") 'org-metadown)
|
|
(define-key org-mode-map (kbd "M-p") 'org-metaup)
|
|
(define-key org-mode-map (kbd "C-c C--") 'org-ctrl-c-minus)
|
|
(define-key org-mode-map (kbd "C-c C-,") 'org-metaleft)
|
|
(define-key org-mode-map (kbd "C-c C-.") 'org-metaright)
|
|
;; (define-key org-mode-map (kbd "C-j") 'org-return)
|
|
;; (define-key org-mode-map (kbd "C-m") 'org-return-indent)
|
|
|
|
;; (defun contrapunctus-org-expand-all ()
|
|
;; (interactive)
|
|
;; ;; todo - define inner recursive function
|
|
;; (beginning-of-buffer)
|
|
;; ;; todo - check if we are on a heading
|
|
;; (org-forward-heading-same-level)
|
|
;; ())
|
|
|
|
|
|
(require 'ace-jump-mode)
|
|
;(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
|
|
(global-set-key (kbd "M-SPC") 'ace-jump-mode)
|
|
|
|
|
|
;;;; launch-files
|
|
(require 'launch)
|
|
(add-hook 'dired 'turn-on-launch-mode)
|
|
(define-key dired-mode-map (kbd "C-j") 'launch-files-dired)
|
|
|
|
|
|
(require 'relative-line-numbers)
|
|
;(setq relative-line-numbers-motion-function 'vertical-motion)
|
|
(setq relative-line-numbers-motion-function 'forward-visible-line)
|
|
(global-relative-line-numbers-mode 1)
|
|
|
|
|
|
(load "cp-helm")
|
|
|
|
(load "cp-god")
|
|
|
|
;;;; Ediff stuff
|
|
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
|
|
|
|
|
|
(require 'erc)
|
|
|
|
|
|
(require 'fullscreen-mode)
|
|
(fullscreen-mode 1)
|
|
|
|
|
|
(require 'magit)
|
|
(global-set-key (kbd "<f5> m") 'magit-status)
|
|
(global-set-key (kbd "C-x m") 'magit-status)
|
|
(define-key magit-mode-map (kbd "C-n") 'next-line)
|
|
(define-key magit-mode-map (kbd "C-p") 'previous-line)
|
|
|
|
|
|
(require 'markdown-mode)
|
|
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
|
|
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
|
|
|
|
|
|
(require 'mic-paren)
|
|
(paren-activate)
|
|
|
|
|
|
;; (require 'paredit)
|
|
|
|
;; (add-hook 'emacs-lisp-mode-hook 'paredit-mode)
|
|
;; (add-hook 'lisp-mode-hook 'paredit-mode)
|
|
;; (add-hook 'scheme-mode-hook 'paredit-mode)
|
|
;; (add-hook 'inferior-scheme-mode-hook 'paredit-mode)
|
|
;; (add-hook 'inferior-lisp-mode-hook 'paredit-mode)
|
|
;; (add-hook 'ielm-mode-hook 'paredit-mode)
|
|
|
|
;; (global-set-key (kbd "C-x C-p") 'paredit-mode)
|
|
;; (define-key paredit-mode-map (kbd "C-p") 'paredit-backward-down)
|
|
;; (define-key paredit-mode-map (kbd "C-n") 'paredit-forward-up)
|
|
;; (define-key paredit-mode-map (kbd "C-b") 'paredit-backward)
|
|
;; (define-key paredit-mode-map (kbd "C-f") 'paredit-forward)
|
|
;; (define-key paredit-mode-map (kbd "C-u") 'paredit-backward-up)
|
|
;; (define-key paredit-mode-map (kbd "C-d") 'paredit-forward-down)
|
|
;; (define-key comint-mode-map (kbd "C-d") 'paredit-forward-down)
|
|
|
|
;; (define-key paredit-mode-map (kbd "M-b") 'backward-char)
|
|
;; (define-key paredit-mode-map (kbd "M-f") 'forward-char)
|
|
;; (define-key paredit-mode-map (kbd "M-p") 'previous-line)
|
|
;; (define-key paredit-mode-map (kbd "M-n") 'next-line)
|
|
;; (define-key paredit-mode-map (kbd "M-u") 'paredit-kill-0)
|
|
;; (define-key paredit-mode-map (kbd "M-d") 'paredit-forward-delete)
|
|
|
|
;; (define-key paredit-mode-map (kbd "C-M-b") 'backward-word)
|
|
;; (define-key paredit-mode-map (kbd "C-M-f") 'forward-word)
|
|
;; (define-key paredit-mode-map (kbd "C-M-u") 'upcase-word)
|
|
;; (define-key paredit-mode-map (kbd "C-M-d") 'paredit-forward-kill-word)
|
|
;; (define-key paredit-mode-map (kbd "C-M-p") nil)
|
|
;; (define-key paredit-mode-map (kbd "C-M-n") nil)
|
|
;; (define-key comint-mode-map (kbd "C-M-p") 'comint-previous-input)
|
|
;; (define-key comint-mode-map (kbd "C-M-n") 'comint-next-input)
|
|
|
|
;; (define-key paredit-mode-map (kbd "M-w") 'paredit-copy-as-kill)
|
|
;; (define-key paredit-mode-map (kbd "C-h") 'paredit-backward-delete)
|
|
;; (define-key paredit-mode-map (kbd "C-w") 'paredit-backward-kill-word)
|
|
|
|
|
|
(require 'project-explorer)
|
|
(global-set-key (kbd "<f5> e") 'project-explorer-toggle)
|
|
|
|
|
|
(require 'rcirc)
|
|
(setq rcirc-log-flag t)
|
|
(setq rcirc-time-format "%Y %m %e %T %N ")
|
|
(setq rcirc-server-alist
|
|
'(("irc.freenode.net"
|
|
:channels ("#emacs" "#lilypond" "#velvetandlace"
|
|
"#opensourcemusicians" "##classical" "##guitar"
|
|
"##deutsch" "##hindi")
|
|
:password "trololo_trololo")))
|
|
(setq rcirc-default-nick "contrapunctus")
|
|
|
|
(require 'recentf)
|
|
(recentf-mode 1)
|
|
(setq recentf-max-menu-items 500)
|
|
(setq recentf-max-saved-items nil)
|
|
(setq recentf-save-file "/home/anon/.emacs.d/recentf")
|
|
(global-set-key (kbd "C-x C-r C-o") 'recentf-open-files)
|
|
|
|
|
|
(require 'session)
|
|
(add-hook 'after-init-hook 'session-initialize)
|
|
|
|
|
|
(require 'slime)
|
|
(slime-setup)
|
|
(require 'slime-autoloads)
|
|
(setq inferior-lisp-program "/usr/bin/sbcl")
|
|
(global-set-key (kbd "<f5> s") 'slime)
|
|
(define-key slime-mode-map (kbd "M-n") 'next-line)
|
|
(define-key slime-mode-map (kbd "M-p") 'previous-line)
|
|
|
|
|
|
(require 'smartparens)
|
|
(require 'smartparens-config)
|
|
(smartparens-global-strict-mode)
|
|
(add-hook 'paredit-mode-hook 'turn-off-smartparens-mode)
|
|
(define-key smartparens-mode-map (kbd "M-<up>") 'sp-splice-sexp-killing-backward)
|
|
(sp-pair "<<" ">>")
|
|
(sp-pair "<" ">")
|
|
(sp-pair "(" nil :wrap "M-(")
|
|
(sp-pair "\"" nil :wrap "M-\"")
|
|
(sp-pair "\'" nil :wrap "M-\'")
|
|
(define-key smartparens-mode-map (kbd "C-M-u") 'sp-backward-up-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-d") 'sp-down-sexp)
|
|
(define-key smartparens-mode-map (kbd ";") 'sp-comment)
|
|
(add-hook 'erc-mode-hook 'smartparens-strict-mode)
|
|
;; Disable inserting pair if preceded by : (e.g. in IRC smileys)
|
|
(defun cp-point-after-colon-p ()
|
|
(equal (string (char-before)) ":"))
|
|
;; (sp-pair "(" nil :unless '(cp-point-after-colon-p))
|
|
|
|
;; non-lisp modes
|
|
(define-key smartparens-mode-map (kbd "C-)") 'sp-forward-slurp-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-(") 'sp-backward-slurp-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-}") 'sp-forward-barf-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-{") 'sp-backward-barf-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-j") 'sp-newline)
|
|
(define-key smartparens-mode-map (kbd "C-|") 'sp-join-sexp)
|
|
|
|
(define-key smartparens-mode-map (kbd "C-M-p") 'sp-backward-down-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-n") 'sp-backward-up-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-b") 'sp-backward-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-f") 'sp-forward-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-u") 'sp-up-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-d") 'sp-down-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-a") 'sp-beginning-of-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-e") 'sp-end-of-sexp)
|
|
|
|
(define-key smartparens-mode-map (kbd "C-M-k") 'sp-kill-sexp)
|
|
(define-key smartparens-mode-map (kbd "C-M-w") 'sp-copy-sexp)
|
|
|
|
;; sp-backward-kill-word and subword-backward-kill conflict
|
|
;; How may I elegantly set many keys for emacs-lisp-mode, scheme-mode,
|
|
;; and lisp-mode ?
|
|
;; (define-key emacs-lisp-mode-map (kbd "C-p") 'sp-previous-sexp)
|
|
;; (define-key emacs-lisp-mode-map (kbd "C-n") 'sp-next-sexp)
|
|
|
|
;; emacs-lisp-mode
|
|
(define-key emacs-lisp-mode-map (kbd "C-p") 'sp-backward-down-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-n") 'sp-backward-up-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-b") 'sp-backward-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-f") 'sp-forward-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-u") 'sp-up-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-d") 'sp-down-sexp)
|
|
(define-key comint-mode-map (kbd "C-d") 'sp-down-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-a") 'sp-beginning-of-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-e") 'sp-end-of-sexp)
|
|
|
|
(define-key emacs-lisp-mode-map (kbd "C-k") 'sp-kill-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "M-w") 'sp-copy-sexp)
|
|
(define-key emacs-lisp-mode-map (kbd "C-h") 'sp-backward-delete-char)
|
|
(define-key emacs-lisp-mode-map (kbd "C-w") 'sp-backward-kill-word)
|
|
|
|
(define-key emacs-lisp-mode-map (kbd "M-b") 'backward-char)
|
|
(define-key emacs-lisp-mode-map (kbd "M-f") 'forward-char)
|
|
(define-key emacs-lisp-mode-map (kbd "M-p") 'previous-line)
|
|
(define-key emacs-lisp-mode-map (kbd "M-n") 'next-line)
|
|
(define-key emacs-lisp-mode-map (kbd "M-u") 'cp-kill-line-0)
|
|
(define-key emacs-lisp-mode-map (kbd "M-d") 'sp-delete-char)
|
|
(define-key emacs-lisp-mode-map (kbd "M-a") 'beginning-of-line)
|
|
(define-key emacs-lisp-mode-map (kbd "M-e") 'end-of-line)
|
|
|
|
;; These aren't taking effect?!
|
|
(define-key emacs-lisp-mode-map (kbd "C-M-b") 'backward-word)
|
|
(define-key emacs-lisp-mode-map (kbd "C-M-f") 'forward-word)
|
|
(define-key emacs-lisp-mode-map (kbd "C-M-u") 'upcase-word)
|
|
(define-key emacs-lisp-mode-map (kbd "C-M-d") 'sp-kill-word)
|
|
(define-key emacs-lisp-mode-map (kbd "C-M-p") nil)
|
|
(define-key emacs-lisp-mode-map (kbd "C-M-n") nil)
|
|
(define-key comint-mode-map (kbd "C-M-p") 'comint-previous-input)
|
|
(define-key comint-mode-map (kbd "C-M-n") 'comint-next-input)
|
|
|
|
;; ielm
|
|
(require 'ielm)
|
|
(define-key ielm-map (kbd "C-p") 'sp-backward-down-sexp)
|
|
(define-key ielm-map (kbd "C-n") 'sp-backward-up-sexp)
|
|
(define-key ielm-map (kbd "C-b") 'sp-backward-sexp)
|
|
(define-key ielm-map (kbd "C-f") 'sp-forward-sexp)
|
|
(define-key ielm-map (kbd "C-u") 'sp-up-sexp)
|
|
(define-key ielm-map (kbd "C-d") 'sp-down-sexp)
|
|
(define-key comint-mode-map (kbd "C-d") 'sp-down-sexp)
|
|
(define-key ielm-map (kbd "C-a") 'sp-beginning-of-sexp)
|
|
(define-key ielm-map (kbd "C-e") 'sp-end-of-sexp)
|
|
|
|
(define-key ielm-map (kbd "C-k") 'sp-kill-sexp)
|
|
(define-key ielm-map (kbd "M-w") 'sp-copy-sexp)
|
|
(define-key ielm-map (kbd "C-h") 'sp-backward-delete-char)
|
|
(define-key ielm-map (kbd "C-w") 'sp-backward-kill-word)
|
|
|
|
(define-key ielm-map (kbd "M-b") 'backward-char)
|
|
(define-key ielm-map (kbd "M-f") 'forward-char)
|
|
(define-key ielm-map (kbd "M-p") 'previous-line)
|
|
(define-key ielm-map (kbd "M-n") 'next-line)
|
|
(define-key ielm-map (kbd "M-u") 'cp-kill-line-0)
|
|
(define-key ielm-map (kbd "C-k") 'sp-kill-sexp)
|
|
(define-key ielm-map (kbd "M-d") 'sp-delete-char)
|
|
|
|
(define-key ielm-map (kbd "C-M-b") 'backward-word)
|
|
(define-key ielm-map (kbd "C-M-f") 'forward-word)
|
|
(define-key ielm-map (kbd "C-M-u") 'upcase-word)
|
|
(define-key ielm-map (kbd "C-M-d") 'sp-kill-word)
|
|
(define-key ielm-map (kbd "C-M-p") nil)
|
|
(define-key ielm-map (kbd "C-M-n") nil)
|
|
(define-key comint-mode-map (kbd "C-M-p") 'comint-previous-input)
|
|
(define-key comint-mode-map (kbd "C-M-n") 'comint-next-input)
|
|
|
|
|
|
(define-key scheme-mode-map (kbd "C-p") 'sp-backward-down-sexp)
|
|
(define-key scheme-mode-map (kbd "C-n") 'paredit-forward-up)
|
|
(define-key scheme-mode-map (kbd "C-b") 'paredit-backward)
|
|
(define-key scheme-mode-map (kbd "C-f") 'sp-forward-sexp)
|
|
(define-key scheme-mode-map (kbd "C-u") 'paredit-backward-up)
|
|
(define-key scheme-mode-map (kbd "C-d") 'paredit-forward-down)
|
|
(define-key comint-mode-map (kbd "C-d") 'paredit-forward-down)
|
|
|
|
(define-key scheme-mode-map (kbd "M-b") 'backward-char)
|
|
(define-key scheme-mode-map (kbd "M-f") 'forward-char)
|
|
(define-key scheme-mode-map (kbd "M-p") 'previous-line)
|
|
(define-key scheme-mode-map (kbd "M-n") 'next-line)
|
|
;; (define-key scheme-mode-map (kbd "M-u") 'paredit-kill-0)
|
|
(define-key scheme-mode-map (kbd "C-k") 'sp-kill-sexp)
|
|
(define-key scheme-mode-map (kbd "M-d") 'sp-delete-char)
|
|
|
|
(define-key scheme-mode-map (kbd "C-M-b") 'backward-word)
|
|
(define-key scheme-mode-map (kbd "C-M-f") 'forward-word)
|
|
(define-key scheme-mode-map (kbd "C-M-u") 'upcase-word)
|
|
(define-key scheme-mode-map (kbd "C-M-d") 'sp-kill-word)
|
|
(define-key scheme-mode-map (kbd "C-M-p") nil)
|
|
(define-key scheme-mode-map (kbd "C-M-n") nil)
|
|
(define-key comint-mode-map (kbd "C-M-p") 'comint-previous-input)
|
|
(define-key comint-mode-map (kbd "C-M-n") 'comint-next-input)
|
|
|
|
(define-key scheme-mode-map (kbd "M-w") 'paredit-copy-as-kill)
|
|
(define-key scheme-mode-map (kbd "C-h") 'paredit-backward-delete)
|
|
(define-key scheme-mode-map (kbd "C-w") 'paredit-backward-kill-word)
|
|
|
|
(require 'stumpwm-mode)
|
|
(setq stumpwm-shell-program
|
|
"~/git/stumpwm-contrib/util/stumpish/stumpish")
|
|
;; I'd love to know how to automatically set some modes for some
|
|
;; specific files (i.e. by name of file). Start stumpwm-mode when I
|
|
;; open ~/.stumpwmrc, disable visual lines and enable truncate lines
|
|
;; for some files, etc...
|
|
|
|
|
|
(require 'sudo-edit)
|
|
|
|
;;;; text size change
|
|
(set-face-attribute 'default nil :font "-outline-Bitstream Vera Sans Mono-normal-normal-normal-mono-12-*-*-*-c-*-iso8859-1")
|
|
|
|
|
|
(require 'wgrep)
|
|
|
|
(require 'win-switch)
|
|
(global-set-key "\C-xo" 'win-switch-dispatch)
|
|
(win-switch-setup-keys-ijkl)
|
|
(setq win-switch-idle-time 0.5)
|
|
(setq win-switch-other-window-first nil)
|
|
;(setq win-switch-other-window-first nil)
|
|
|
|
|
|
(require 'window-numbering)
|
|
(window-numbering-mode 1)
|
|
|
|
|
|
;; (require 'yafolding)
|
|
;; (add-hook 'prog-mode-hook
|
|
;; (lambda () (yafolding-mode)))
|
|
|
|
|
|
(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.
|
|
'(LilyPond-command-alist
|
|
(quote
|
|
(("LilyPond" "lilypond %s" "%s" "%l" "View")
|
|
("2PS" "lilypond -f ps %s" "%s" "%p" "ViewPS")
|
|
("Book" "lilypond-book %x" "%x" "%l" "LaTeX")
|
|
("LaTeX" "latex '\\nonstopmode\\input %l'" "%l" "%d" "ViewDVI")
|
|
("View" "zathura %f")
|
|
("ViewPS" "gv --watch %p")
|
|
("Midi" "")
|
|
("MidiAll" ""))))
|
|
'(LilyPond-pdf-command "zathura")
|
|
'(ansi-color-faces-vector
|
|
[default bold shadow italic underline bold bold-italic bold])
|
|
'(ansi-term-color-vector
|
|
[unspecified "#1F1611" "#660000" "#144212" "#EFC232" "#5798AE" "#BE73FD" "#93C1BC" "#E6E1DC"])
|
|
'(compilation-message-face (quote default))
|
|
'(completion-styles (quote (partial-completion basic emacs22)))
|
|
'(custom-safe-themes
|
|
(quote
|
|
("3cd28471e80be3bd2657ca3f03fbb2884ab669662271794360866ab60b6cb6e6" "47160226d9b534d26067fcfb07f6bc1ea5922d9caafd29536c1a212e1cef571b" "f0ea6118d1414b24c2e4babdc8e252707727e7b4ff2e791129f240a2b3093e32" "bf4097b29a98d5653e10a97cf3436c6b57dfb4750be6b083ca353fea06efe2be" "57f8801351e8b7677923c9fe547f7e19f38c99b80d68c34da6fa9b94dc6d3297" "5d9351cd410bff7119978f8e69e4315fd1339aa7b3af6d398c5ca6fac7fd53c7" "70cf411fbf9512a4da81aa1e87b064d3a3f0a47b19d7a4850578c8d64cac2353" "e35ef4f72931a774769da2b0c863e11d94e60a9ad97fb9734e8b28c7ee40f49b" "96efbabfb6516f7375cdf85e7781fe7b7249b6e8114676d65337a1ffe78b78d9" "4aee8551b53a43a883cb0b7f3255d6859d766b6c5e14bcb01bed572fcbef4328" "d809ca3cef02087b48f3f94279b86feca896f544ae4a82b523fba823206b6040" "a507b9ca4a605d5256716da70961741b9ef9ec3246041a4eb776102e8df18418" "2affb26fb9a1b9325f05f4233d08ccbba7ec6e0c99c64681895219f964aac7af" "65ae93029a583d69a3781b26044601e85e2d32be8f525988e196ba2cb644ce6a" "0795e2c85394140788d72d34969be4acb305e4a54149e7237787d9df27832fbb" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "47bff723f2aca3a9a5726abcc52a7cc4192b556dd80b3f773589994d2ed24d16" "013e87003e1e965d8ad78ee5b8927e743f940c7679959149bbee9a15bd286689" "ad9fc392386f4859d28fe4ef3803585b51557838dbc072762117adad37e83585" "1011be33e9843afd22d8d26b031fbbb59036b1ce537d0b250347c19e1bd959d0" "784d5ee4d33befba6a21702ead67f98346770be7cc17ab64952ae3866a403743" "930a202ae41cb4417a89bc3a6f969ebb7fcea5ffa9df6e7313df4f7a2a631434" "0e121ff9bef6937edad8dfcff7d88ac9219b5b4f1570fd1702e546a80dba0832" "442c946bc5c40902e11b0a56bd12edc4d00d7e1c982233545979968e02deb2bc" "e16a771a13a202ee6e276d06098bc77f008b73bbac4d526f160faa2d76c1dd0e" "9eb5269753c507a2b48d74228b32dcfbb3d1dbfd30c66c0efed8218d28b8f0dc" "c4e6fe8f5728a5d5fd0e92538f68c3b4e8b218bcfb5e07d8afff8731cc5f3df0" "c739f435660ca9d9e77312cbb878d5d7fd31e386a7758c982fa54a49ffd47f6e" "97a2b10275e3e5c67f46ddaac0ec7969aeb35068c03ec4157cf4887c401e74b1" "024b0033a950d6a40bbbf2b1604075e6c457d40de0b52debe3ae994f88c09a4a" default)))
|
|
'(debug-on-error nil)
|
|
'(diary-entry-marker (quote font-lock-variable-name-face))
|
|
'(dired-listing-switches "-ahl --group-directories-first --time-style=long-iso")
|
|
'(erc-fill-mode nil)
|
|
'(erc-generate-log-file-name-function (quote erc-generate-log-file-name-network))
|
|
'(erc-log-channels-directory "~/.emacs.d/erc/logs/")
|
|
'(erc-log-mode t)
|
|
'(erc-log-write-after-insert t)
|
|
'(erc-modules
|
|
(quote
|
|
(autojoin completion list log menu ring stamp ercn netsplit button match track readonly networks noncommands irccontrols move-to-prompt)))
|
|
'(erc-nick
|
|
(quote
|
|
("contrapunctus" "HisaoNakai" "[Batou]" "[Togusa]" "[2501]")))
|
|
'(erc-stamp-mode t)
|
|
'(erc-timestamp-format-left "
|
|
[%Y %m %e %T %N]
|
|
")
|
|
'(erc-timestamp-format-right nil)
|
|
'(fci-rule-character-color "#452E2E")
|
|
'(gnus-logo-colors (quote ("#0d7b72" "#adadad")))
|
|
'(helm-completing-read-handlers-alist
|
|
(quote
|
|
((describe-function . helm-completing-read-symbols)
|
|
(describe-variable . helm-completing-read-symbols)
|
|
(debug-on-entry . helm-completing-read-symbols)
|
|
(find-function . helm-completing-read-symbols)
|
|
(find-tag . helm-completing-read-with-cands-in-buffer)
|
|
(ffap-alternate-file)
|
|
(tmm-menubar)
|
|
(completon-at-point . f))))
|
|
'(highlight-changes-colors (quote ("#FD5FF0" "#AE81FF")))
|
|
'(highlight-tail-colors
|
|
(quote
|
|
(("#49483E" . 0)
|
|
("#67930F" . 20)
|
|
("#349B8D" . 30)
|
|
("#21889B" . 50)
|
|
("#968B26" . 60)
|
|
("#A45E0A" . 70)
|
|
("#A41F99" . 85)
|
|
("#49483E" . 100))))
|
|
'(org-html-infojs-options
|
|
(quote
|
|
((path . "/media/alpha/kashish/4_txt_files/org-info.js")
|
|
(view . "overview")
|
|
(toc . :with-toc)
|
|
(ftoc . "0")
|
|
(tdepth . "max")
|
|
(sdepth . "max")
|
|
(mouse . "underline")
|
|
(buttons . "0")
|
|
(ltoc . "1")
|
|
(up . :html-link-up)
|
|
(home . :html-link-home))))
|
|
'(session-registers (quote (t 45 61 92 96 region (97 . 122))))
|
|
'(session-use-package t nil (session))
|
|
'(syslog-debug-face
|
|
(quote
|
|
((t :background unspecified :foreground "#A1EFE4" :weight bold))))
|
|
'(syslog-error-face
|
|
(quote
|
|
((t :background unspecified :foreground "#F92672" :weight bold))))
|
|
'(syslog-hour-face (quote ((t :background unspecified :foreground "#A6E22E"))))
|
|
'(syslog-info-face
|
|
(quote
|
|
((t :background unspecified :foreground "#66D9EF" :weight bold))))
|
|
'(syslog-ip-face (quote ((t :background unspecified :foreground "#E6DB74"))))
|
|
'(syslog-su-face (quote ((t :background unspecified :foreground "#FD5FF0"))))
|
|
'(syslog-warn-face
|
|
(quote
|
|
((t :background unspecified :foreground "#FD971F" :weight bold))))
|
|
'(weechat-color-list
|
|
(quote
|
|
(unspecified "#272822" "#49483E" "#A20C41" "#F92672" "#67930F" "#A6E22E" "#968B26" "#E6DB74" "#21889B" "#66D9EF" "#A41F99" "#FD5FF0" "#349B8D" "#A1EFE4" "#F8F8F2" "#F8F8F0")))
|
|
'(yafolding-ellipsis-content "
|
|
..."))
|
|
(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.
|
|
'(magit-item-highlight ((t nil))))
|
|
|
|
(put 'downcase-region 'disabled nil)
|
|
(put 'upcase-region 'disabled nil)
|
|
(put 'set-goal-column 'disabled nil)
|