-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs
95 lines (78 loc) · 2.38 KB
/
.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
;;;;;;;;;;;;;;;;;;;;;;;;
;; fuxiang .emacs config
;;;;;;;;;;;;;;;;;;;;;;;;
;; hide scroll
(scroll-bar-mode -1)
;; hide menu
(menu-bar-mode -1)
;; hide tool
(tool-bar-mode -1)
;; line number
(global-linum-mode t)
;; hide welcome screen
(setq inhibit-splash-screen t)
;; ban emacs bell
(setq visible-bell t)
;; goto line
(define-key global-map "\C-c\C-g" 'goto-line)
;; use y replace yes, n replace no
(defalias 'yes-or-no-p 'y-or-n-p)
;; dont't generate the foo~ #foo# file
(setq auto-save-default nil)
(setq make-backup-files nil)
;;Set font and size
(set-default-font "Monaco 20")
;; Use spaces instead of tabs
(setq-default indent-tabs-mode nil)
;; Four spaces is a tab
(setq tab-width 2)
;; org
(setq org-startup-indented t)
(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.
'(word-wrap nil))
(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.
)
;; move line
(defun move-line (n)
"Move the current line up or down by N lines."
(interactive "p")
(setq col (current-column))
(beginning-of-line) (setq start (point))
(end-of-line) (forward-char) (setq end (point))
(let ((line-text (delete-and-extract-region start end)))
(forward-line n)
(insert line-text)
;; restore point to original column in moved line
(forward-line -1)
(forward-char col)))
(defun move-line-up (n)
"Move the current line up by N lines."
(interactive "p")
(move-line (if (null n) -1 (- n))))
(defun move-line-down (n)
"Move the current line down by N lines."
(interactive "p")
(move-line (if (null n) 1 n)))
(global-set-key (kbd "M-<up>") 'move-line-up)
(global-set-key (kbd "M-<down>") 'move-line-down)
;; Enable mouse support
(unless window-system
(require 'mouse)
(xterm-mouse-mode t)
(global-set-key [mouse-4] (lambda ()
(interactive)
(scroll-down 1)))
(global-set-key [mouse-5] (lambda ()
(interactive)
(scroll-up 1)))
(defun track-mouse (e))
(setq mouse-sel-mode t)
)