;; -*-emacs-lisp-*- (load-library "xterm-256color") ;; Set the short-cut keys ;; (define-key global-map [f1] (lambda () (interactive) (manual-entry (current-word)))) (define-key global-map [f2] 'find-file) ;; F2 - OPEN (define-key global-map [f3] 'kill-buffer-fast) ;; F3 - CLOSE (define-key global-map [f4] 'goto-line) ;; F4 - GOTO LINE (define-key global-map [f5] 'other-window) (define-key global-map [f7] 'replace-string) ;; F7 - REPLACE ;;(define-key global-map [f9] 'ispell-buffer) ;; F9 - UNDO (define-key global-map [f10] 'compile) ;; F10 - COMPILE (define-key global-map [f11] 'next-error) ;; F11 - NEXT ERROR (define-key global-map [f12] 'add-change-log-entry-other-window) ;; F12 - CHANGE LOG ;; Fix 'home' and 'end' keys ;; ( global-set-key [home] 'beginning-of-line) ( global-set-key [end] 'end-of-line) ;; Set Meta + P to next error ;; ( global-set-key "\M-p" 'next-error) ;; Make control+pageup/down scroll the other buffer ;; (global-set-key [C-next] 'scroll-other-window) (global-set-key [C-prior] 'scroll-other-window-down) ;; Dont show the GNU splash screen ;; (setq inhibit-startup-message t) ;; Make all "yes or no" prompts show "y or n" instead ;; (fset 'yes-or-no-p 'y-or-n-p) ;; Paste at point NOT at cursor ;; (setq mouse-yank-at-point 't) ;; Open unidentified files in text mode ;; (setq default-major-mode 'text-mode) ;; Windows-like selection ;; (pc-selection-mode) ;; Automagically read compressed files ;; (auto-compression-mode 1) ;; Display clock ;; (display-time) ;; Compile command line to use : ;; (setq compile-command "make -k") ;; over the filesystem. ;; (defun make-backup-file-name (file-name) "Create the non-numeric backup file name for `file-name'." (require 'dired) (if (file-exists-p "~/.backups") (concat (expand-file-name "~/.backups/") (dired-replace-in-string "/" "|" file-name)) (concat file-name "~"))) ;; accents (standard-display-european 1) ;; ;;(setq ispell-process-directory (expand-file-name "~/")) ;;(add-to-list 'ispell-dictionary-alist ;; '("castellano" ;; "[A-Za-z]" ;; "[^A-Za-z]" ;; "[-]" t ("-TTeX" "-d" "castellano") "~latin1" iso-8859-1)) ;; Set spanish dictionary as default one ;(setq ispell-local-dictionary "~/.local-dict") ;(setq ispell-personal-dictionary "~/.local-dict") ;; Do running spell check in text mode. ;;(add-hook 'text-mode-hook 'flyspell-mode) ;; Set the dictionary for the spell check. ;;(setq flyspell-mode-hook ;; '(lambda () "Sets the dictionary for flyspell on startup." ;; (ispell-change-dictionary "castellano"))) ;; Ctrl-Tab to spellcheck the word under the cursor. ;;(global-set-key [C-tab] 'ispell-word) ;;(setq ispell-personal-dictionary "~/.ispell-dictionary") ;;(setq flyspell-mode t) ;; tab, colour, and misc options ;; (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(Info-additional-directory-list (quote ("/usr/info" "/usr/share/info"))) '(Info-fontify t) '(asm-comment-char 59) '(auto-revert-interval 2) '(auto-revert-stop-on-user-input nil) '(c-basic-offset 8) '(c-default-style "K&R") '(c-progress-interval 2) '(c-tab-always-indent (quote other)) '(column-number-mode t) '(compilation-ask-about-save nil t) '(compilation-scroll-output t) '(compilation-window-height 6 t) '(delete-old-versions t) '(display-hourglass nil) '(fill-column 80) '(font-lock-global-modes t) '(font-lock-maximum-decoration t) '(font-lock-support-mode (quote lazy-lock-mode)) '(global-auto-revert-mode t nil (autorevert)) '(global-font-lock-mode t nil (font-lock)) '(hourglass-delay 0) '(indent-tabs-mode t) '(ispell-dictionary-alist (quote (("slovak" "[A-Za-z]" "[^A-Za-z]" "" nil ("-B" "-d" "slovak") nil iso-8859-2)))) '(line-number-mode t) '(standard-indent 4) '(tab-width 8)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Spelling ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;(setq ispell-default-dictionary "castellano") ;;(setq ispell-change-dictionary "castellano") ;;(setq flyspell-default-dictionary "castellano") ;;(setq flyspell-mode-line-string " oGer") ;;(add-hook 'text-mode-hook 'flyspell-mode) ;; disable any noise ;; (setq bell-volume 0) ;;(setq visible-bell f) ;; hide the menu bar ;; (menu-bar-mode nil) (tool-bar-mode nil) (setq menubar-visible-p nil) (setq default-toolbar-visible-p nil) ;; Useful function: ;; convert dos (^M) end of line to unix end of line (defun dos2unix() (interactive) (goto-char(point-min)) (while (search-forward "\r" nil t) (replace-match ""))) ;; Useful function: ;; unix2dos (defun unix2dos() (interactive) (goto-char(point-min)) (while (search-forward "\n" nil t) (replace-match "\r\n"))) ;; Useful function: ;; Insert date into buffer (defun insert-date () "Insert date at point." (interactive) (insert (format-time-string "%A, %B %e, %Y %k:%M:%S %z"))) ;; Useful function: ;; Compute the length of the marked region (defun region-length () "length of a region" (interactive) (message (format "%d" (- (region-end) (region-beginning))))) ;; Custom Faces (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(highlight ((((type tty) (class color)) (:background "black" :foreground "white")))) '(menu ((((type tty)) (:background "#749EC8" :foreground "white" :inverse-video t)))) '(mode-line ((t (:background "gray15" :foreground "gray38"))))) (setq inhibit-startup-message t) (setq display-time-day-and-date t) (setq display-time-24hr-format t) (display-time) (fset 'yes-or-no-p 'y-or-n-p) (setq load-path (cons (expand-file-name "/usr/share/emacs/site-lisp") load-path)) (setq default-major-mode 'text-mode) (add-hook 'text-mode-hook 'turn-on-auto-fill) (setq-default transient-mark-mode t) (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) (add-hook 'c-mode-hook 'turn-on-font-lock) (global-font-lock-mode t) (setq font-lock-maximum-decoration t) (setq default-frame-alist (append default-frame-alist ;;'((foreground-color . "yellow") '((foreground-color . "gray50") ;; '((foreground-color . "wheat") ;; (background-color . "black") ;; (cursor-color . "green3")))) ))) (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t ) (autoload 'xml-mode "psgml" "Major mode to edit XML files." t) (setq auto-mode-alist (append (list '("\\.html$" . sgml-mode) '("\\.phtml$" . sgml-mode) '("\\.sgm$" . sgml-mode) '("\\.sgml$" . sgml-mode) '("\\.xml$" . xml-mode) '("\\.xsl$" . xml-mode) '("\\.dcl$" . dtd-mode) '("\\.dec$" . dtd-mode) '("\\.dtd$" . dtd-mode) '("\\.ent$" . dtd-mode) '("\\.mod$" . dtd-mode)) auto-mode-alist)) (setq sgml-validate-command "/usr/bin/nsgmls -s -c/etc/sgml/catalog %s %s") (setq sgml-catalog-files '("/etc/sgml/catalog" "CATALOG")) (setq xml-catalog-files '("/etc/xml/catalog" "CATALOG")) (autoload 'dtd-mode "tdtd" "Major mode for SGML and XML DTDs.") ;; PSGML, courtesy of David Megginson, dmeggins@uottawa.ca ;; (make-face 'sgml-comment-face) (set-face-foreground 'sgml-comment-face "deepskyblue3") (make-face 'sgml-doctype-face) (set-face-foreground 'sgml-doctype-face "plum") (make-face 'sgml-end-tag-face) (set-face-foreground 'sgml-end-tag-face "green4") (make-face 'sgml-ignored-face) (set-face-foreground 'sgml-ignored-face "blue") (make-face 'sgml-ms-end-face) (set-face-foreground 'sgml-ms-end-face "maroon") (make-face 'sgml-ms-start-face) (set-face-foreground 'sgml-ms-start-face "maroon") (make-face 'sgml-pi-face) (set-face-foreground 'sgml-pi-face "mediumpurple3") (make-face 'sgml-sgml-face) (set-face-foreground 'sgml-sgml-face "maroon") (make-face 'sgml-start-tag-face) (set-face-foreground 'sgml-start-tag-face "green4") (make-face 'sgml-entity-face) (set-face-foreground 'sgml-entity-face "plum") (make-face 'sgml-short-ref-face) (set-face-foreground 'sgml-short-ref-face "firebrick") (setq-default sgml-markup-faces '((comment . sgml-comment-face) (doctype . sgml-doctype-face) (end-tag . sgml-end-tag-face) (ignored . sgml-ignored-face) (ms-end . sgml-ms-end-face) (ms-start . sgml-ms-start-face) (pi . sgml-pi-face) (sgml . sgml-sgml-face) (start-tag . sgml-start-tag-face) (entity . sgml-entity-face) (short-ref . sgml-short-ref-face))) ;;(setq-default sgml-auto-activate-dtd t) (setq-default sgml-set-face t) (setq-default sgml-auto-insert-required-elements t) ;;(setq-default sgml-general-dtd-info f) (normal-erase-is-backspace-mode 1) ;(standard-display-european 1) ;(load-library "iso-ascii") ;; Emacs settings for NASM ;; 2002, written by Manfred Minimair ; Make sure that that emacs switches into assembler mode ; when a .asm file is opened. (setq auto-mode-alist (append ;; File name (within directory) ends with .asm '(("\\.asm\\'" . asm-mode)) auto-mode-alist)) ; Customize the compilation command for the assembler mode ; Compiles assembler files "file.asm" with ; make -k -e EXECUTABLE=file (add-hook 'asm-mode-hook (function (lambda () (make-local-variable 'compile-command) (setq compile-command (concat "make -k -e EXECUTABLE=" (file-name-sans-extension (file-name-nondirectory buffer-file-name))) )))) ;;(require 'gpl) ;;(require 'gpl-copying) ;;(setq gpl-organization "name") ;;(require 'xcscope) ;;(define-key global-map [ctrl f3] 'cscope-set-initial-directory) ;;(define-key global-map [(control f4)] 'cscope-unset-initial-directory) ;;(define-key global-map [(control f5)] 'cscope-find-this-symbol) ;;(define-key global-map [f2] 'cscope-find-global-definition) ;;(define-key global-map [(control f7)] ;; 'cscope-find-global-definition-no-prompting) ;;(define-key global-map [(control f8)] 'cscope-pop-mark) ;;(define-key global-map [(control f9)] 'cscope-next-symbol) ;;(define-key global-map [(control f10)] 'cscope-next-file) ;;(define-key global-map [(control f11)] 'cscope-prev-symbol) ;;(define-key global-map [(control f12)] 'cscope-prev-file) ;;(define-key global-map [(meta f9)] 'cscope-display-buffer) ;;(define-key global-map [(meta f10)] 'cscope-display-buffer-toggle) ;; nXML ;;(load "~/nxml-mode-20041004/rng-auto.el") ;;(setq auto-mode-alist ;; (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode) ;; auto-mode-alist)) ;;(unify-8859-on-decoding-mode)