X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/c3ee31b9820d8466267a73ab1ad652e043e31314..d57a718ee1f65705bfdf5f3ff16b689add4caae2:/dot/emacs diff --git a/dot/emacs b/dot/emacs index 5781453..352eb8a 100644 --- a/dot/emacs +++ b/dot/emacs @@ -97,6 +97,9 @@ (require 'paren) (trap (show-paren-mode t)) (or window-system (mdw-emacs-version-p 22) (menu-bar-mode -1)) +(setq x-select-enable-clipboard nil + x-select-enable-primary t + mouse-drag-copy-region t) ;; Multiple cursors. @@ -134,6 +137,11 @@ (and edit (set-process-query-on-exit-flag edit nil))))))) +;; Saving state. + +(or mdw-fast-startup (savehist-mode 1)) +(setq history-length 200) + ;; Control backup behaviour. (setq backup-by-copying nil) @@ -208,7 +216,8 @@ (lambda () (let ((group gnus-newsgroup-name)) (and (string-match "^nn\\(imap\\|folder\\)\\+" group) - (not (string-match ":\\(crap\\|spam\\|lists\\)\\." group))))) + (not (string-match ":\\(crap\\|spam\\|lists\\|corpus\\)\\." + group))))) bbdb-user-mail-names (concat "^" "\\(" "\\(mdw\\|markw\\|root\\|postmaster\\)" @@ -304,7 +313,12 @@ (setq next-line-add-newlines nil) ;Don't add weird newlines (setq split-height-threshold nil) ;Reuse windows where sensible (setq display-buffer-reuse-frames nil ;Don't confuse me by showing buffers - iswitchb-default-method 'samewindow) ;in other random frames + iswitchb-default-method 'samewindow ;in other random frames + ido-default-file-method 'selected-window + ido-default-buffer-method 'selected-window) +(setq ido-enable-flex-matching t + ido-confirm-unique-completion t + ido-use-filename-at-point nil) (setq dired-deletion-confirmer ;Make deletion easier in dired (symbol-function 'y-or-n-p) dired-listing-switches "-alF" ;Do `ls -F' things in dired windows @@ -572,8 +586,12 @@ (trap (windmove-default-keybindings)) (setq windmove-wrap-around t) -(trap (iswitchb-mode)) +(trap (require 'ido) (ido-mode 1) + (require 'ido-ubiquitous) (ido-ubiquitous-mode 1) + (setq magit-completing-read-function 'magit-ido-completing-read) + (require 'smex) (smex-initialize) (global-set-key [?\M-x] 'smex)) (progn + (global-set-key [?\C-c ?\M-x] 'execute-extended-command) (global-set-key [?\e ?\e] 'mdw-wrong) (global-set-key [?\e ?\C-\] ?\C-\]] 'keyboard-escape-quit) (global-set-key [?\C-c ?w left] 'windmove-left) @@ -593,6 +611,16 @@ (global-set-key [?\C-c ?t ?r] 'timeclock-reread-log) (global-set-key [?\C-c ?t ?w] 'timeclock-workday-remaining-string) (global-set-key [?\C-c ?t ?s] 'timeclock-status-string) + (global-set-key [?\C-c ?m ?m] 'magit-status) + (global-set-key [?\C-c ?m ?d] 'magit-dispatch-popup) + (global-set-key [?\C-c ?m ?w] 'magit-wip-log) + (global-set-key [?\C-c ?m ?r] 'magit-list-repositories) + (global-set-key [?\C-c ?p ?p] 'mdw-mpc-play-or-pause) + (global-set-key [?\C-c ?p ?s] 'mdw-mpc-stop) + (global-set-key [?\C-c ?p ?<] 'mdw-mpc-prev) + (global-set-key [?\C-c ?p ?>] 'mdw-mpc-next) + (global-set-key [?\C-c ?p ??] 'mdw-mpc-now-playing) + (global-set-key [?\C-c ?k] 'mdw-compile) (global-set-key [?\C-x ?3] 'mdw-split-window-horizontally) (global-set-key [?\M-#] 'calc-dispatch) (global-set-key [?\C-x ?/] 'auto-fill-mode) @@ -618,6 +646,13 @@ (and (not mdw-fast-startup) (fboundp 'hippie-expand) (global-set-key [?\M-?] 'hippie-expand))) +(eval-after-load "hippie-exp" + '(setq hippie-expand-try-functions-list + (remove-if (lambda (name) + (memq name '(try-expand-list + try-expand-list-all-buffers))) + hippie-expand-try-functions-list))) + (eval-after-load "dired" '(progn (or (lookup-key dired-mode-map [?\C-x ?\C-q]) @@ -626,6 +661,8 @@ (trap (require 'dired-x)) (and (fboundp 'dired-do-relsymlink) (define-key dired-mode-map [?\C-c ?\C-s] 'dired-do-relsymlink)))) +(setq dired-guess-shell-alist-user + '(("\\.pdf\\'" "mupdf"))) (add-hook 'org-mode-hook #'(lambda () (mdw-clobber-evil-keymap org-mode-map))) @@ -727,7 +764,7 @@ lisp-mode-hook lisp-interaction-mode-hook makefile-mode-hook inferior-lisp-mode-hook slime-repl-mode-hook sml-mode-hook haskell-mode-hook erlang-mode-hook - smalltalk-mode-hook rexx-mode-hook + smalltalk-mode-hook rexx-mode-hook lua-mode-hook arm-assembler-mode-hook)) (global-font-lock-mode t) @@ -800,6 +837,7 @@ (add-hook 'go-mode-hook 'mdw-fontify-go t) (add-hook 'rust-mode-hook 'mdw-fontify-rust t) + (add-hook 'lua-mode-hook 'mdw-fontify-lua t) (add-hook 'icon-mode-hook 'mdw-fontify-icon t) (add-hook 'apcalc-mode-hook 'mdw-misc-mode-config t) @@ -820,6 +858,7 @@ (progn (setq-default py-indent-offset 2 python-indent 2 + python-indent-offset 2 py-python-command-args `("-i" "-colors" ,(if mdw-black-background "Linux" "LightBG")))