Emacs for OIer 的基本配

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)

(show-paren-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)
  (compile (format
    "g++ -Wall -o %s %s -g -lm"
         (file-name-sans-extension
          (file-name-nondirectory buffer-file-name))
         (file-name-nondirectory buffer-file-name))))

    其中的 custom-set-variables 用面板来设置就可以了,学会用 describe-function 的话几分钟还是能打完的。
    如果输入大括号之后再按回车只换了一行,可能需要用 C-p;C-f;RET 的组合拳。
    学会看文档才是最重要的。
 

你可能感兴趣的:(心得,编辑器)