;; Highlight matching parentheses (paren-set-mode 'paren) ;; Use mouse wheel (require 'mwheel) (mwheel-install) ;; Some windows key bindings (global-set-key "\C-z" 'undo) ;; No 'redo' in x-emacs ;(global-set-key "\C-c" 'copy-region-as-kill) ;; Copy ;(global-set-key "\C-x" 'kill-region) ;; Copy ;(global-set-key "\C-v" 'yank) ;(global-set-key '(shift delete) 'kill-region) ;; (global-set-key '(shift insert) "\C-\M-w)") ;; Paste ;; - don't need the previous line, though I don't know why... ;; try to get them to work with x selection instead! (global-set-key "\C-c" 'x-copy-primary-selection) ;; Copy (global-set-key "\C-x" 'x-kill-primary-selection) ;; Cut (global-set-key "\C-v" 'x-insert-selection) ;; Paste (global-set-key '(shift delete) 'x-kill-primary-selection) ;; Cut (global-set-key "\C-d" 'x-delete-primary-selection) (global-unset-key '(shift insert)) (global-set-key '(shift insert) 'x-insert-selection) ;; Paste ;; Set later now... - fixed! ;(global-set-key "\C-s" nil) ;;(global-set-key "\C-s" "\C-x\C-s") ;; I've _always_ hated this!!! ;(global-set-key "\C-s" `save-buffer) ;; I've _always_ hated this!!! ;; Better windows key bindings --> doesn't work! (at least in unix...) ;(load-library "pc-select") ; a package which enables text selection ;;;(require 'pc-select) ;;;(pc-select-mode) ; with the shift and arrow keys ;; Set faces (black background, white/colored text) (custom-set-faces '(default ((t (:family "Fixed" :foreground "white" :background "black" :size "12pt"))) t) '(custom-comment-tag-face ((((class color) (background light)) (:foreground "white")))) '(widget-field-face ((((class grayscale color) (background light)) (:foreground "black" :background "grey")))) '(font-lock-string-face ((((class color) (background light)) (:foreground "tomato")))) '(font-lock-reference-face ((((class color) (background light)) (:foreground "mediumaquamarine")))) '(message-headers ((t (:foreground "green" :size "7" :bold t)))) '(widget-documentation-face ((((class color) (background light)) (:foreground "white")))) '(custom-group-tag-face ((((class color) (background light)) (:foreground "skyblue" :underline t)))) '(custom-variable-tag-face ((((class color) (background light)) (:foreground "skyblue" :underline t)))) '(font-lock-doc-string-face ((((class color) (background light)) (:foreground "green")))) '(modeline-buffer-id ((t (:foreground "blue4"))) t) '(font-lock-preprocessor-face ((((class color) (background light)) (:foreground "pink")))) '(modeline-mousable ((t (:foreground "firebrick"))) t) '(custom-comment-face ((((class grayscale color) (background light)) (:foreground "" :background "black")))) '(font-lock-variable-name-face ((((class color) (background light)) (:foreground "palegoldenrod")))) '(modeline-mousable-minor-mode ((t (:foreground "black"))) t) '(widget ((t (:foreground "black" :background "Gray80"))) t) '(custom-state-face ((((class color) (background light)) (:foreground "green3")))) '(font-lock-keyword-face ((((class color) (background light)) (:foreground "mediumspringgreen")))) '(font-lock-type-face ((((class color) (background light)) (:foreground "skyblue")))) '(message-cited-text ((t (:foreground "steelblue1")))) '(bold-italic ((t (:bold t :italic t))) t) '(primary-selection ((t (:foreground "" :background "steelblue1"))) t) '(blue ((t (:foreground "skyblue"))) t) '(custom-button-face ((t (:size "7" :bold t)))) '(custom-variable-button-face ((t (:size "7" :bold t :underline t)))) '(message-header-contents ((t (:foreground "red" :size "7" :italic t)))) '(font-lock-comment-face ((((class color) (background light)) (:foreground "wheat")))) '(font-lock-function-name-face ((((class color) (background light)) (:foreground "aquamarine")))) '(widget-button-face ((t (:size "7" :bold t)))) '(modeline ((t (:foreground "black" :background "gray"))) t) '(message-highlighted-header-contents ((t (:size "7" :bold t :italic t))))) ;; Set faces for a white background (custom-set-faces '(default ((t (:family "Fixed" :foreground "black" :background "white" :size "12pt"))) t) '(custom-comment-tag-face ((((class color) (background light)) (:foreground "deeppink2")))) '(widget-field-face ((((class grayscale color) (background light)) (:foreground "black" :background "grey")))) '(font-lock-string-face ((((class color) (background light)) (:foreground "red2")))) '(font-lock-reference-face ((((class color) (background light)) (:foreground "navyblue")))) '(message-headers ((t (:foreground "darkgreen" :size "7" :bold t)))) '(widget-documentation-face ((((class color) (background light)) (:foreground "white")))) '(custom-group-tag-face ((((class color) (background light)) (:foreground "blue" :underline t)))) '(custom-variable-tag-face ((((class color) (background light)) (:foreground "mediumblue" :underline t)))) '(font-lock-doc-string-face ((((class color) (background light)) (:foreground "red1")))) '(modeline-buffer-id ((t (:foreground "blue1"))) t) '(font-lock-preprocessor-face ((((class color) (background light)) (:foreground "dodgerblue")))) '(modeline-mousable ((t (:foreground "firebrick"))) t) '(custom-comment-face ((((class grayscale color) (background light)) (:foreground "" :background "white")))) '(font-lock-variable-name-face ((((class color) (background light)) (:foreground "cornflowerblue")))) '(modeline-mousable-minor-mode ((t (:foreground "deeppink3"))) t) '(widget ((t (:foreground "black" :background "Gray80"))) t) '(custom-state-face ((((class color) (background light)) (:foreground "green3")))) '(font-lock-keyword-face ((((class color) (background light)) (:foreground "dodgerblue")))) '(font-lock-type-face ((((class color) (background light)) (:foreground "blueviolet")))) '(message-cited-text ((t (:foreground "steelblue2")))) '(bold-italic ((t (:bold t :italic t))) t) '(primary-selection ((t (:foreground "" :background "steelblue2"))) t) '(blue ((t (:foreground "blue"))) t) '(custom-button-face ((t (:size "7" :bold t)))) '(custom-variable-button-face ((t (:size "7" :bold t :underline t)))) '(message-header-contents ((t (:foreground "darkred" :size "7" :italic t)))) '(font-lock-comment-face ((((class color) (background light)) (:foreground "darkslategray4")))) '(font-lock-function-name-face ((((class color) (background light)) (:foreground "springgreen3")))) '(widget-button-face ((t (:size "7" :bold t)))) '(modeline ((t (:foreground "black" :background "lightgrey"))) t) '(message-highlighted-header-contents ((t (:size "7" :bold t :italic t))))) (set-face-background 'zmacs-region "darkkhaki") ;; some variables (custom-set-variables '(pc-select-selection-keys-only t) '(load-home-init-file t t) '(column-number-mode t) '(gnuserv-program (concat exec-directory "/gnuserv")) '(line-number-mode t) '(pc-select-meta-moves-sexps t) '(font-lock-mode t nil (font-lock)) '(pc-selection-mode t)) ;; Some ESS stuff for at home: (add-path "/home/software/ess-5.2.10/lisp") (require 'ess-site) ;; More advanced ESS stuff for sending lines and things (with _one_ keystroke) (global-set-key [(f4)] 'ess-eval-line-and-step) (global-set-key [(f5)] 'ess-eval-line) (global-set-key [(f6)] 'ess-eval-function) (global-set-key [(f7)] 'ess-eval-region) (global-set-key [(f8)] 'ess-eval-buffer) (global-set-key [(f9)] 'ess-eval-line-and-go) (global-set-key [(f10)] 'ess-eval-function-and-go) (global-set-key [(f11)] 'ess-eval-region-and-go) (global-set-key [(f12)] 'ess-eval-buffer-and-go) ;; Window splitting routines (global-set-key [(f2)] 'split-window-horizontally) (global-set-key [(f3)] 'split-window-vertically) ;; Sketch stuff for saving - incompatible with some versions, you may hate ;; - Now hitting Control+S saves instead of searching. ;; This doesn't always work depending on the version... (global-unset-key "\C-s") ;;(global-set-key "\C-s" "\C-x\C-s") (global-set-key "\C-s" 'save-buffer) ;; Be careful with this - maybe leave it off? ;; It means cwd for R will be wherever you currently are (e.g. current filename editing - that path) (custom-set-variables '(ess-ask-for-ess-directory nil)) ;; A few other things - useful when you have more than one window open (global-set-key [(control prior)] 'switch-to-next-buffer) (global-set-key [(control next)] 'other-window) ;; Start R with Control+e (global-set-key "\C-e" 'R) ; Now, this is just coolness!!! You've got to try it with a LaTeX document! (global-set-key "\C-t" 'flyspell-mode) ; Fixes the soft word-wrapping when 'split-horizontal'!!! (custom-set-variables '(truncate-partial-width-windows nil))