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 的组合拳。
学会看文档才是最重要的。
Table of Contents
- 1. 基本操作
- 2. .emacs 的简单配置
1 基本操作
上 | 下 | 左 | 右 |
---|---|---|---|
C-p | C-n | C-b | C-f |
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 "其中的 custom-set-variables 用面板来设置就可以了,学会用 describe-function 的话几分钟还是能打完的。") '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)))
如果输入大括号之后再按回车只换了一行,可能需要用 C-p;C-f;RET 的组合拳。
学会看文档才是最重要的。