-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.emacs
146 lines (101 loc) · 3.22 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;; Add Extra Packages Path ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "~/.emacs.d/")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;; Load External Packages ;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;(load "ipython")
;(load "viper")
(setq viper-mode)
(require 'viper)
(require 'vimpulse)
(require 'ipython)
(setq py-python-command-args '("-pylab" "-colors" "LightBG"))
(setq ansi-color-for-comint-mode t)
;; Init message
(message "* --[ Loading my Emacs init file ]--")
;; uptimes
(setq emacs-load-start-time (current-time))
;;;;;;;,FIXME:;;;;
;;(load "gnuserv")
;;(gnuserv-start)
;;;;;;;;;;;;;;;;;;
;;; Always do syntax highlighting
(global-font-lock-mode 1)
;;; Also highlight parens
(setq show-paren-delay 0
show-paren-style 'parenthesis)
(show-paren-mode 1)
;; Set default tab-width
(setq-default tab-width 4)
;; no window mode
;; TODO:
;; ===== Set the highlight current line minor mode =====
;; In every buffer, the line which contains the cursor will be fully
;; highlighted
(global-hl-line-mode 0)
;; ========== Line by line scrolling ==========
;; This makes the buffer scroll by only a single line when the up or
;; down cursor keys push the cursor (tool-bar-mode) outside the
;; buffer. The standard emacs behaviour is to reposition the cursor in
;; the center of the screen, but this can make the scrolling confusing
(setq scroll-step 1)
;; ========== Support Wheel Mouse Scrolling ==========
(mouse-wheel-mode t)
;; Enable versioning with default values (keep five last versions, I think!)
(setq version-control t)
;; Save all backup file in this directory.
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))
;; ========== Enable Line and Column Numbering ==========
;; Show line-number in the mode line
(line-number-mode 1)
;; Show column-number in the mode line
(column-number-mode 1)
;; ===== Turn on Auto Fill mode automatically in all modes =====
;; Auto-fill-mode the the automatic wrapping of lines and insertion of
;; newlines when the cursor goes over the column limit.
;; This should actually turn on auto-fill-mode by default in all major
;; modes. The other way to do this is to turn on the fill for specific modes
;; via hooks.
(setq auto-fill-mode 1)
;; type y or n for yes or no
(fset 'yes-or-no-p 'y-or-n-p)
;;;;;;;;;;;;;;;
;; UTF-8
;;;;;;;;;;;;;;;;;;;;
;; set up unicode
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
; Yank the text and go down a line ;;;
(defun yank-and-down ()
"Yank the text and go down a line."
(interactive)
(yank)
(exchange-point-and-mark)
(next-line))
(move-beginning-of-line 0)
(global-set-key [(control shift y)] 'yank-and-down)
;; undo some previous changes
(global-set-key (kbd "<f11>") 'undo)
;; redo the most recent undo
;;(when (try-require 'redo)
(global-set-key (kbd "<S-f11>") 'redo)
;;)
;;;;;;;;;;;;;;;;;;;
;; Duplicate Line;;
;;;;;;;;;;;;;;;;;;;
(defun duplicate-line()
(interactive)
(move-beginning-of-line 1)
(kill-line)
(yank)
(open-line 1)
(next-line 1)
(yank)
(move-beginning-of-line 1)
)
(global-set-key (kbd "C-d") 'duplicate-line)