Emacs配置(考场必备)(Emacs)

最近有几次离开自己一直坐着的座位,去别的机房考试了。
于是猛然想起来要记一记Emacs的简洁配置了。
算是把NOIP残存的记忆再拾一点起来。。。。。。
update:
1:实测NOILinux不资磁透明度设定,已删去。
2.撤销键包含在cua-mode里,已删去。
3.编译指令里的%s应加上单引号,不然编译文件名带空格的cpp时会出问题。(NOIP有带空格的文件名吗?)
4.编译函数加了个save-buffer指令。考场配置加入自动运行。
附上一些解释

(global-set-key [f9] 'compile-file)
;;一键编译(弄Devcpp留下来的习惯)
(global-set-key (kbd "C-a") 'mark-whole-buffer)
;;全选(Like Windows)
(global-set-key (kbd "RET") 'newline-and-indent)
;;换行时自动缩进
(defun compile-file()(interactive)
(save-buffer)
(compile(format "g++ -o '%s' '%s' -lm -Wall"
(file-name-sans-extension(buffer-name))(buffer-name))))
;;编译指令(真TM难记)
(cua-mode t)
;;Windows的剪切复制粘贴键
(show-paren-mode t)
(global-linum-mode t)
;;括号匹配,显示行号
(setq kill-ring-max 200)
;;撤销的缓存开大点
(setq default-cursor-type 'bar)
;;把光标变成条,一块真的看不爽(用VIM的Dalao请无视)
(setq default-tab-width 4)
;;默认tab宽度
(setq c-default-style "awk")
;;缩进风格
(set-background-color "gray15")
(set-foreground-color "gray")
;;背景颜色(白的太亮了)前景颜色也要跟着改

Update:
蒟蒻突然发现,所有的指令,好像都可以在Emacs内部完成编辑,按M-x(Alt+x)然后输入即可(不用加最外层的括号了)。改完以后记得点击Options->Save Options保存配置,不然叉掉以后再打开就没了。
(一个例外:把setq改成set-variable
这样输入有一个好处,会有一个模糊查找的索引,按一下Tab即可。
如果记不清全部的拼写,可以敲比较确定的部分,不记得的用*或者-代替,然后直接在索引里找找就好啦。
妈妈再也不用担心我的记性啦!


我还是太弱了,少了这些一点都不适应。
Dalao们的都没十行吧。。。。。。

无聊版(F10一键运行,F8文本比较,F7一键测样例)
想玩一玩Lisp的大佬们可以自己随便百度一下qaq

(global-set-key[f9]'compile-file)
(global-set-key[f10]'autorun)
(global-set-key[f8]'differ)
(global-set-key[f7]'yeah)
(global-set-key(kbd"C-a")'mark-whole-buffer)
(global-set-key(kbd"C-q")'kill-this-buffer)
(global-set-key(kbd"RET")'newline-and-indent)
(defun compile-file()(interactive)
    (save-buffer)
    (compile (format "g++ -o '%s' '%s' -lm -Wall -O2 -std=c++11"
    (file-name-sans-extension(buffer-name))(buffer-name))))
(defun autorun()(interactive)
    (shell-command(format "time timeout 5 ./'%s'"
    (file-name-sans-extension(buffer-name)))))
(defun differ(name)(interactive "sStandard Output Name:")
    (shell-command(format "diff -b -B '%s.out' '%s'"
    (file-name-sans-extension(buffer-name)) name)))
(defun yeah(name)(interactive "sSample Name:")
    (shell-command(format "cp '%s.in' '%s.in'"
    (file-name-sans-extension name )
    (file-name-sans-extension(buffer-name))))
    (autorun)
    (shell-command(format "diff -b -B '%s.out' '%s'"
    (file-name-sans-extension(buffer-name)) name)))
(cua-mode t)
(show-paren-mode t)
(global-linum-mode t)
(setq kill-ring-max 200)
(setq default-cursor-type 'bar)
(setq default-tab-width 4)
(setq c-default-style "awk")
(set-background-color "gray15")
(set-foreground-color "gray")

转载于:https://www.cnblogs.com/flashhu/p/8366567.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在Ubuntu上安装和配置Emacs的步骤: 1. 打开终端并输入以下命令以更新软件包列表: ```shell sudo apt update ``` 2. 输入以下命令以安装Emacs: ```shell sudo apt install emacs ``` 3. 安装完成后,您可以通过输入以下命令来启动Emacs: ```shell emacs ``` 4. 如果您想要在Emacs中使用中文输入法,请安装fcitx输入法框架和fcitx-emacs插件。输入以下命令以安装它们: ```shell sudo apt install fcitx fcitx-config-gtk fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-ui-classic fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx-sunpinyin fcitx-table-all fcitx-frontend-all fcitx-pinyin fcitx-module-x11 fcitx-config-gtk2 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-ui-classic fcitx-module-cloudpinyin fcitx

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值