;(setq debug-on-error t) ;; *************************************************************** ;; General display customization ;; *************************************************************** (setq inhibit-startup-message t) (setq additional-paths '("/home/prash" "/home/prash/.emacs-lisp" "/usr/share/emacs/site-lisp" "/usr/share/emacs/site-lisp/muse" "/usr/share/emacs/site-lisp/preview-latex")) (setq load-path (append additional-paths load-path)) (setq font-lock-maximum-decoration t) (setq visible-bell t) (setq x-select-enable-clipboard t) (setq require-final-newline t) (setq resize-minibuffer-frame t) (setq column-number-mode t) (setq-default transient-mark-mode t) (setq next-line-add-newlines nil) (setq blink-matching-paren nil) (global-font-lock-mode 1 t) (blink-cursor-mode -1) (tool-bar-mode -1) (tooltip-mode -1) (setq user-mail-address "prashmohan gmail com") (setq user-full-name "Prashanth Mohan") (defun changelog-entry () "Add entry to ChangeLog" (interactive) (progn (if (equal (file-name-nondirectory (buffer-file-name)) "ChangeLog") (progn (basic-save-buffer) (kill-buffer "ChangeLog")) (progn (add-change-log-entry))) ; (insert (current-time-string) "\n"))) )) (global-set-key "\M-n" 'changelog-entry) ;; ***************************************************************** ;; Save everything in UTF-8 ;; ***************************************************************** (prefer-coding-system 'utf-8) (set-language-environment 'UTF-8) (set-default-coding-systems 'utf-8) (setq file-name-coding-system 'utf-8) (setq default-buffer-file-coding-system 'utf-8) (setq coding-system-for-write 'utf-8) (set-keyboard-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) (set-clipboard-coding-system 'utf-8) (set-selection-coding-system 'utf-8) (setq default-process-coding-system '(utf-8 . utf-8)) (add-to-list 'auto-coding-alist '("." . utf-8)) ;; ***************************************************************** ;; Don't take any backups ;; ***************************************************************** (setq backup-inhibited t) ;; ******************************* ;; Initialization for template ;; ******************************* (require 'template) (template-initialize) ;; *************************************************************** ;; My frame setup... ;; *************************************************************** (setq initial-frame-alist '((top . 26) (left . 465) (width . 50) (height . 60))) (setq frame-title-format "Emacs %f") (setq icon-title-format "%b") ;; *************************************************************** ;; News and mail customizations ;; *************************************************************** ;;general mail account name settings (setq user-mail-address "prash86@gmail.com") (setq user-full-name "Prashanth Mohan") ;; *************************************************************** ;; Scrolling Setup ;; *************************************************************** (setq scroll-step 4) ;; *************************************************************** ;; Basic Modes and Editing ;; *************************************************************** (setq default-major-mode 'text-mode) (add-hook 'text-mode-hook 'turn-on-auto-fill) (setq auto-mode-alist (cons '("Wishlist" . text-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("README" . text-mode) auto-mode-alist)) ;; *************************************************************** ;; sh mode for conf files ;; *************************************************************** (setq auto-mode-alist (cons '("\\.conf$" . sh-mode) auto-mode-alist)) ;; *************************************************************** ;; Tab setup ;; *************************************************************** (setq-default tab-width 8 standard-indent 8 indent-tabs-mode t) ;; *************************************************************** ;; Word Count ;; *************************************************************** (defun wc () "Count the words in the current buffer, show the result in the minibuffer" (interactive) ; *** This is the line that you need to add (save-excursion (save-restriction (widen) (goto-char (point-min)) (let ((count 0)) (while (forward-word 1) (setq count(1+ count))) (message "There are %d words in the buffer" count))))) ;; **************************************************************** ;; Function to turn on Linux C indenting ;; **************************************************************** (add-hook 'c-mode-common-hook (lambda () (c-set-style "k&r"))) ;; ************************************************************** ;; Auto fill mode ;; ************************************************************** (add-hook 'c-mode-common-hook 'turn-on-auto-fill) (global-set-key (kbd "C-c q") 'auto-fill-mode) ;; *************************************************************** ;; Setup AUCTex ;; *************************************************************** (require 'tex-site) ;(load "auctex.el" nil t t) (load "preview-latex.el" nil t t) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) (add-hook 'LaTeX-mode-hook 'turn-on-auto-fill) ;; *************************************************************** ;; Misc Key Mappings ;; *************************************************************** (global-set-key [f1] 'search-forward) (global-set-key [f3] 'search-backward) (global-set-key [f2] 'replace-string) (global-set-key [f4] 'set-justification-full) ;JUSTIFY (global-set-key [f5] 'set-mark-command) ;MARK (global-set-key [f6] 'kill-ring-save) ;COPY (global-set-key [f7] 'yank) ;PASTE (global-set-key [f8] 'kill-region) ;DELETE (global-set-key [f9] 'setnu-mode) ;SETNU (global-set-key [f11] 'wc) ;WORD COUNT (global-set-key [f12] 'save-buffer) ;SAVE ;(global-set-key "\C-cf" 'font-lock-mode) (global-set-key "\C-ca" 'auto-fill-mode) ; 'y' for 'yes', 'n' for 'no' (fset 'yes-or-no-p 'y-or-n-p) (setq query-replace-highlight t) (setq search-highlight t) (global-set-key (kbd "RET") 'newline-and-indent) ;; **************************************************************** ;; line-to-top-of-window extension ;; **************************************************************** ;; Line to top of window (defun line-to-top-of-window() "Move the line point is on to the top of the window" (interactive) (recenter 0)) ;; **************************************************************** ;; psgml mode ;; **************************************************************** (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t) (autoload 'xml-mode "psgml" "Major mode to edit XML files." t) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(add-log-full-name "Prashanth Mohan") '(add-log-mailing-address "prashmohan@gmail.com") '(add-log-time-format (quote add-log-iso8601-time-string)) '(blink-cursor-mode nil) '(column-number-mode t) '(current-language-environment "UTF-8") '(erc-email-userid "prashmohan") '(erc-interpret-mirc-color t) '(erc-user-full-name "Prashanth Mohan") '(fill-column 72) '(global-font-lock-mode t nil (font-lock)) '(load-home-init-file t t) '(python-guess-indent t) '(python-honour-comment-indentation t) '(show-paren-mode t) '(speedbar-frame-parameters (quote ((minibuffer) (width . 20) (border-width . 0) (menu-bar-lines . 0) (tool-bar-lines . 0) (unsplittable . t) (set-background-color "black")))) '(transient-mark-mode t) '(x-select-enable-clipboard t)) ;; ****************************************************************** ;; Customized syntax highlighting colors ;; ****************************************************************** ;; (set-default-font "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*") ;; (set-default-font "Bitstream Vera Sans Mono-14") ;; (set-default-font "-*-verdana-medium-r-normal-*-14-*-*-*-*-*-iso8859-*") (set-foreground-color "#dbdbdb") (set-background-color "#000000") (set-cursor-color "#ff0000") (if (> (display-color-cells) 20) (custom-set-faces '(font-lock-builtin-face ((t (:foreground "deepskyblue")))) '(font-lock-comment-face ((t (:foreground "gray60")))) '(font-lock-doc-face ((t (:foreground "darkkhaki")))) '(font-lock-keyword-face ((t (:foreground "magenta")))) '(font-lock-function-name-face ((t (:foreground "green")))) '(font-lock-string-face ((t (:foreground "red")))) '(font-lock-type-face ((t (:foreground "cyan")))) '(font-lock-variable-name-face ((t (:foreground "yellow")))) '(modeline ((t (:foreground "plum1" :background "navy")))) '(region ((t (:background "sienna")))) '(highlight ((t (:foreground "black" :background "darkseagreen2")))) '(diff-added-face ((t (:foreground "green")))) '(diff-changed-face ((t (:foreground "yellow")))) '(diff-header-face ((t (:foreground "cyan")))) '(diff-hunk-header-face ((t (:foreground "magenta")))) '(diff-removed-face ((t (:foreground "red"))))) ) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(background "blue") '(diff-added-face ((t (:foreground "green")))) '(diff-changed-face ((t (:foreground "yellow")))) '(diff-header-face ((t (:foreground "cyan")))) '(diff-hunk-header-face ((t (:foreground "magenta")))) '(diff-removed-face ((t (:foreground "red")))) '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "Turquoise")))) '(font-lock-comment-face ((t (:foreground "MediumAquamarine")))) '(font-lock-constant-face ((((class color) (background dark)) (:bold t :foreground "DarkOrchid")))) '(font-lock-doc-face ((t (:foreground "darkkhaki")))) '(font-lock-doc-string-face ((t (:foreground "green2")))) '(font-lock-function-name-face ((t (:foreground "SkyBlue")))) '(font-lock-keyword-face ((t (:bold t :foreground "CornflowerBlue")))) '(font-lock-preprocessor-face ((t (:italic nil :foreground "CornFlowerBlue")))) '(font-lock-reference-face ((t (:foreground "DodgerBlue")))) '(font-lock-string-face ((t (:foreground "LimeGreen")))) '(font-lock-type-face ((t (:foreground "#9290ff")))) '(font-lock-variable-name-face ((t (:foreground "PaleGreen")))) '(font-lock-warning-face ((((class color) (background dark)) (:foreground "yellow" :background "red")))) '(highlight ((t (:background "CornflowerBlue")))) '(list-mode-item-selected ((t (:background "gold")))) '(makefile-space-face ((t (:background "wheat")))) '(mode-line ((t (:background "Navy")))) '(paren-match ((t (:background "darkseagreen4")))) '(region ((t (:background "DarkSlateBlue")))) '(show-paren-match ((t (:foreground "black" :background "wheat")))) '(show-paren-mismatch ((((class color)) (:foreground "white" :background "red")))) '(speedbar-button-face ((((class color) (background dark)) (:foreground "green4")))) '(speedbar-directory-face ((((class color) (background dark)) (:foreground "khaki")))) '(speedbar-file-face ((((class color) (background dark)) (:foreground "cyan")))) '(speedbar-tag-face ((((class color) (background dark)) (:foreground "Springgreen")))) '(vhdl-speedbar-architecture-selected-face ((((class color) (background dark)) (:underline t :foreground "Blue")))) '(vhdl-speedbar-entity-face ((((class color) (background dark)) (:foreground "darkGreen")))) '(vhdl-speedbar-entity-selected-face ((((class color) (background dark)) (:underline t :foreground "darkGreen")))) '(vhdl-speedbar-package-face ((((class color) (background dark)) (:foreground "black")))) '(vhdl-speedbar-package-selected-face ((((class color) (background dark)) (:underline t :foreground "black")))) '(widget-field ((((class grayscale color) (background light)) (:background "DarkBlue"))))) (put 'downcase-region 'disabled nil)