我的emacs配置

本文详细介绍了如何个性化配置Emacs以提升编程效率,包括字体锁定、视觉反馈、默认设置调整等,同时提供了快捷键定制和特定编程任务的自动化解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

;; .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")


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值