;去掉工具栏和菜单栏滚动栏 (tool-bar-mode 0) (menu-bar-mode 0) (scroll-bar-mode 0) ;关闭凡人的出错提示声 (setq visible-bell t) ;关闭启动时的开机画面 (setq inhibit-startup-message t) ;显示列号 (setq column-number-mode t) ;用一个大些的kill-ring 防止删掉重要的东西 (setq kill-ring-max 200) ;fill-column设置为60 这样的文字更好读 (setq default-fill-column 60) ;不使用tab字符indent (setq-default indent-tabs-mode nil) (setq default-tab-width 4) ;递归minibuffer (setq enable-recursive-minibuffers t) ;靠近屏幕3行的时候就开始滚动 (setq scroll-margin 3 scroll-conservatively 10000) ;缺省模式text (setq default-major-mode 'text-mode) ;括号匹配的时候显示另一个括号 (show-paren-mode t) (setq show--aren-style 'parentheses) ;自动移动鼠标 (mouse-avoidance-mode 'animate) ;标题栏显示buffer的名字 (setq frame-title-format "laoguo@%b") ;语法高亮 (global-font-lock-mode t) ;缺省禁用的功能打开 (put 'set-goal-column 'disabled nil) (put 'narrow-to-region 'disabled nil) (put 'upcase-region 'disabled nil) (put 'downcase-region 'disabled nil) (put 'LaTeX-hide-enviroment 'disabled nil) ;个人信息 (setq user-full-name "laoguo") ;让dired可以递归的拷贝和删除目录 操作要小心 (setq dired-recursive-copies 'top) (setq dired-recursive-deletes 'top) ;yes or no simple (fset 'yes-or-no-p 'y-or-n-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;显示行号 (require 'linum) (global-linum-mode 1) ;显示时间 (display-time-mode 1) (setq display-time-24hr-format t) (setq display-time-day-and-date t) ;我喜欢的主题 (add-to-list 'load-path "G:\\emac_home\\.emacs.d\\theme6") (require 'color-theme) (color-theme-initialize) (color-theme-dark-blue2) ;字体设置 (set-default-font "Courier New-14") ;设置光标为竖线 (setq-default cursor-type 'bar) ;在首行C-K时候 同时删除该行 (setq-default kill-whole-line t) ;不产生备份文件 (setq make-backup-files nil) ;自动保存模式 (setq auto-save-mode nil) ;不生成临时文件 (setq-default make-backup-files nil) ;emacs可以和外部其他程序粘贴 (setq x-select-enable-clipboard t) ;自动在文件的末尾增加一个新行 (setq require-final-newline t) ;当光标在行尾上下移动的时候始终保持行尾 (setq track-eol t) ;跳到另一个窗口 (global-set-key [f4] 'other-window) ;F3目录列出 (global-set-key [f3] 'dired) ;撤销 (global-set-key [f10] 'undo) ;日志 (global-set-key [f11] 'calendar) ;查看日程 (global-set-key [f12] 'list-bookmarks) ;设置日历的一些颜色 (setq calendar-load-hook '(lambda() (set-face-foreground 'diary-face "skyblue") (set-face-background 'holiday-face "slate blue") (set-face-foreground 'holiday-face "while"))) (setq calendar-latitude +39.9) (setq calendar-longitude -116.4) (setq calendar-location-time "Beijing") (setq calendar-remove-frame-by-deleting t) (setq calendar-week-start-day 1) ;goto line (global-set-key (kbd "M-g") 'goto-line) ;标记 (define-key global-map [C-return] 'set-mark-command) ;文件时间戳 (setq time-stamp-active t) (setq time-stamp-warn-inactive t) ;C语言风格K&R (add-hook 'c-mode-hook '(lambda() (c-set-style "k&r"))) ;C++ stroustrup风格 (add-hook 'c++-mode-hook '(lambda() (c-set-style "stroustrup"))) (setq compile-command "mingw32-make")