emacs配置

\(\\\)

(load-theme 'tango-dark t)
 
 
;;-------------没啥用开始-------
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
;;使用UTF-8
(display-time-mode 1)
;;显示时间
(setq display-time-24hr-format t)
;;时间格式
(setq display-time-day-and-date t)
;;显示时间、星期、日期
(column-number-mode t)
;;状态栏显示行列信息
;;-----------没啥用结束-------------
(global-set-key (kbd "C-a") 'mark-whole-buffer)
;;全选
(global-set-key (kbd "C-z") 'undo)
;;一键撤销
(global-set-key (kbd "RET") 'newline-and-indent)
;;换行时自动缩进
(cua-mode t)
;;Windows的剪切复制粘贴键
(show-paren-mode t)
(global-linum-mode t)
;;括号匹配,显示行号
(blink-cursor-mode -1)
;;光标别闪
(setq kill-ring-max 200)
;;撤销的缓存开大点
(setq default-cursor-type 'bar)
(setq default-tab-width 4)
;;默认tab宽度
(setq c-default-style "awk")
;;缩进风格
(setq auto-save-default nil)
;;不要#×#的文件
(setq make-backup-files nil)
;;也不要×~的文件
(electric-pair-mode 1)
(setq electric-pair-pairs
      '(
        (?\" . ?\")  ;; 添加双引号补齐
        (?\{ . ?\})  ;; 添加大括号补齐
        (?\' . ?\'))) ;; 添加单引号补齐
(global-set-key [f5] 'compile-file)
(defun compile-file()(interactive)
(save-buffer)
(compile(format "g++ -o '%s' '%s' -lm -Wall";;其他编译指令请自行增加。
(file-name-sans-extension(buffer-name))(buffer-name))))
 
(global-set-key [f6] 'runthis)
(defun runthis()(interactive)
(term(format "./%s"
(file-name-sans-extension(buffer-name)))))
https://www.luogu.com.cn/blog/Arthas-gray/emacs-wei-ru-men-xue-xi-bi-ji
https://www.cnblogs.com/blfshiye/p/4566900.html
posted @ 2020-07-04 16:11  hyskr  阅读(108)  评论(0编辑  收藏  举报