Emacs 配置文件保存 2016.1.15update


;;关闭启动画面
(setq inhibit-startup-message t)
;;关了那三行字
(setq initial-scratch-message t)

;; 告诉我我的位置
(setq frame-title-format "Sigma_Poet @ %b")

;;默认显示 80换行
(setq default-fill-column 80)

;;显示列号
(setq column-number-mode t)
;;状态栏显示行号
(line-number-mode t)
;;每行左边显示行号 真管用。
(global-linum-mode 'linum-mode)

;;去掉工具栏
(tool-bar-mode nil)
;;去掉菜单栏
(menu-bar-mode nil)
;;去掉滚动栏
(scroll-bar-mode nil)

;;可以直接打开显示图片
(auto-image-file-mode t)

;;支持外部程序的拷贝
(setq x-select-enable-clipboard t)

;;语法高亮
(global-font-lock-mode t)

;;打开时就启用text模式
(setq default-major-mode 'text-mode)

;;以y/n 代表yes/no
(fset 'yes-or-no-p 'y-or-n-p)

;;显示括号匹配
(show-paren-mode t)
(setq show-paren-style 'parentheses)
;;各种括号自动匹配
(when (fboundp 'electric-pair-mode)
(electric-pair-mode))
(when (eval-when-compile (version< "24.4" emacs-version))
(electric-indent-mode 1))

;;自动补全括号
(setq electric-pair-mode t)

;;显示时间
(display-time-mode 1)
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)

;;修改字体
(set-face-attribute 'default nil :font "Consolas 12")
(set-default-font "微软雅黑-14")


;;设置主题
(add-to-list 'load-path "~/.emacs.d")
(require 'color-theme)
(color-theme-initialize)
(color-theme-calm-forest)

;; 设置缩进
(setq indent-tabs-mode nil)
(setq default-tab-width 4)
(setq tab-width 4)
(setq tab-stop-list ())
(loop for x downfrom 40 to 1 do
      (setq tab-stop-list (cons (* x 4) tab-stop-list)))

;;禁止每日提醒  
(setq ecb-tip-of-the-day nil)
;;关闭出错时的提示音
(setq visible-bell t)

;; 回车缩进
(global-set-key "\C-m" 'newline-and-indent)
(global-set-key (kbd "C-<return>") 'newline)

;;修改鼠标形状为方块
(setq-default cursor-type 'box)

;;指针颜色为白色
(set-cursor-color "white")

;;启动时最大化窗口
(run-with-idle-timer 0.0 nil 'w32-send-sys-command 61488)


(setq default-directory "C:/TDM-GCC-32/bin/")
;;===================================
;;设置编译器==========================
;;===================================
;;(setq compile-command (concat "C:/TDM-GCC-32/bin/g++.exe -g " "/"" buffer-file-name "/"")) 
(global-set-key (kbd "<f7>") 'smart-compile)
(defun smart-compile()
;;  "比较智能的C/C++编译命令
;;如果当前目录有makefile则用make -k编译,否则,如果是
;;处于c-mode,就用gcc -Wall编译,如果是c++-mode就用 g++ -Wall编译"
  (interactive)
  ;; 查找 Makefile
  (let ((candidate-make-file-name '("makefile" "Makefile" "GNUmakefile"))
        (command nil))
    (if (not (null (find t candidate-make-file-name :key '(lambda (f) (file-readable-p f)))))
        (setq command "make -k ")
        ;; 没有找到 Makefile ,查看当前 mode 是否是已知的可编译的模式
        (if (null (buffer-file-name (current-buffer)))
            (message "Buffer not attached to a file, won't compile!")
            (if (eq major-mode 'c-mode) (setq command (concat "C:/TDM-GCC-32/bin/gcc.exe -Wall -o " ;;你要明确知道自己的编译器在哪里, (file-name-sans-extension ;;这样,用你的gcc.exe的地址代替这里的D:/Dev-Cpp/bin/gcc.exe  (file-name-nondirectory buffer-file-name)) ;;注意,这里的路径的斜杠和vista的习惯相反,你要注意修改 " " (file-name-nondirectory buffer-file-name) " -g -lm ")) (if (eq major-mode 'c++-mode) (setq command (concat "C:/TDM-GCC-32/bin/g++.exe -Wall -o " ;;还有这里的g++,也同gcc一样... (file-name-sans-extension (file-name-nondirectory buffer-file-name)) " " (file-name-nondirectory buffer-file-name) " -g -lm ")) (message "Unknow mode, won't compile!")))))
    (if (not (null command))
        (let ((command (read-from-minibuffer "Compile command: " command)))
          (compile command)))))


;;w3m配置项(用于上网)
(add-to-list 'load-path "D:/Emacs/.emacs.d/w3m-lisp/w3m-lisp") ;;w3m所需要的lisp文件,所在路径
(add-to-list 'exec-path "D:/Emacs/.emacs.d/w3m-lisp/w3m") ;;指定w3m可执行程序,所在的执行路径
(require 'w3m-load)
(setq w3m-use-favicon nil)
(setq w3m-command-arguments '("-cookie" "-F"))
(setq w3m-use-cookies t)
(setq w3m-home-page "http://www.baidu.com")
(setq w3m-default-display-inline-images t) 
(setq w3m-default-toggle-inline-images t)
(setq w3m-show-graphic-icons-in-header-line t)                  
(setq w3m-show-graphic-icons-in-mode-line t) 
(setq w3m-view-this-url-new-session-in-background t) 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值