我的emacs配置

 

;; .emacs

;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)

;; turn on font-lock mode
(when (fboundp 'global-font-lock-mode)
  (global-font-lock-mode t))

;; enable visual feedback on selections
;(setq transient-mark-mode t)

;; default to better frame titles
(setq frame-title-format
      (concat  "%b - emacs@" (system-name)))

;; default to unified diffs
(setq diff-switches "-u")

;; always end a file with a newline
;(setq require-final-newline 'query)


(put 'upcase-region 'disabled nil)

;add  by  chenbing  
(defun indent-whole ()
  (interactive)
  (indent-region (point-min) (point-max) nil)
  (message "format successfully"))
(global-set-key [(meta f)] 'indent-whole)
(global-set-key [f2] 'indent-whole)
(global-set-key [f3] 'indent-whole)


(defun mycompile ()
(interactive)
(setq compile-command (concat  "gcc  -g  -lm "  (buffer-file-name)) )
(compile  compile-command))
(global-set-key [(meta c)] 'mycompile)

;(global-set-key (kbd "e") 'no-e-please)
(global-set-key [(meta g)] 'goto-line)


(tool-bar-mode nil)
(column-number-mode t)
(global-font-lock-mode 1)
(add-to-list 'load-path "~")
(setq column-number-mode t) 
(font-lock-mode   t) 
(global-set-key [f1] 'shell)
(global-set-key [f8] 'gdb)
;(setq compile-command "make -f  makefile ")
(setq compile-command (concat  "gcc  -g  -lm  "  (buffer-file-name)) )
(print (concat  "gcc  -g  -lm   "  (buffer-file-name)) )
(global-set-key [f6] 'buffer-menu)
(global-set-key [f7] 'compile)


(global-set-key [f5] 'next-error)
(global-set-key [f4] 'previous-error)

(setq backup-inhibited t)
(display-time-mode 1)
(setq display-time-24hr-format t)
(setq display-time-interval 10)
(message  "chenbing")
 (setq ansi-color-for-comint-mode t)
(set-foreground-color "grey")
(set-background-color "black")
(set-cursor-color "gold1")
(set-mouse-color "gold1")
;; Keypad bindings
(global-set-key [up] "\C-p")
(global-set-key [down] "\C-n")
(global-set-key [left] "\C-b")
(global-set-key [right] "\C-f")
(global-set-key [home] "\C-a")
(global-set-key [end] "\C-e")


 

發佈了525 篇原創文章 · 獲贊 8 · 訪問量 35萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章