handy settings
This commit is contained in:
@@ -27,6 +27,21 @@
|
||||
(scroll-bar-mode -1)
|
||||
(global-display-line-numbers-mode 0)
|
||||
(global-auto-revert-mode t)
|
||||
(global-hl-line-mode t) ; 高亮当前行
|
||||
(show-paren-mode t) ; 显示匹配括号
|
||||
(fset 'yes-or-no-p 'y-or-n-p) ; 简化 yes/no 为 y/n
|
||||
(save-place-mode t) ; 保存文件上次打开的光标位置
|
||||
(savehist-mode t) ; 记录 M-x/Minibuffer 的历史输入
|
||||
(delete-selection-mode t) ; 选中文本后输入替换选取
|
||||
(electric-pair-mode t) ; 输入时自动匹配括号或者引号
|
||||
|
||||
(ido-mode t) ; 开启文件和 Buffer 补全
|
||||
(setq ido-enable-flex-matching t) ; 开启模糊匹配
|
||||
(ido-everywhere t) ; 在所有可以补全的地方尽量启用 ido
|
||||
|
||||
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace) ; 保存时清除行尾空格
|
||||
|
||||
|
||||
(setq mac-command-modifier 'meta)
|
||||
(setq confirm-kill-emacs 'y-or-n-p)
|
||||
@@ -48,6 +63,16 @@
|
||||
(setq custom-file (expand-file-name "custom-file.el" user-emacs-directory))
|
||||
(load custom-file)
|
||||
|
||||
;; 为 M-x shell 开启颜色支持
|
||||
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
|
||||
|
||||
;; 为 M-x compile 开启颜色支持
|
||||
(require 'ansi-color)
|
||||
(defun my/colorize-compilation-buffer ()
|
||||
(let ((inhibit-read-only t))
|
||||
(ansi-color-apply-on-region compilation-filter-start (point-max))))
|
||||
|
||||
(add-hook 'compilation-filter-hook 'my/colorize-compilation-buffer)
|
||||
|
||||
;;====================
|
||||
;; Backup settings
|
||||
|
||||
Reference in New Issue
Block a user