-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmacs Command
199 lines (165 loc) · 6.05 KB
/
Emacs Command
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
Emacs Shortcut:
Dired Command:(ctrl + x + d )
enter - open file
q - close file
C - copy file
R - Rename file
D - Delete File
+ - Create File
Z - compress / decompress the file by gzip
copy file : shift + c
mark file : m;
mark all file/toggle file which are not marked:t
sorting order of the directory:s;
rename file : R
mark all file by :t
make directory as editiable : C-x + C-q
replace query : M-% or (M-Shift-5)
save changes : C - c + C - c
execute file :
select file by :I
exectute file by : x
refresh : g
unmark file by : u
unmark all file : shift + u;
search for regular expression : shift+ A
Buffer
Buffer List : C-x + C-b
Buffer Selection : C-x + b
selecting for delecting buffer ; d
exectue it : x
find file
C-x + C-f
Windows :
C-x 1 --> one window
C-x 2 --> one window
UNDO
C-/
C-x u
C-_
FILES:
C-x C-f -- find file
C-x C-s -- save file
BUFFER
C-x C-b -- List of Bufffer
C-x b -- Switch buffer
Replace
M-x replace-string
Auto Save
M-x recove-file
t
EMACS CUSTOMIZATION :
Emacs Set Variables :
M-x describe-varible
give variable name :(eg: auto-save-timeout)
M-x set-variable
To permanent change
setq auto-save-timeout 60
or in .emacs file write
'(auto-save-timeout 60)
in .emacs File Write:
(require 'package)
; add MELPA to repository list
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
; initialize package.el
(package-initialize)
Auto-Complete:
Before it we have to install the package:
open emacs
M-x packages-list-packages
search for auto-complete
point the cursor to auto-complete then
type i
type x
after this copy below content to ~/.emacs file
; start auto-complete with emacs
(require 'auto-complete)
; do default config for auto-complete
(require 'auto-complete-config)
(ac-config-default)
YASNIPPET
open emacs
M-x packages-list-packages
search for yasnippet
point the cursor to yasnippet then
type i
type x
after this copy below content to ~/.emacs file
; start yasnippet with emacs
(require 'yasnippet)
(yas-global-mode 1)
; let's define a function which initializes auto-complete-c-headers and gets called for c/c++ hooks
(defun my:ac-c-header-init ()
(require 'auto-complete-c-headers)
(add-to-list 'ac-sources 'ac-source-c-headers)
(add-to-list 'achead:include-directories '"/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include")
)
; now let's call this function from c/c++ hooks
(add-hook 'c++-mode-hook 'my:ac-c-header-init)
(add-hook 'c-mode-hook 'my:ac-c-header-init)
Iedit:
open emacs
M-x packages-list-packages
search for Iedit
point the cursor to Iedit then
type i
type x
after this copy below content to ~/.emacs file
; start Iedit with emacs
;Fix iedit bug in Mac
(define-key global-map (kbd "C-c ;") 'iedit-mode)
Video Link for help:
https://www.youtube.com/watch?v=HTUE03LnaXA
Color Customization:
(add-to-list 'load-path "~/elisp")
(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.
'(ansi-color-names-vector ["#2d3743" "#ff4242" "#74af68" "#dbdb95" "#34cae2" "#008b8b" "#00ede1" "#e1e1e0"])
'(blink-cursor-mode nil)
'(compilation-message-face (quote default))
'(cua-global-mark-cursor-color "#2aa198")
'(cua-normal-cursor-color "#657b83")
'(cua-overwrite-cursor-color "#b58900")
'(cua-read-only-cursor-color "#859900")
'(custom-enabled-themes (quote (manoj-dark)))
'(custom-safe-themes (quote ("e16a771a13a202ee6e276d06098bc77f008b73bbac4d526f160faa2d76c1dd0e" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default)))
'(fci-rule-color "#eee8d5")
'(highlight-symbol-colors (--map (solarized-color-blend it "#fdf6e3" 0.25) (quote ("#b58900" "#2aa198" "#dc322f" "#6c71c4" "#859900" "#cb4b16" "#268bd2"))))
'(highlight-symbol-foreground-color "#586e75")
'(highlight-tail-colors (quote (("#eee8d5" . 0) ("#B4C342" . 20) ("#69CABF" . 30) ("#69B7F0" . 50) ("#DEB542" . 60) ("#F2804F" . 70) ("#F771AC" . 85) ("#eee8d5" . 100))))
'(hippie-expand-verbose t)
'(ido-enable-flex-matching t)
'(inhibit-startup-screen t)
'(magit-diff-use-overlays nil)
'(menu-bar-mode nil)
'(nyan-mode t)
'(package-archives (quote (("gnu" . "http://elpa.gnu.org/packages/") ("melba" . "http://melpa.milkbox.net/packages/") ("marmalade" . "http://marmalade-repo.org/packages/"))))
'(server-mode t)
'(smartrep-mode-line-active-bg (solarized-color-blend "#859900" "#eee8d5" 0.2))
'(term-default-bg-color "#fdf6e3")
'(term-default-fg-color "#657b83")
'(tool-bar-mode nil)
'(vc-annotate-background nil)
'(vc-annotate-color-map (quote ((20 . "#dc322f") (40 . "#c85d17") (60 . "#be730b") (80 . "#b58900") (100 . "#a58e00") (120 . "#9d9100") (140 . "#959300") (160 . "#8d9600") (180 . "#859900") (200 . "#669b32") (220 . "#579d4c") (240 . "#489e65") (260 . "#399f7e") (280 . "#2aa198") (300 . "#2898af") (320 . "#2793ba") (340 . "#268fc6") (360 . "#268bd2"))))
'(vc-annotate-very-old-color nil)
'(weechat-color-list (quote (unspecified "#fdf6e3" "#eee8d5" "#990A1B" "#dc322f" "#546E00" "#859900" "#7B6000" "#b58900" "#00629D" "#268bd2" "#93115C" "#d33682" "#00736F" "#2aa198" "#657b83" "#839496"))))
(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.
'(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
Hide And Show Block From Shortcut Key:
write this is in .emacs file
;adding hide show
(load-library "hideshow")
(add-hook 'java-mode-hook
(lambda()
(local-set-key (kbd "C-c -") 'hs-show-block)
(local-set-key (kbd "C-c +") 'hs-hide-block)
(local-set-key (kbd "C-c <up>") 'hs-hide-all)
(local-set-key (kbd "C-c <down>") 'hs-show-all)
(hs-minor-mode t)))