.emacs

时间:2023-03-09 16:19:18
.emacs

(tool-bar-mode 0)
(menu-bar-mode 0)
(blink-cursor-mode 0)
;;(set-scroll-bar-mode nil)
;;(global-linum-mode 0)
(set-default-font "16")
;;(fringe-mode 1)

;;-----color setting---------
;; (set-background-color "#000")
;; (set-foreground-color "white")
;; (set-face-foreground 'highlight "green")
;; (set-face-background 'highlight "blue")
;; (set-face-background 'region "red")
;; (set-face-foreground 'region "yellow")
;; (setq global-font-lock-mode t)
(setq frame-title-format "@%b")
;;在标题栏显示buffer的名字,而不是 emacs@wangyin.com 这样没用的提示。
;;启动设置
(setq default-frame-alist
'(
(top . 100)
(left . 380)
;(width . 90)
;(height . 30)
(tool-bar-lines . 0)
(menu-bar-lines . 0)))

(setq inhibit-startup-message t)
;;关闭emacs启动时的画面

(setq make-backup-files nil)
;; 设定不产生备份文件

;;(setq auto-save-mode nil)
;;自动保存模式

(setq-default make-backup-files nil)
;; 不生成临时文件
(setq speedbar-show-unknown-files t)
;;可以显示所有目录以及文件

(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(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.
)
(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.
)

;; add hexl-mode
(add-to-list 'auto-mode-alist '("\\.out\\'" . hexl-mode))
(add-to-list 'auto-mode-alist '("\\.o\\'" . hexl-mode))

;; add php-mode
(add-to-list 'load-path "/usr/share/emacs/site-lisp")
(require 'php-mode)
(add-to-list 'auto-mode-alist '("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode))

;; add emmet-mode
(add-to-list 'load-path "/usr/share/emacs/site-lisp")
(require 'emmet-mode)
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
(add-hook 'html-mode-hook 'emmet-mode) ;; Auto-start on html
(add-hook 'css-mode-hook 'emmet-mode) ;; enable Emmet's css abbreviation.
(add-hook 'php-mode-hook 'emmet-mode) ;; php mode

;; set auto indent
(global-set-key (kbd "RET") 'newline-and-indent)

(fset 'yes-or-no-p 'y-or-n-p)
;; 改变 Emacs 固执的要你回答 yes 的行为。按 y 或空格键表示 yes,n 表示 no。

;; ;; Install Auctex
;; (load "auctex.el" nil t t)
;; (load "preview-latex.el" nil t t)
;; (setq Tex-auto-save t)
;; (setq Tex-parse-self t)
;; (setq-default Tex-master nil)
;; ;;设置xelatex为默认编辑命令,evience为默认阅读器
;; (setq Tex-output-view-style
;; (quote (("^pdf$" "." "evince &o %(outpage)"))))

;; (add-hook 'LaTex-mode-hook
;; (lambda()
;; (add-to-list 'Tex-command-list '("XeLaTex" "%`xelatex%(mode)'
;; %t" Tex-run-Tex nil t))
;; (setq Tex-command-default "XeLaTex