.emacs

;;;;-------------------------显示中文(不应该配置,因为本为就已经支持中文,如果配置了会有打不开中文名文件的BUG)-------------------------
;;(set-language-environment 'Chinese-GB)
;;(set-buffer-file-coding-system 'cn-gb-2312)
;;(set-keyboard-coding-system 'cn-gb-2312)
;;(set-terminal-coding-system 'cn-gb-2312)
;;(setq-default enable-multibyte-characters t)
;;(prefer-coding-system 'cn-gb-2312)
;;(set-selection-coding-system 'cn-gb-2312)

;;-------------------------向其他X程序粘贴中文---------------
(when (fboundp 'utf-translate-cjk-mode)
;; Load modified utf-translate-cjk-mode
(require 'gbk-utf-mode)
;; Turn on utf-translate-cjk-mode
(utf-translate-cjk-mode 1)
;; Setup X selection for unicode encoding
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)))

;;-------------------------括号匹配--------------------------
;;括号匹配时显示另一端的括号,而不是跳过去
(show-paren-mode t)
(setq show-paren-style 'parentheses)

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

;;-------------------------关闭错误提示的Beep音--------------
(setq visible-bell t)

;;-------------------------关闭启动时的`开机画面'------------
(setq inhibit-startup-message t)

;;-------------------------显示列号--------------------------
;;(setq column-number-mode t)
;;display the column number and line number
(setq column-number-mode t)
(setq line-number-mode t)

;;-------------------------标题拦显示buffer的名字------------
(setq frame-title-format "emacs@%b")
;;(setq frame-title-format "DIrk@%b");在标题栏提示你目前在什么位置

;;-------------------------Shell 使用 ansi color-------------
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

;;-------------------------使用Win下的选择习惯---------------
;;用shift+方向键进行选择
(pc-selection-mode)

;;-------------------------设置默认Tab宽度---------------
;;set default tab-width as 4, not 2
;;(setq-default indent-tabs-mode nil);;在Emacs中设置不用tab缩进
;;(setq default-tab-width 8) 
(setq tab-width 8
      indent-tabs-mode t
      c-basic-offset 8)

;;-------------------------无论在什么样的主模式下都打开auto-fill模式-------------------------
(setq-default auto-fill-function 'do-auto-fill)

;;-------------------------设置Emacs的前景色和背景色(手工设置)-------------------------
(setq default-frame-alist
'(
  (foreground-color . "Wheat")
  (background-color . "DarkSlateGray")
  (cursor-color . "green1")
  ) ls
)
;;-------------------------设置Emacs的前景色和背景色(从配置文件中取)-------------------------
(load-file "/home/kimi/emacs/config/color-theme.el")
(color-theme-jsc-dark)
;;选择 darkblue的配色方案 :Tools->color themes,把光标停在相应的配色方案中,按回车键(或鼠标中键)即可应用之,以下几个方案比较满意。
;;也可修改上面的配置,打开color-theme.el(415行-515行之间),查找下面方案所对应的color-themes,然后替换上面的color-theme-jsc-dark主题
;;Arjen    (黑背景   5)
;;Black    (黑背景   6)
;;Classic  (灰绿背景  6)
;;Cooper Dark  (黑背景  8)
;;Midnight   (黑背景   8)
;;Calm Forest  终端主题(黑背景 绿字 3)
;;Euphoria     终端主题(黑背景 绿字
;;Lethe        (黑背景   6 反选很不好,但字符串为粉色)
;;Dark Laptop (黑背景  5)
;;Gnome 2    (灰绿背景  7)
;;White On Grey   (灰绿背景  7)


;; -------------------------将文件模式和文件后缀关联起来。append表示追加-------------------------
(
setq auto-mode-alist
    ( append 
        '(("\\.py\\'" . python-mode)
        ("\\.s?html?\\'" . html-helper-mode)
        (" \\.asp\\'" . html-helper-mode)
        ("\\.phtml\\'" . html-helper-mode)
        ("\\.css\\'" . css-mode)
        ("\\.pc$" . c-mode)
    )
auto-mode-alist))

;;-------------------------光标显示为一竖线-------------------------
(setq-default cursor-type 'bar)

;;-------------------------设置emacs启动时初始化大小-------------------------
(setq initial-frame-alist '((top . 0) (left . 0) (width . 175) (height . 70)))

;;-------------------------大多數情況下,回車後是要縮進的-------------------------
(global-set-key "\C-m" 'newline-and-indent)
(global-set-key (kbd "C-<return>") 'newline) <br><br>;;----------------让 emacs buffer 平滑滚动(好像不起作用)----------------<br>(load-file "/home/kimi/emacs/config/smooth-scrolling.el")<br>(require 'smooth-scrolling)<br><br>(global-set-key [(f5)] 'speedbar);;设置speedbar的快捷键为F5<br><br>;;------------------------------------其它设置---------------------------------------<br>(setq default-major-mode 'text-mode);一打开就起用 text 模式。<br>(auto-image-file-mode t);打开图片显示功能<br>(fset 'yes-or-no-p 'y-or-n-p);以 y/n代表 yes/no,可能你觉得不需要,呵呵。<br>(display-time-mode 1);显示时间,格式如下<br>(setq display-time-24hr-format t)<br>(setq display-time-day-and-date t)<br>;(tool-bar-mode nil);去掉那个大大的工具栏<br>;(scroll-bar-mode nil);去掉滚动条,因为可以使用鼠标滚轮了 ^_^<br>(mouse-avoidance-mode 'animate);光标靠近鼠标指针时,让鼠标指针自动让开<br>(transient-mark-mode t);<br>(setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴<br>(setq default-fill-column 80);默认显示 80列就换行<br>(setq-default make-backup-files nil);不要生成临时文件<br>(setq track-eol t);當光標在行尾上下移動的時候,始終保持在行尾。 <br>(setq scroll-margin 3 scroll-conservatively 10000);防止頁面滾動時跳動  scroll-margin 3 可以在靠近屏幕边沿3行时就开始滚动,可以很好的看到上下文。<br>(setq mouse-yank-at-point t);中鍵粘貼 <br>(setq require-final-newline t);; 自动的在文件末增加一新行<br><br><br><br>(put 'upcase-region 'disabled nil)<br>(custom-set-variables<br>  ;; custom-set-variables was added by Custom.<br>  ;; If you edit it by hand, you could mess it up, so be careful.<br>  ;; Your init file should contain only one such instance.<br>  ;; If there is more than one, they won't work right.<br> '(column-number-mode t)<br> '(display-time-mode t)<br> '(show-paren-mode t))<br>(custom-set-faces<br>  ;; custom-set-faces was added by Custom.<br>  ;; If you edit it by hand, you could mess it up, so be careful.<br>  ;; Your init file should contain only one such instance.<br>  ;; If there is more than one, they won't work right.<br> )</return>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值