Emacs考场配置

当年\(NOip\)考场配置不记得啦
存在这里搞事情

(global-set-key [f9] 'compile)
(global-set-key [f10] 'gud-gdb)
(global-set-key (kbd "C-s") 'save-buffer)
(global-set-key (kbd "C-a") 'mark-whole-buffer)
(global-set-key (kbd "RET") 'newline-and-indent)
(global-linum-mode t)
(set-background-color "gray15")
(set-foreground-color "gray")
(setq default-cursor-type 'bar)
(setq default-tab-width 4)
(setq c-default-style "awk")
(set-frame-parameter (selected-frame) 'alpha (list 85 50))

豪华版超级配置

(global-set-key [f9] 'compile-file)
(global-set-key [f10] 'gud-gdb)
(global-set-key (kbd "C-s") 'save-buffer)
(global-set-key (kbd "C-z") 'undo)
(global-set-key (kbd "RET") 'newline-and-indent)
(global-linum-mode t)
(show-paren-mode t)
(define-key key-translation-map (kbd "C-d") (kbd "M-p M-y"))
(global-set-key (kbd "M-p M-y") 'kill-whole-line)
(define-key key-translation-map (kbd "C-a") (kbd "C-x h"))
(setq c-default-style "awk")
;;;考场必备
(ido-mode t)

(setq default-frame-alist
             '((vertical-scroll-bars)
               (top . 25)
               (left . 45)
               (width . 120)
               (height . 40)
               (background-color . "grey15")
               (foreground-color . "grey")
               (cursor-color . "gold1")
               (mouse-color . "gold1")
               (tool-bar-lines . 0)
               (menu-bar-lines . 1)
               (scroll-bar-lines . 0)
               (right-fringe)
               (left-fringe)))

(global-hl-line-mode 1)

(set-face-background 'highlight "gray5")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")

;;;;;设置org模式
(setq org-startup-indented t)
;(setq org-log-done 'time)
;(s.etq org-log-done 'note)
;

;;;无关紧要
(set-cursor-color "wheat")
(set-mouse-color "wheat")
(global-font-lock-mode t);;高亮
;;;;;设置编译信息
(defun compile-file ()
  (interactive)
  (compile (format "g++ -o %s %s -g -lm -Wall"  (file-name-sans-extension (buffer-name))(buffer-name))))
;;(global-set-key (kbd "<f9>") 'compile-file)
;;;;;设置一键调试
;;;;;改变emacs标题栏的标题
(setq frame-title-format "yyb")
;;;;;允许emacs和外部其他程序的粘贴
(setq x-select-enable-clipboard t)
;; 显示列号
(setq column-number-mode t)
;;设置tab为2个空格的宽度
(setq default-tab-width 4)
(setq c-basic-offset 4)
;;;;;启用时间显示设置,在minibuffer上面的那个杠上(忘了叫什么来着)
(display-time-mode 1)
;;;;;时间使用24小时制
(setq display-time-24hr-format t)
;;;;;时间显示包括日期和具体时间
(setq display-time-day-and-date t)
;;;;;时间的变化频率,单位多少来着?
(setq display-time-interval 10)
;;;;;是用滚轴鼠标
(mouse-wheel-mode t)
;;;;;备份设置
;;;;;emacs还有一个自动保存功能,默认在~/.emacs.d/auto-save-list里,这个非常有用,我这里没有改动,具体可以参见Sams teach yourself emacs in 24hours(我简称为sams24)
;;;;;备份设置方法,直接拷贝
(setq backup-by-copying t)
;; 自动存盘
(setq auto-save-mode t)
;;;;;去掉烦人的警告铃声
(setq visible-bell nil)
(setq ring-bell-function 'ignore)
;;;;;指针不要闪,我得眼睛花了
(blink-cursor-mode -1)
;;;;;滚动页面时比较舒服,不要整页的滚动
(setq scroll-step 1
        scroll-margin 3
        scroll-conservatively 10000)
;;;;;设定删除保存记录为200,可以方便以后无限恢复
(setq kill-ring-max 200)
;;;;;修改透明度
(set-frame-parameter (selected-frame) 'alpha (list 85 50))
(add-to-list 'default-frame-alist (cons 'alpha (list 85 50)))
(setq-default cursor-type 'bar)

(show-paren-mode 1);;括号匹配
(fset 'yes-or-no-p 'y-or-n-p);;酱油的
(setq make-backup-files nil)
(global-auto-revert-mode t);自动reload文件

(global-set-key (kbd "<f8>") 'gdb-many-windows)

(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.
 '(blink-cursor-mode nil)
 '(column-number-mode t)
 '(cua-mode t nil (cua-base))
 '(display-time-mode t)
 '(inhibit-startup-screen t)
 '(show-paren-mode t))
(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.
 '(default ((t (:family "Ubuntu Mono" :foundry "unknown" :slant normal :weight normal :height 143 :width normal)))))
(auto-insert-mode)  ;;; Adds hook to find-files-hook
(setq auto-insert-directory "~/.emacs.d/mytemplates/") ;;; Or use custom, *NOTE* Trailing slash important
(setq auto-insert-query nil) ;;; If you don't want to be prompted before insertion
(define-auto-insert "\." "moban.cpp")

原文地址:https://www.cnblogs.com/cjyyb/p/8366042.html

时间: 2024-08-29 13:49:15

Emacs考场配置的相关文章

Emacs安装配置全攻略之一编译安装简单配置

/******************************************************************************************************************************************/ 原创作品,转载时请务必以超链接形式标明文章原始出处:http://blog.csdn.net/gqb_driver/article/details/29407717,作者:gqb666 /***************

CentOS6.x之emacs安装配置编译

刚开始学习linux,干学没什么意思,想在linux下写写程序,了解到linux下使用较多的是emacs和vim,在youtobe上分别看了看这两个工具进行开发的视频,个人感觉emacs比较酷一点,所以选择了emacs. 闲话少说,下面写一下自己安装.配置.编译c++程序并运行的过程. 1.安装emacs 刚开始我选择了下载代码安装,make的时候总是出错,找不到解决方案. 后来直接yum -y -install emacs安装了.(安装之前要把emacs用到的一些依赖库安装好,建议使用root

ubuntu14.04 下emacs 24 配置

目的: 配置emacs 24 适合编程开发 主要参考JerryZhang的配置(Emacs 简易教程) http://www.perfect-is-shit.com/emacs-simple-tutorial.html#tocAnchor-1-16-5 https://gitcafe.com/JerryZhang/Emacs-Config 优点: 插件少 基本功能都比较全,emacs 配置后启动比较快速 安装过程如下: git clone https://gitcafe.com/JerryZha

Emacs golang 配置

在配置前需要下载用到的包: godoc godef gocode oracle 在下载包之前需要设置好环境变量: # Golang export GOROOT=$HOME/go export GOPATH=$HOME/development/go export PATH=$PATH:$GOROOT/bin export PATH=$PATH:$GOPATH/bin 如果网络良好的话使用这种方法:godoc: go get golang.org/x/tools/cmd/godoc 这样会将godo

重新载入emacs的配置!

不重启 Emacs 让新修改的配置内容生效,有四个函数可以做到: M-x eval-last-sexp 使当前 elisp 配置中光标前的那一条语句立刻生效: M-x eval-region 使当前 elisp 配置中选中的 region 中的语句立刻生效: M-x eval-buffer 使当前的 buffer 中的设置语句立刻生效: M-x load-file ~/.emacs 载入 .emacs 文件,从而使其中的设置生效,要生效其它 elisp 文件只需要把 .emacs 文件名换成其它

如何不重新启动 Emacs 就让 .emacs 的配置起作用

老是重新启动 emacs ,效率很低,其实可以不用重启Emacs就可以让新的配置生效 用 emacs 打开 .emacs 文件,C-x C-e 光标前面的运行一条语句.立即生效. 选择一个 region , M-x eval-region M-x load-file ~/.emacs M-x eval-buffer

emacs环境配置

Cscope: 首先官网上下载cscope的源码包,解压进入,按照INSTALL的说明: ./configure make make install 但是在make时报如下错误:fatal error: curses.h: No such file or directory 百度了下,是字符界面的库ncurses,需要安装开发包: yum install ncurses-devel ncurses 安装完毕后编译安装成功.借着将源码包中的xcscope.el拿出来放到emacs的插件目录下csc

Linux编程基础-emacs简单配置

最近笔者又回到了Linux~浪了一圈又回来了 不过emacs确实不错,看起来也高大上(哈哈),今天就把我的配置文件贴上吧 要修改.emacs配置文件的话,只需要在emacs界面中按住control+X,松开后再按Control+F, 然后输入路径~/.emacs就好了,使底部命令行显示成这样: Find File: ~/.emacs,按回车就可以了 ;; 指针颜色设置为白色 (set-cursor-color "white") ;; 鼠标颜色设置为白色 (set-mouse-color

Emacs简单配置

在~/.emacs.d/lisp中编辑init.el文件 ;改变c/c++缩进为4个空格 (setq-default indent-tabs-mode nil) (setq c-basic-offset 4) (setq c-default-style "linux") (setq default-tab-width 4) ;加载color-theme ;themes文件夹和color-theme.el存放在~/.emacs.d/lisp中 (add-to-list 'load-pat