emacs configuration file

In this post, we start to explore the magic of emacs: customized configuration files for emacs. The magic feature of emacs is the extensibility. Comparing to Vim, which is the specialist as a editor. Emacs is more like an single thread operating system which runs as an editor. In order to explore the magic, we start from the basic extended configurations for the emacs.

Normally, emacs configuration files locate in directory ~/.emacs.d or ~/.emacs. The help information for Minor mode and Major mode can be explored by pressing key C-h m.

M-x package-list-packages lists all the packages can be installed.

Sevearl packages I installed in my personal emacs configuration file: auto-complete

Here is my initial configuration file for emacs:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;;----------------------------------------
;; Disable & Enable modes
;;----------------------------------------
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
(global-linum-mode 1)
(tool-bar-mode -1)
;;----------------------------------------
;; Emacs theme
;;----------------------------------------
(load-theme 'dracula t)
;;----------------------------------------
;; Personal UI Setting
;;----------------------------------------
(setq cursor-type 'bar)
(setq inhibit-splash-screen 1)
;;----------------------------------------
;; Font
;;----------------------------------------
(set-default-font "Monaco 16")
;;----------------------------------------
;; New key binding
;;----------------------------------------
;; open init file
;;----------------------------------------
(defun open-init-file ()
(interactive)
(find-file "~/.emacs.d/init.el"))
(global-set-key (kbd "<f1>") 'open-init-file)
;;----------------------------------------
;; auto-complete
;;----------------------------------------
(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.
'(package-selected-packages (quote (dracula-theme auto-complete))))
(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.
)
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)

This will be extended in the future study.