热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

EmacsforOIer的基本配置

EmacsformeOIer的基本配置TableofContents1.基本操作2..emacs的简

Emacs for me OIer 的基本配置

Table of Contents

  • 1. 基本操作
  • 2. .emacs 的简单配置

1 基本操作

Table 1: 方向
C-p C-n C-b C-f
Table 2: 选择
Mark-set Select-all
C-SPC C-x h

……
总之TUTORIAL里面的大概够用了

2 .emacs 的简单配置

(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-enabled-themes (quote (tsdh-dark))))
(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.
 )

(set-frame-font "-unknown-Ubuntu Mono-normal-normal-normal-*-24-*-*-*-m-0-iso10646-1" nil t)

(setq c-default-style "bsd")
(setq-default indent-tabs-mode nil)
(setq c-basic-offset 4)

(global-linum-mode t)
(global-hl-line-mode t)

(fset 'yes-or-no-p 'y-or-n-p)

(require 'electric)
(electric-pair-mode t)
(add-hook 'c-mode-common-hook
          '(lambda()
             (c-toggle-auto-hungry-state t)
             (c-toggle-syntactic-indentation nil)
             (local-set-key (kbd "RET") 'newline-and-indent);不一定使用
             (local-set-key (kbd "") 'CCompile)))
(defun CCompile()
  (interactive)
  (setq command
        (concat
         "g++ -Wall -o "
         (file-name-sans-extension
          (file-name-nondirectory buffer-file-name))
         " "
         (file-name-nondirectory buffer-file-name)
         " -g -lm "))
  (let ((command (read-from-minibuffer "Compile command: " command)))
    (compile command)))
    其中的 custom-set-variables 用面板来设置就可以了,学会用 describe-function 的话几分钟还是能打完的。
    如果输入大括号之后再按回车只换了一行,可能需要用 C-p;C-f;RET 的组合拳。
    学会看文档才是最重要的。



推荐阅读
author-avatar
mobiledu2502882733
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有