2009/05/11

emacsの設定

最低限これだけは....



;;like shell prompt
(global-set-key "\C-u"
(lambda ()
(interactive)
(beginning-of-line)
(kill-line)))

;;C-h is backspace
(global-set-key "\C-h" 'backward-delete-char-untabify)
(setq backward-delete-char-untabify-method 'hungry)

(global-set-key "\C-w" 'my-kill-region-or-backward-kill-word)
(defun my-kill-region-or-backward-kill-word ()
"if mark is active,kill-region. or backward-kill-word"
(interactive)
(if mark-active
(kill-region (point) (mark))
(backward-kill-word 1)))

;;highlight search/replace
(setq query-replace-highlight t)
(setq search-highlight t)

;;dont show cursor in non-active windows
(setq default-cursor-in-non-selected-windows nil)

;;when cursor is at head of line, kill whole line
(setq kill-whole-line t)

;;add new line to EOF
(setq require-final-newline 't)

;;auto revert mode on
(global-auto-revert-mode 1)
;;show function name
(which-function-mode 1)

;;no use tab-char
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)

;;for overflowed lines
(setq truncate-lines nil)
(setq truncate-partial-width-windows nil)

;;ignore Capital or Small character
(setq completion-ignore-case t)
(setq read-file-name-completion-ignore-case t)
(setq case-fold-search t)

;;font lock on
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)


;;blink correspond-braket
(show-paren-mode t)
(setq show-paren-ring-bell-on-mismatch t)
(setq show-paren-style 'mixed)
;;(setq show-paren-style 'parenthesis)
;;ignore parse in comments
;;(setq parse-sexp-ignore-comments t)

;;region color on
(transient-mark-mode 1)

;;make isearch high-light clearer
(setq isearch-lazy-highlight-initial-delay 0)

;;y or n
(fset 'yes-or-no-p 'y-or-n-p)

;;no start-up messege
(setq inhibit-startup-message t)
(setq initial-scratch-message nil)

;;disable auto-save
(setq make-backup-files nil)
(setq backup-inhibited t)
(setq auto-save-default nil)
(setq auto-save-list-file-name nil)
(setq auto-save-list-file-prefix nil)
(setq delete-auto-save-file-if-necessary t)
(setq delete-auto-save-files t)

(add-hook 'fortran-mode-hook
(lambda ()
(local-set-key "\C-c\C-c" 'compile)
(local-set-key "\C-cc" 'fortran-compile)
(setq fortran-blink-matching-if t)
(setq comment-line-start "c")
(setq fortran-do-indent 2)
(setq fortran-if-indent 2)
(setq fortran-structure-indent 2)
(setq fortran-continuation-indent 5)
(setq fortran-comment-line-extra-indent 0)
(setq fortran-continuation-string "&")
(setq fortran-comment-region "c")
(setq fortran-comment-indent-style nil)
(fortran-auto-fill-mode 1)
(abbrev-mode 1)
(setq outline-regexp "\\(c=\\|[ \t0-9]+program\\|[ \t0-9]+subroutine\\|[ \t0-9]+function\\)")
(outline-minor-mode t)))


0 件のコメント: