;; Make sure I don't accidentally iconify/suspend Emacs with C-z (global-unset-key [(control z)]) (global-set-key (kbd "\e\er") 'remember) (global-set-key (kbd "\e\eR") 'remember-region) (global-set-key (kbd "\e\es") 'w3m-search) (global-set-key (kbd "\e\ek") 'edict-search-kanji) (global-set-key (kbd "\e\ej") 'sacha/edict-search-english) (global-set-key (kbd "\e\eK") 'sacha/edict-search-kanji) (global-set-key (kbd "\e\eJ") 'sacha/edict-search-example) (global-set-key (kbd "\e\ep") 'planner-goto-today) (global-set-key (kbd "\e\eP") 'planner-goto-plan-page) (global-set-key (kbd "") 'undo) ;(global-set-key "\M-/" 'dabbrev-expand) ;(global-set-key (kbd "M-/") 'hippie-expand) (global-set-key "\C-x\C-b" 'buffer-menu) (global-set-key "\C-x\C-k" 'kill-buffer) (global-set-key " " 'newline-and-indent) (eval-after-load 'ruby-mode '(define-key ruby-mode-map " " 'ruby-reindent-then-newline-and-indent)) (global-set-key (kbd "") 'set-mark-command) (global-set-key (kbd "") 'sacha/edict-search-example) (global-set-key (kbd "") 'edict-search-kanji) (global-set-key '[S-f4] 'sacha/edict-search-kanji) (global-set-key (quote [C-f4]) (quote set-mark-command)) (global-set-key (quote [M-f4]) (quote forward-char)) (global-set-key (kbd "") 'sacha/edict-search-english) (global-unset-key (kbd "C-x f")) (global-unset-key (kbd "")) (global-set-key (kbd " SPC") 'compile) (global-set-key (kbd " f e SPC") 'eval-defun) (global-set-key (kbd " f i SPC") 'edebug-defun) (global-set-key (kbd " c SPC") 'edebug-instrument-callee) (global-set-key (kbd " b e SPC") 'eval-buffer) (defun wearable-lock () (interactive) (while (not (equal (read-string "Type ok or hit C-g to get back to work.") "ok")))) (defun mairix-search (string) "Uses mairix to search through my mail." (interactive "MMairix: ") (call-process "mairix" nil nil nil string) (gnus-no-server) (gnus-group-read-group t t "nnmh:mairix") (gnus-group-get-new-news-this-group 0 t) ) (defun mairix-reindex () "Uses mairix to reindex my mail." (interactive) (message "Using mairix to index...") (call-process "mairix" nil nil nil "-p") (message "Done.") ) (defun find-thing-at-point (&optional prefix) "Jumps to the thing at point, if vaguely named." (interactive "P") (save-excursion (let ((filename (or (and prefix (read-string "Name: ")) (thing-at-point 'filename)))) (cond ((file-exists-p filename) (find-file-other-window filename)) ((file-exists-p (concat "/home/sacha/Plans/" filename)) (find-file-other-window (concat "/home/sacha/Plans/" filename))) ((file-exists-p (concat "/home/sacha/notebook/emacs/" filename)) (find-file-other-window (concat "/home/sacha/notebook/emacs/" filename))) ((file-exists-p (concat "/usr/src/emacs/lisp/" filename)) (find-file-other-window (concat "/usr/src/emacs/lisp/" filename))))))) (defvar sacha/keyboard 'dvorak "Current keyboard setup.") (defun sacha/keyboard-dvorak () "Switch to Dvorak." (interactive) (shell-command "/usr/X11R6/bin/setxkbmap dvorak") (message "Now Dvorak.") (setq sacha/keyboard 'dvorak)) (defun sacha/keyboard-qwerty () "Switch to QWERTY." (interactive) (shell-command "/usr/X11R6/bin/setxkbmap us") (message "Now QWERTY.") (setq sacha/keyboard 'qwerty)) (defun sacha/keyboard-toggle () "Switch between keymaps." (interactive) (if (equal sacha/keyboard 'dvorak) (sacha/keyboard-qwerty) (sacha/keyboard-dvorak))) (global-unset-key (kbd "")) (global-set-key (kbd " o") 'other-window) (global-set-key (kbd "M-%") 'jump-paren) (global-set-key (kbd "") 'sacha/toggle-w3m) (global-set-key (kbd " e SPC") 'eshell) (global-set-key (kbd " m") 'sacha/keyboard-toggle) ;; Same in both layouts (global-set-key (kbd " K") 'sacha/edict-search-kanji) (global-set-key (kbd " g SPC") 'gnus) (global-set-key (kbd "H-g") 'gnus) (global-set-key (kbd "H-p") 'planner-goto-today) (global-set-key (kbd " b") 'battery) (global-set-key (kbd " g s SPC") 'mairix-search) (global-set-key (kbd " g s i") 'mairix-reindex) (global-set-key (kbd " j") 'sacha/edict-search-english) (global-set-key (kbd " J") 'sacha/edict-search-example) (global-set-key (kbd " c") 'sacha/random-tagline) (global-set-key (kbd " k") 'edict-search-kanji) (global-set-key (kbd " f SPC") 'global-font-lock-mode) (global-set-key (kbd " s SPC") 'w3m-search) (global-set-key (kbd " c") 'wearable-show-chords) (global-set-key (kbd " w SPC") 'sacha/emacswiki-random-page) (global-set-key (kbd " f SPC") 'find-thing-at-point) (global-set-key (kbd " l l") (lambda () (interactive (find-file "~/notebook/plans/ledger.txt")))) (global-set-key (kbd " l e") 'sacha/ledger-add-entry) (global-set-key (kbd " l f") 'sacha/ledger-edit) (global-set-key (kbd " L SPC") 'wearable-lock) (global-set-key (kbd " ") 'planner-goto-today) (global-set-key (kbd " ") 'planner-goto-tomorrow) (global-set-key (kbd " ") 'sacha/planner-what-am-i-supposed-to-be-doing) (global-set-key (kbd " ") 'sacha/planner-snooze) (global-set-key (kbd " S-") 'sacha/planner-set-snooze-date) (global-set-key (kbd " ") 'planner-goto-yesterday) (global-set-key (kbd " ") 'sacha/planner-snooze) (global-set-key (kbd " ") 'planner-goto) (global-set-key (kbd " o") 'sacha/remember-to-org) ;(global-set-key (kbd "") 'hippie-expand) (global-set-key (kbd "") 'hippie-expand) (global-set-key (kbd "M-?") 'hippie-expand) ;; f9 a is reserved for a screen-like program windows.SPC (global-set-key (kbd "M-/") 'dabbrev-expand) (global-set-key "\C-cy" '(lambda () (interactive) (popup-menu 'yank-menu))) (global-set-key (kbd " a") 'org-agenda) (global-set-key (kbd "C-c a") 'org-agenda) (global-set-key (kbd "C-c r") 'sacha/remember-to-org) (global-set-key (kbd " o") 'sacha/remember-to-org) (global-set-key (kbd "C-M-r") 'sacha/remember-to-org) (global-set-key (kbd " O") 'org-store-link) (global-set-key (kbd "C-M-e") 'miniedit)