存一下emacs配置

(global-set-key [f9] 'compile-file)
(global-set-key [f10] 'gud-gdb)
(global-set-key (kbd "C-z") 'undo)
(global-set-key (kbd "C-a") 'mark-whole-buffer);;全选
(global-set-key (kbd "C-x a") 'indent-region);;格式化
(global-set-key (kbd "C-s") 'save-buffer);;保存
(global-set-key (kbd "C-d") 'doctor)
(global-set-key (kbd "RET") 'newline-and-indent)
;;模拟上下左右键
(global-set-key (kbd "C-i") 'previous-line)
(global-set-key (kbd "C-k") 'next-line)
(global-set-key (kbd "C-j") 'left-char)
(global-set-key (kbd "C-l") 'right-char)
(global-set-key (kbd "C-u") 'delete-backward-char)
(global-set-key (kbd "C-o") 'delete-char)
(global-set-key [tab] 'tab-to-tab-stop)
(global-set-key (kbd "C-q") 'kill-emacs)
(global-set-key (kbd "C-h") 'kill-this-buffer)
(setq c-basic-offset 4)
(global-linum-mode t)
(global-set-key (kbd "C-d") 'kill-whole-line)
(show-paren-mode t)
;;启动设置
(setq default-frame-alist
'((vertical-scroll-bars)
(top . 25)
(left . 45)
(width . 120)
(height . 40)
(background-color . "black")
(foreground-color . "white")
(cursor-color . "gold1")
(mouse-color . "gold1")
(tool-bar-lines . 0)
(menu-bar-lines . 1)
(scroll-bar-lines . 0)
(right-fringe)
(left-fringe)))

;; 设置另外一些颜色:语法高亮显示的背景和主题,区域选择的背景和主题,二次选择的背景和选择

(global-hl-line-mode 1)

(set-face-background 'highlight "black")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")

(set-frame-parameter (selected-frame) 'alpha (list 85 50))


(add-to-list 'default-frame-alist (cons 'alpha (list 85 50)))

(column-number-mode t)
(global-linum-mode t)
;;显示行号

(setq make-backup-files nil)
(setq auto-save-mode nil)
;;自动保存

(show-paren-mode t)
(setq show-paren-style 'parenthesis)
;;鼠标不用烦人地跳来跳去
(defun compile-file ()
(interactive)
(compile (format "g++ -o %s %s -g -lm -Wall" (file-name-sans-extension (buffer-name))(buffer-name))))

(setq-default cursor-type 'bar) ;; 设置光标为竖线


(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.
'(column-number-mode t)
'(cua-mode t nil (cua-base))
'(inhibit-startup-screen t)
'(show-paren-mode t))
(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.
'(default ((t (:family "Ubuntu Mono" :foundry "DAMA" :slant normal :weight bold :height 181 :width normal)))))

原文地址:https://www.cnblogs.com/xzz_233/p/7285713.html