;; start editing server (server-start) ;; tramp (require 'tramp) (setq tramp-default-method "scpx") ;; set the load path (setq load-path (cons "/home/brix/.emacs.d" load-path)) ;; load local extensions (require 'templates) (load "/usr/share/emacs/site-lisp/site-gentoo") ;; e-mail (setq user-mail-address "brix@gentoo.org") ;; do not show the startup message (setq inhibit-startup-message t) ;; iswitchb-mode is a must (iswitchb-mode t) ;; turn off the tool-bar (tool-bar-mode nil) ;; automaticall de/compress files (auto-compression-mode t) ;; set the title (setq frame-title-format (format "GNU/Emacs: %%f")) ;; turn off blinking cursor (blink-cursor-mode nil) ;; blink frame instead of bell (setq visible-bell t) ;; load support for our fancy wheel mouse (mouse-wheel-mode t) ;; make the mouse cursor and the point play cat-and-mouse (mouse-avoidance-mode 'cat-and-mouse) ;; use aspell, not ispell (setq ispell-program-name "aspell") ;; use the danish dictionary as default (setq ispell-dictionary "dansk") ;; indent should insert tabs (setq indent-tabs-mode t) (setq tab-width 4) ;; turn on font-lock (setq font-lock-maximum-decoration t) (global-font-lock-mode t) ;; show matching paren (show-paren-mode t) ;; highlight the active region (transient-mark-mode t) ;; highlight searches (setq search-highlight t) ;; highlight query/replace (setq query-replace-highlight t) ;; show trailing whitespace (setq-default show-trailing-whitespace t) ;; show column number (setq column-number-mode t) ;; always end a file with a newline (setq require-final-newline t) ;; stop at the end of the file, don't just add lines (setq next-line-add-newlines nil) ;; key binding for going to a specific line (global-set-key [(meta g)] 'goto-line) ;; major-mode hooks goes here (add-hook 'TeX-mode-hook (lambda () ;; spellcheck on-the-fly (flyspell-mode t) ;; let ispell handle TeX (setq ispell-parser 'tex) ;; use reftex (turn-on-reftex) (setq reftex-use-multiple-selection-buffers t) (setq reftex-enable-partial-scans t) ;; use varioref as default (setq reftex-vref-is-default t) (setq reftex-plug-into-AUCTeX t))) (add-hook 'LaTeX-mode-hook (lambda () ;; default to PDF mode (TeX-PDF-mode) ;; add acrobat reader to our list of commands (add-to-list 'TeX-command-list '("Acrobat Reader" "acroread %s.pdf" TeX-run-silent nil nil)) ;; add ggv to our list of commands (add-to-list 'TeX-command-list '("Gnome Ghostview" "ggv %s.pdf" TeX-run-silent nil nil)) ;; default to use acroread for viewing (setq-default TeX-command-Show "Acrobat Reader") ;; shortcut for our tempo template (define-key LaTeX-mode-map [(control c) (control t)] 'tempo-template-latex))) (add-hook 'perl-mode-hook (lambda () (setq indent-tabs-mode 't) (setq tab-width 4) (setq perl-indent-level 4))) ;; magicpoint keywords (defconst mgp-font-lock-keywords (list '("^#.*" . font-lock-comment-face) '("^%%.*" . font-lock-comment-face) '("\"[^\"]*\"" . font-lock-string-face) '("\\<\\(arc\\|box\\|delta1\\|delta2\\|delta3\\|delta4\\|dia\\)\\>" . font-lock-type-face) '("%?\\<\\(size\\|fore\\|back\\|bgrad\\|ccolor\\|left\\|leftfill\\|center\\|right\\|shrink\\|lcutin\\|rcutin\\|cont\\|nodefault\\|xfont\\|vfont\\|tfont\\|tfont0\\|bar\\|image\\|prefix\\|icon\\|bimage\\|default\\|tab\\|tabprefix\\|page\\|vgap\\|hgap\\|pause\\|mark\\|again\\|system\\|xsystem\\|filter\\|endfilter\\|vfcap\\|tfdir\\|deffont\\|font\\|embed\\|endembed\\|noop\\|linestart\\|lineend\\|quality\\|pcache\\|charset\\)\\>" . font-lock-function-name-face)) "font-lock-keywords for mgp-mode") (add-hook 'mgp-mode-hook (lambda () ;; set initial coding system (setq buffer-file-coding-system 'iso-8859-1) ;; mgp command line options (setq mgp-options "-g 800x600") ;; page seperator (setq mgp-page-separator "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") ;; use tabs (setq indent-tabs-mode t) ;; syntax highlight (setq font-lock-defaults '(mgp-font-lock-keywords)))) (add-hook 'python-mode-hook (lambda () (make-local-variable 'indent-tabs-mode) (setq indent-tabs-mode 't) (make-local-variable 'py-indent-offset) (setq py-indent-offset 8))) ;; use plain text mode for .css files (add-to-list 'auto-mode-alist '("\\.css\\'" . text-mode)) ;; use ebuild-mode for runscript scripts (add-to-list 'interpreter-mode-alist '("runscript" . ebuild-mode)) ;; use crontab-mode for crontab.* files (add-to-list 'auto-mode-alist '("crontab\\.*" . crontab-mode)) ;; use c++-mode for *.gob files (add-to-list 'auto-mode-alist '("\\.gob" . c++-mode)) ;; use c++-mode for *.js files (add-to-list 'auto-mode-alist '("\\.js\\'" . c++-mode)) ;; use po-mode for .po files (require 'po-mode) (add-to-list 'auto-mode-alist '("\\.po\\'" . po-mode)) ;; ebuild-mode for gentoo .ebuilds (defun ebuild-mode () (shell-script-mode) (sh-set-shell "bash") (make-local-variable 'indent-tabs-mode) (setq indent-tabs-mode 't) (make-local-variable 'tab-width) (setq tab-width 4)) (add-to-list 'auto-mode-alist '("\\.ebuild\\'" . ebuild-mode)) (add-to-list 'auto-mode-alist '("\\.eclass\\'" . ebuild-mode)) (defun linux-c-mode () "C mode with adjusted defaults for use with the Linux kernel" (interactive) (c-mode) (c-set-style "K&R") (setq tab-width 8) (setq indent-tabs-mode t) (setq c-basic-offset 8)) ;; set up gtk-doc for GIMP style comments (load "gtk-doc") (setq-default gnome-doc-header "/**\n * %s:\n") (setq-default gnome-doc-blank " *\n") (setq-default gnome-doc-parameter " * @%s: \n") (setq-default gnome-doc-trailer " */\n") (setq-default gnome-doc-section " * Returns:\n") (setq-default gnome-doc-match-block "^ * ") (setq-default gnome-doc-match-header "^/\\*\\*") ;; extra C type keywords (setq c-font-lock-extra-types (list "gboolean" "gsize" "gssize" "gchar" "guchar" "gint" "gint8" "gint16" "gint32" "guint" "guint8" "guint16" "guint32" "gshort" "gushort" "glong" "gulong" "gfloat" "gdouble" "gpointer" "gconstpointer" "GList" "GSList" "GFunc" "GString" "GINT_\\w+" "GUINT_\\w+" "GPOINTER_\\w+" "G_\\w+" "Gtk\\w+" "Gdk\\w+" "GTK\\w+" "GDK\\w+" "Gimp" "Gimp\\w+" "GIMP\\w+" "FT_\\w+" "Pango\\w+" "PANGO\\w+" "GCallback" "GQuark" "GError" "GObject" "GObjectClass" "GValue" "GType" "GParamSpec" "GParameter" "GObjectConstructParam" "GTypeInfo" "GBaseInitFunc" "GBaseFinalizeFunc" "GClassInitFunc" "GClassFinalizeFunc" "GClassData" "GInstanceInit" "GTypeInstance" "GScanner" "GScannerConfig" "GTokenType" "GSource" "GMainLoop" "GMainContext" "GPollFunc" "GThreadFunctions" "GThreadFunc" "GThreadPriority" "GThread" "GMutex" "GStaticMutex" "GStaticRecMutex" "FALSE" "TRUE" "NULL" "FILE" "MIN" "MAX" "CLAMP" "ABS" "DIR" "\\sw+_t" "GCim\\w+" "bool" "true" "false" "Gkrellm\\w+" "WifiMon" "GObex\\w+" "GOBEX\\w+")) ;; set up faces for X (if (string-equal window-system "x") (progn ;; mode-line (set-face-foreground 'mode-line "Black") ;; Gorilla ;(set-face-background 'mode-line "#dedfce") ;; Mist (set-face-background 'mode-line "#eaeaea") ;; tool-bar ; (set-face-foreground 'tool-bar "Wheat") ; (set-face-background 'tool-bar "DarkSlateGray") ;; custom buttons ; (require 'cus-edit) ; (set-face-foreground 'custom-button-face "Wheat") ; (set-face-background 'custom-button-face "DarkSlateGray") ; (set-face-foreground 'custom-button-pressed-face "Wheat") ; (set-face-background 'custom-button-pressed-face "DarkSlateGray") ;; scroll-bar ;; Gorilla ;(set-face-foreground 'scroll-bar "#dedfce") ;(set-face-background 'scroll-bar "#cdcdb2") ;; Mist (set-face-foreground 'scroll-bar "#cdcdb2") (set-face-background 'scroll-bar "#dedfce") ;; menu ; (set-face-foreground 'menu "Wheat") ; (set-face-background 'menu "DarkSlateGray") ; (set-face-font 'menu "fixed") ;; mouse and cursor (set-face-background 'mouse "Orchid") (set-face-background 'cursor "Orchid") ;; trailing-whitespace (set-face-background 'trailing-whitespace "Red") ;; default (set-face-foreground 'default "White") (set-face-background 'default "gray33") ; (set-face-font 'default "fixed") ) )