dot/emacs: Start configuring Dired's automatic command suggestions.
[profile] / dot / emacs
index 1062254..352eb8a 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
 (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
 (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)
   (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 ?k] 'compile)
+  (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)
      (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)))
        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)
   (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)