From 001b7b28dd4d8cea563dbae708d55c10d98cf8ec Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Thu, 24 Sep 2009 00:34:31 +0200 Subject: emacs: general cleanup --- emacs | 112 +++++++++++++++--------------------------------------------------- 1 file changed, 25 insertions(+), 87 deletions(-) (limited to 'emacs') diff --git a/emacs b/emacs index 7926c02..2b62d26 100644 --- a/emacs +++ b/emacs @@ -8,9 +8,6 @@ ;; Define the load path (setq load-path (cons "~/.emacs.d/" load-path)) -;; Start the daemon, then use emacsclient as editor -;(server-start) - ;; Turn off the toolbar (tool-bar-mode -1) ;; @@ -26,8 +23,6 @@ ;{{{ Look & Feel ; ;; Default font -;; - problematic with new frames, also set in Xdefaults: -;; Emacs.font: -xos4-terminus-medium-r-normal-*-12-120-72-72-c-60-iso8859-2 (set-default-font "-xos4-terminus-medium-r-normal-*-12-120-72-72-c-60-iso8859-2") @@ -50,9 +45,6 @@ (setq message-log-max nil) (kill-buffer "*Messages*") -;; Display time in the modeline -;(display-time) -;; ;; Show column number in modeline (setq column-number-mode t) @@ -92,12 +84,12 @@ ;{{{ General settings ; -;; Provide a useful error trace if loading .emacs fails +;; Provide an error trace if loading .emacs fails (setq debug-on-error t) ;; Encoding (prefer-coding-system 'utf-8) -(set-language-environment 'UTF-8) +(set-language-environment 'utf-8) (setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) @@ -140,11 +132,8 @@ ;; Default major mode (setq default-major-mode 'text-mode) ;; -;; Wrap lines at 70, for txt mode or, +;; Wrap lines at 70 in text-mode (add-hook 'text-mode-hook 'turn-on-auto-fill) -;(add-hook 'text-mode-hook 'longlines-mode) -;; ...for all major modes -;(setq-default auto-fill-function 'do-auto-fill) ;; ;; Text files end in new lines. (setq require-final-newline t) @@ -157,12 +146,6 @@ ; ;; Enable mouse scrolling (mouse-wheel-mode t) -;; -;; Fix mouse scrolling in GNU Screen -(if window-system - (xterm-mouse-mode -1) - (xterm-mouse-mode 1) -) ;; Push the mouse out of the way on cursor approach (mouse-avoidance-mode 'jump) @@ -176,7 +159,7 @@ ;; Start scrolling when 2 lines from top/bottom (setq scroll-margin 2) ;; -;; Fix the whole huge-jumps-scrolling-between-windows +;; Fix the scrolling on jumps between windows (setq scroll-conservatively 5) ;; Cursor in same relative row and column during PgUP/DN @@ -190,7 +173,7 @@ (setq kill-read-only-ok 1) ;; Partially integrate the kill-ring and X cut-buffer -'(x-select-enable-clipboard t) +(setq x-select-enable-clipboard t) ;; Copy/paste with accentuation intact (setq selection-coding-system 'compound-text-with-extensions) @@ -223,11 +206,6 @@ ) -;; Egg (git interface) -(require 'egg) -(setq egg-enable-tooltip t) - - ;; EasyPG assistant (GPG mode) (require 'epa) @@ -235,8 +213,13 @@ ;; Tramp (remote files editing) (require 'tramp) (setq tramp-default-method "ssh") -;; Disable version control to speed up things -;(setq vc-handled-backends nil) + + +;; Egg (git interface) +;; - http://github.com/bogolisk/egg +(require 'egg) +;; Enable tooltips while we are still learning +(setq egg-enable-tooltip t) ;; SCPaste (scp pastebin) @@ -255,18 +238,12 @@ (require 'foldingo) -;; Dired (directory management) -;(load "dired-x") -(setq dired-dwim-target t) - - ;; Ediff ;; ;; Don't spawn a new frame (setq ediff-window-setup-function 'ediff-setup-windows-plain) -;; ;; Split the frame horizontally -;(setq ediff-split-window-function 'split-window-horizontally) +(setq ediff-split-window-function 'split-window-horizontally) ;; Saveplace @@ -282,33 +259,17 @@ (icomplete-mode t) -;; CUA mode -;; - use C-c and C-v for copy and paste -;(cua-mode t) -;(setq cua-keep-region-after-copy t) - - ;; Auto Compression -;; - edit files in compressed archives (tar/jar/zip...) +;; - edit files in compressed archives (auto-compression-mode 1) ;; Speedbar settings (require 'speedbar) -;; ;; Additional extensions we are interested in (speedbar-add-supported-extension - '("PKGBUILD" - ".txt" - ".org" - ".pdf" - ".css" - ".php" - ".conf" - ".patch" - ".diff" - ".lua" - ".sh") + '("PKGBUILD" ".txt" ".org" ".pdf" ".css" + ".php" ".conf" ".patch" ".diff" ".lua" ".sh") ) ;}}} @@ -327,7 +288,7 @@ ) ;}}} -;{{{ Timestamp function, for public config files +;{{{ Timestamp function, for public dotfiles ; - date-stamp is more appropriate for txt files ; (defun aic-dotfile-stamp () @@ -411,7 +372,6 @@ If there is no *ansi-term*, run it." (defun aic-org-agenda () "Show the org-mode agenda." (interactive) - ;; To be used with a keybinding (see below) (call-interactively 'org-agenda-list) ) ;}}} @@ -447,24 +407,14 @@ If there is no *ansi-term*, run it." ;{{{ Main bindings ; -;; M-x without Alt -(global-set-key "\C-x\C-m" 'execute-extended-command) -(global-set-key "\C-c\C-m" 'execute-extended-command) - ;; C-w to backward kill for compatibility (and ease of use) (global-set-key "\C-w" 'backward-kill-word) ;; ...and then provide alternative for cutting (global-set-key "\C-x\C-k" 'kill-region) -(global-set-key "\C-c\C-k" 'kill-region) ;; Change C-x C-b behavior (buffer management) -;(global-set-key "\C-x\C-b" 'bs-show) -;(global-set-key "\C-x\C-b" 'ibuffer) (global-set-key "\C-x\C-b" 'electric-buffer-list) -;; Alternative to C-x o, as in Mozilla -(global-set-key [(control tab)] 'other-window) - ;; Reload or edit .emacs as defined above (global-set-key "\C-c\C-r" 'aic-reload-dot-emacs) (global-set-key "\C-c\C-e" 'aic-edit-dot-emacs) @@ -487,29 +437,20 @@ If there is no *ansi-term*, run it." (global-set-key (kbd "") 'menu-bar-mode) ;; Jump to the start/end of the document with C-PgUP/DN -(global-set-key [C-prior] (lambda()(interactive)(goto-char (point-min)))) -(global-set-key [C-next] (lambda()(interactive)(goto-char (point-max)))) +(global-set-key [C-prior] (lambda () (interactive) (goto-char (point-min)))) +(global-set-key [C-next] (lambda () (interactive) (goto-char (point-max)))) -;; Avoid accidental scrolling -(global-set-key (kbd "") '(lambda () (interactive) nil)) - -;; Disable C-z on X11 sessions -(when window-system - (global-unset-key "\C-z") -) - -;; Require C-x C-c prompt. So you can't shut it off by accident +;; Require C-x C-c prompt, no accidental quits (global-set-key [(control x) (control c)] (function (lambda () (interactive) (cond ((y-or-n-p "Quit? ") - (save-buffers-kill-emacs))))) + (save-buffers-kill-emacs))))) ) ;}}} ;{{{ Fn bindings ; -;; Invoke manual for word under the cursor (global-set-key [f1] (lambda () (interactive) (manual-entry (current-word)))) (global-set-key [f2] (lambda () (interactive) (find-file "~/.org/notes.org"))) (global-set-key [f3] 'aic-org-agenda) ; Function defined previously @@ -554,9 +495,6 @@ If there is no *ansi-term*, run it." (setq org-agenda-files (list "~/.org/index.org" "~/.org/work.org" "~/.org/personal.org" "~/.org/computers.org") ) - -;; Finally, connect org-mode with remember -(org-remember-insinuate) ;}}} @@ -567,6 +505,9 @@ If there is no *ansi-term*, run it." ;; Initialization (require 'remember) +;; Connect with org-mode +(org-remember-insinuate) +;; ;; Notes file (setq org-default-notes-file (concat org-directory "/notes.org")) ; @@ -581,8 +522,7 @@ If there is no *ansi-term*, run it." ) ;; Remember frames -;; - capture a note from any desktop/tag with a small emacs frame -;; - call: emacsclient -e '(make-remember-frame)' +;; - $ emacsclient -e '(make-remember-frame)' ;; ;; Org-remember splits windows, force it to a single window (add-hook 'remember-mode-hook 'delete-other-windows) @@ -612,7 +552,6 @@ If there is no *ansi-term*, run it." ;{{{ Calendar settings -; - for me only important in the context of org-mode ; (setq holidays-in-diary-buffer t @@ -651,7 +590,6 @@ If there is no *ansi-term*, run it." ;}}} ;{{{ Python mode -; - switched from sf.net py-mode to python-mode distributed with Emacs ; ;; ipython is my shell of choice, glad to have it here (defcustom python-python-command "ipython -cl" -- cgit v1.2.3