豪華配置(複製的神犇的,已膜改)windows
(global-set-key [f9] 'compile-file) (global-set-key [f10] 'gud-gdb) (global-set-key (kbd "C-s") 'save-buffer) (global-set-key (kbd "C-z") 'undo) (global-set-key (kbd "RET") 'newline-and-indent) (global-linum-mode t) (show-paren-mode t) (define-key key-translation-map (kbd "C-d") (kbd "M-p M-y")) (global-set-key (kbd "M-p M-y") 'kill-whole-line) (define-key key-translation-map (kbd "C-a") (kbd "C-x h")) (setq c-default-style "awk") ;;;考場必備 (ido-mode t) (setq default-frame-alist '((vertical-scroll-bars) (top . 25) (left . 45) (width . 120) (height . 40) (background-color . "grey15") (foreground-color . "grey") (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 "gray5") (set-face-foreground 'region "cyan") (set-face-background 'region "blue") (set-face-foreground 'secondary-selection "skyblue") (set-face-background 'secondary-selection "darkblue") ;;;;;設置org模式 (setq org-startup-indented t) ;(setq org-log-done 'time) ;(s.etq org-log-done 'note) ; ;;;可有可無 (set-cursor-color "wheat") (set-mouse-color "wheat") (global-font-lock-mode t);;高亮 ;;;;;設置編譯信息 (defun compile-file () (interactive) (compile (format "g++ -o %s %s -g -lm -Wall" (file-name-sans-extension (buffer-name))(buffer-name)))) ;;(global-set-key (kbd "<f9>") 'compile-file) ;;;;;設置一鍵調試 ;;;;;改變emacs標題欄的標題 (setq frame-title-format "%b@YL") ;;;;;容許emacs和外部其餘程序的粘貼 (setq x-select-enable-clipboard t) ;; 顯示列號 (setq column-number-mode t) ;;設置tab爲2個空格的寬度 (setq default-tab-width 4) (setq c-basic-offset 4) ;;;;;啓用時間顯示設置,在minibuffer上面的那個槓上(忘了叫什麼來着) (display-time-mode 1) ;;;;;時間使用24小時制 (setq display-time-24hr-format t) ;;;;;時間顯示包括日期和具體時間 (setq display-time-day-and-date t) ;;;;;時間的變化頻率,單位多少來着? (setq display-time-interval 10) ;;;;;是用滾軸鼠標 (mouse-wheel-mode t) ;;;;;備份設置 ;;;;;emacs還有一個自動保存功能,默認在~/.emacs.d/auto-save-list裏,這個很是有用,我這裏沒有改動,具體能夠參見Sams teach yourself emacs in 24hours(我簡稱爲sams24) ;;;;;備份設置方法,直接拷貝 (setq backup-by-copying t) ;; 自動存盤 (setq auto-save-mode t) ;;;;;去掉煩人的警告鈴聲 (setq visible-bell nil) (setq ring-bell-function 'ignore) ;;;;;指針不要閃,我得眼睛花了 (blink-cursor-mode -1) ;;;;;滾動頁面時比較舒服,不要整頁的滾動 (setq scroll-step 1 scroll-margin 3 scroll-conservatively 10000) ;;;;;設定刪除保存記錄爲200,能夠方便之後無限恢復 (setq kill-ring-max 200) ;;;;;修改透明度 (set-frame-parameter (selected-frame) 'alpha (list 85 50)) (add-to-list 'default-frame-alist (cons 'alpha (list 85 50))) (setq-default cursor-type 'bar) (show-paren-mode 1);;括號匹配 (fset 'yes-or-no-p 'y-or-n-p);;醬油的 (setq make-backup-files nil) (global-auto-revert-mode t);自動reload文件 (global-set-key (kbd "<f8>") 'gdb-many-windows) (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. '(blink-cursor-mode nil) '(column-number-mode t) '(cua-mode t nil (cua-base)) '(display-time-mode t) '(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 "unknown" :slant normal :weight normal :height 143 :width normal))))) (auto-insert-mode) ;;; Adds hook to find-files-hook (setq auto-insert-directory "~/.emacs.d/mytemplates/") ;;; Or use custom, *NOTE* Trailing slash important (setq auto-insert-query nil) ;;; If you don't want to be prompted before insertion (define-auto-insert "\." "moban.cpp")
這是考場配置
字體,背景顏色,光標,括號匹配,C-v和C-c什麼的直接調emacs就行了字體
(setq default-tab-width 4) (setq default-cursor-type 'bar) (global-linum-mode t) (setq c-default-style "awk") (global-set-key (kbd "RET") 'newline-and-indent) (global-set-key (kbd "C-a") 'mark-whole-buffer) (global-set-key (kbd "C-s") 'save-buffer)