-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
587 lines (478 loc) · 20.1 KB
/
init.el
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
;(setq locale-coding-system 'utf-8)
;(set-terminal-coding-system 'utf-8)
;(set-keyboard-coding-system 'utf-8)
;(set-selection-coding-system 'utf-8)
;(prefer-coding-system 'utf-8)
;'(buffer-encoding (quote utf-8))
'(recentf-mode t)
'(transient-mark-mode t)
(load-file "/home/jagadeesh/.emacs.d/emacs-for-python/epy-init.el")
;(set-default-font "Bitstream Vera Sans Mono-10")
;(set-fontset-font (frame-parameter nil 'font)
; 'han '("cwTeXHeiBold" . "unicode-bmp"))
(setq make-backup-files nil)
(setq query-replace-highlight t)
(setq search-highlight t)
(setq font-lock-maximum-decoration t)
(fset 'yes-or-no-p 'y-or-n-p)
(setq require-final-newline t)
(setq major-mode 'text-mode)
;; turn on paren matching
(show-paren-mode t)
(setq show-paren-style 'mixed)
;; Get rid of the startup screen
(setq inhibit-startup-screen t)
(setq initial-scratch-message nil)
;; (setq default-frame-alist '((font . "inconsolata")))
;; Get back font antialiasing
(push '(font-backend xft x) default-frame-alist)
;(global-font-lock-mode t t)
(setq font-lock-maximum-decoration t)
;(setq default-directory "~/Documentos/WyeWorks/Proys/")
(setq default-directory "~/")
;; Get rid of toolbar, scrollbar, menubar
(progn
(tool-bar-mode)
; (menu-bar-mode)
(scroll-bar-mode))
(add-to-list 'load-path "~/.emacs.d/plugins/textmate")
(require 'textmate)
(textmate-mode)
;; redo
(add-to-list 'load-path "~/.emacs.d/plugins/redo")
(require 'redo)
(global-set-key [(control -)] 'redo)
;; show ascii table
;; optained from http://www.chrislott.org/geek/emacs/dotemacs.html
(defun ascii-table ()
"Print the ascii table. Based on a defun by Alex Schroeder <[email protected]>"
(interactive)
(switch-to-buffer "*ASCII*")
(erase-buffer)
(insert (format "ASCII characters up to number %d.\n" 254))
(let ((i 0))
(while (< i 254)
(setq i (+ i 1))
(insert (format "%4d %c\n" i i))))
(beginning-of-buffer))
;; insert date into buffer at point
;; optained from http://www.chrislott.org/geek/emacs/dotemacs.html
(defun insert-date ()
"Insert date at point."
(interactive)
(insert (format-time-string "%a %Y-%m-%d - %l:%M %p")))
;; Centering code stolen from somewhere and restolen from
;; http://www.chrislott.org/geek/emacs/dotemacs.html
;; centers the screen around a line...
(global-set-key [(control l)] 'centerer)
(defun centerer ()
"Repositions current line: once middle, twice top, thrice bottom"
(interactive)
(cond ((eq last-command 'centerer2) ; 3 times pressed = bottom
(recenter -1))
((eq last-command 'centerer1) ; 2 times pressed = top
(recenter 0)
(setq this-command 'centerer2))
(t ; 1 time pressed = middle
(recenter)
(setq this-command 'centerer1))))
;; Kills live buffers, leaves some emacs work buffers
;; optained from http://www.chrislott.org/geek/emacs/dotemacs.html
(defun nuke-some-buffers (&optional list)
"For each buffer in LIST, kill it silently if unmodified. Otherwise ask.
LIST defaults to all existing live buffers."
(interactive)
(if (null list)
(setq list (buffer-list)))
(while list
(let* ((buffer (car list))
(name (buffer-name buffer)))
(and (not (string-equal name ""))
;(not (string-equal name "*Messages*"))
;; (not (string-equal name "*Buffer List*"))
;(not (string-equal name "*buffer-selection*"))
;(not (string-equal name "*Shell Command Output*"))
(not (string-equal name "*scratch*"))
(/= (aref name 0) ? )
(if (buffer-modified-p buffer)
(if (yes-or-no-p
(format "Buffer %s has been edited. Kill? " name))
(kill-buffer buffer))
(kill-buffer buffer))))
(setq list (cdr list))))
;; fullscreen
;(defun toggle-fullscreen ()
;(interactive)
;(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
;'(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
;(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
;'(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
;)
;(toggle-fullscreen)
;; maxframe
(add-to-list 'load-path "~/.emacs.d/plugins/maxframe")
(require 'maxframe)
(add-hook 'window-setup-hook 'maximize-frame t)
(add-hook 'window-setup-hook 'ecb-redraw-layout t)
(set-background-color "#2b2b2b")
(set-foreground-color "white")
(set-face-background 'modeline "DarkRed")
(set-face-foreground 'modeline "white")
;; color-theme
;(add-to-list 'load-path "~/.emacs.d/plugins/color-theme")
;(require 'color-theme)
; (color-theme-initialize)
; (color-theme-arjen)
(mouse-wheel-mode t)
;; wheel mouse
;(defun up-slightly () (interactive) (scroll-up 5))
;(defun down-slightly () (interactive) (scroll-down 5))
;(global-set-key [mouse-4] 'down-slightly)
;(global-set-key [mouse-5] 'up-slightly)
;(defun up-one () (interactive) (scroll-up 1))
;(defun down-one () (interactive) (scroll-down 1))
;(global-set-key [S-mouse-4] 'down-one)
;(global-set-key [S-mouse-5] 'up-one)
;(defun up-a-lot () (interactive) (scroll-up))
;(defun down-a-lot () (interactive) (scroll-down))
;(global-set-key [C-mouse-4] 'down-a-lot)
;(global-set-key [C-mouse-5] 'up-a-lot)
;; cedet
;; See cedet/common/cedet.info for configuration details.
(load-file "~/.emacs.d/plugins/cedet/common/cedet.el")
; Enable EDE (Project Management) features
(global-ede-mode 1)
;; * This enables the database and idle reparse engines
;(semantic-load-enable-minimum-features)
;(setq semantic-load-turn-everything-on t)
;; ecb
(add-to-list 'load-path "~/.emacs.d/plugins/ecb")
(require 'ecb)
(setq ecb-tip-of-the-day nil)
(setq ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
(ecb-activate)
(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.
'(ecb-layout-window-sizes (quote (("left8" (ecb-directories-buffer-name 0.23671497584541062 . 0.29310344827586204) (ecb-sources-buffer-name 0.23671497584541062 . 0.22413793103448276) (ecb-methods-buffer-name 0.23671497584541062 . 0.25862068965517243) (ecb-history-buffer-name 0.23671497584541062 . 0.20689655172413793)))))
'(ecb-options-version "2.40"))
;; resize the windows on emacs and run ecb-store-window-sizes
; '(show-paren-mode t))
;; find-recursive
(add-to-list 'load-path "~/.emacs.d/plugins/find-recursive")
(require 'find-recursive)
;; anything
(add-to-list 'load-path "~/.emacs.d/plugins/anything")
(require 'anything)
;; anything-rcodetools
(add-to-list 'load-path "~/.emacs.d/plugins/rcodetools")
;(require 'rcodetools)
;(require 'icicles-rcodetools)
;(require 'anything)
(require 'anything-rcodetools)
;; ;; Command to get all RI entries.
(setq rct-get-all-methods-command "PAGER=cat fri -l -L")
;; (setq rct-get-all-methods-command "PAGER=cat fri -l")
;(setq rct-get-all-methods-command "PAGER=cat ri -l")
;; ;; See docs
;; (define-key ruby-mode-map "\M-\C-i" 'rct-complete-symbol)
(define-key anything-map "\C-z" 'anything-execute-persistent-action)
;(rct-get-all-methods)
;; Interactively Do Things (highly recommended, but not strictly required)
(require 'ido)
(ido-mode t)
;; tabkey2
;(load "~/.emacs.d/plugins/nxhtml/util/tabkey2.el")
;; DTD mode
(autoload 'dtd-mode "tdtd" "Major mode for SGML and XML DTDs." t)
(autoload 'dtd-etags "tdtd" "Execute etags on FILESPEC and match on DTD-specific regular expressions." t)
(autoload 'dtd-grep "tdtd" "Grep for PATTERN in files matching FILESPEC." t)
(setq auto-mode-alist (append (list
'("\\.dcl$" . dtd-mode)
'("\\.dec$" . dtd-mode)
'("\\.dtd$" . dtd-mode)
'("\\.ele$" . dtd-mode)
'("\\.ent$" . dtd-mode)
'("\\.mod$" . etd-mode))
auto-mode-alist))
;; css
;(add-to-list 'load-path "~/.emacs.d/plugins/css-mode")
;(autoload 'css-mode "css-mode" "Mode for editing CSS files" t)
;(setq auto-mode-alist (append '(("\\.css$" . css-mode)) auto-mode-alist))
(add-hook 'css-mode-hook
(lambda()
(local-set-key (kbd "<return>") 'newline-and-indent)
))
;; javascript
(add-to-list 'load-path "~/.emacs.d/plugins/javascript")
(add-to-list 'auto-mode-alist '("\\.js$" . javascript-mode))
(autoload 'javascript-mode "javascript" nil t)
(defvar javascript-identifier-regexp "[a-zA-Z0-9.$_]+")
(defun javascript-imenu-create-method-index-1 (class bound)
(let (result)
(while (re-search-forward (format "^ +\\(\%s\\): *function" javascript-identifier-regexp) bound t)
(push (cons (format "%s.%s" class (match-string 1)) (match-beginning 1)) result))
(nreverse result)))
(defun javascript-imenu-create-method-index()
(cons "Methods"
(let (result)
(dolist (pattern (list (format "\\b\\(%s\\) *= *Class\.create" javascript-identifier-regexp)
(format "\\b\\([A-Z]%s\\) *= *Object.extend(%s"
javascript-identifier-regexp
javascript-identifier-regexp)
(format "^ *Object.extend(\\([A-Z]%s\\)" javascript-identifier-regexp)
(format "\\b\\([A-Z]%s\\) *= *{" javascript-identifier-regexp)))
(goto-char (point-min))
(while (re-search-forward pattern (point-max) t)
(save-excursion
(condition-case nil
(let ((class (replace-regexp-in-string "\.prototype$" "" (match-string 1)))
(try 3))
(if (eq (char-after) ?\()
(down-list))
(if (eq (char-before) ?{)
(backward-up-list))
(forward-list)
(while (and (> try 0) (not (eq (char-before) ?})))
(forward-list)
(decf try))
(if (eq (char-before) ?})
(let ((bound (point)))
(backward-list)
(setq result (append result (javascript-imenu-create-method-index-1 class bound))))))
(error nil)))))
(delete-duplicates result :test (lambda (a b) (= (cdr a) (cdr b)))))))
(defun javascript-imenu-create-function-index ()
(cons "Functions"
(let (result)
(dolist (pattern '("\\b\\([[:alnum:].$]+\\) *= *function" "function \\([[:alnum:].]+\\)"))
(goto-char (point-min))
(while (re-search-forward pattern (point-max) t)
(push (cons (match-string 1) (match-beginning 1)) result)))
(nreverse result))))
(defun javascript-imenu-create-index ()
(list
(javascript-imenu-create-function-index)
(javascript-imenu-create-method-index)))
(add-hook 'javascript-mode-hook
(lambda ()
(setq imenu-create-index-function 'javascript-imenu-create-index)
(local-set-key (kbd "<return>") 'newline-and-indent)
)
t)
;; ruby-mode
(add-to-list 'load-path "~/.emacs.d/plugins/ruby-mode")
(require 'ruby-mode)
(require 'ruby-electric)
(add-hook 'ruby-mode-hook 'turn-on-font-lock)
(add-to-list 'auto-mode-alist '("\\.rjs$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
;; ruby-block
(add-to-list 'load-path "~/.emacs.d/plugins/ruby-block")
(require 'ruby-block)
;; ruby electric
(defun try-complete-abbrev (old)
(if (expand-abbrev) t nil))
(setq hippie-expand-try-functions-list
'(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
;; yaml
(add-to-list 'load-path "~/.emacs.d/plugins/yaml-mode")
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
;; rdebug
(add-to-list 'load-path "~/.emacs.d/plugins/rdebug")
(require 'rdebug)
(setq rdebug-short-key-mode t)
;; ri-emacs
(setq ri-ruby-script (expand-file-name "~/.emacs.d/plugins/ri-emacs/ri-emacs.rb"))
;(autoload 'ri (expand-file-name "~/.emacs.d/plugins/ri-emacs/ri-ruby.el") nil t)
(load "~/.emacs.d/plugins/ri-emacs/ri-ruby.el")
;; ruby-mode-hook
(add-hook 'ruby-mode-hook
(lambda()
(add-hook 'write-file-functions
'(lambda()
(save-excursion
(untabify (point-min) (point-max))
(delete-trailing-whitespace)
)))
(set (make-local-variable 'indent-tabs-mode) 'nil)
(set (make-local-variable 'tab-width) 2)
(imenu-add-to-menubar "IMENU")
; (require 'ruby-electric)
(ruby-electric-mode t)
; (require 'ruby-block)
(ruby-block-mode t)
; (local-set-key 'f1 'ri)
(local-set-key "\M-\C-i" 'ri-ruby-complete-symbol)
; (local-set-key 'f4 'ri-ruby-show-args)
(define-key ruby-mode-map "\M-\C-o" 'rct-complete-symbol)
(local-set-key (kbd "<return>") 'newline-and-indent)
))
;; nxhtml
;(setq *nxhtml-autostart-file* (expand-file-name "~/.emacs.d/plugins/nxhtml/autostart.el"))
;(load *nxhtml-autostart-file*)
;(setq
; nxhtml-global-minor-mode t
; mumamo-chunk-coloring 'submode-colored
; nxhtml-skip-welcome t
; indent-region-mode t
; nxhtml-default-encoding "utf8"
; rng-nxml-auto-validate-flag nil
; nxml-degraded t)
;(add-to-list 'auto-mode-alist '("\\.html$" . nxhtml-mumamo-mode))
;(add-to-list 'auto-mode-alist '("\\.html\\.erb$" . eruby-nxhtml-mumamo-mode))
;(add-hook 'nxhtml-mumamo-mode-hook 'tabkey2-mode)
;(add-hook 'eruby-nxhtml-mumamo-mode-hook 'tabkey2-mode)
;; flymake
(add-to-list 'load-path "~/.emacs.d/plugins/flymake")
(require 'flymake)
;; I don't like the default colors :)
(set-face-background 'flymake-errline "red4")
(set-face-background 'flymake-warnline "dark slate blue")
;; Feature request: have flymake create its temp files in the system temp file directory instead of in the same directory as the file. When using it with Ruby on Rails and autotest, autotest sees the temp file and tries to do something with it and dies, forcing me to restart it, thus killing the magic of autotest. Putting flymake’s temp files elsewhere seems like the easiest way to dodge this.
;;
;; I second the above request. I know there are workarounds for autotest, but it seems like we don’t want to find work arounds for every new web framework, we want to get flymake working in a way that won’t conflict with any other tools.
;;
;; It is easy to patch your autotest to ignore flymake files. I have submitted a patch which hopefully will be included in future releases. For more info see: Emacs, flymake and autotest: the fix
;;
;; Here is a suggestion for a solution (100% untested). Replace flymake-create-temp-inplace above with
(defun flymake-create-temp-intemp (file-name prefix)
"Return file name in temporary directory for checking FILE-NAME.
This is a replacement for `flymake-create-temp-inplace'. The
difference is that it gives a file name in
`temporary-file-directory' instead of the same directory as
FILE-NAME.
For the use of PREFIX see that function.
Note that not making the temporary file in another directory
\(like here) will not if the file you are checking depends on
relative paths to other files \(for the type of checks flymake
makes)."
(unless (stringp file-name)
(error "Invalid file-name"))
(or prefix
(setq prefix "flymake"))
(let* ((name (concat
(file-name-nondirectory
(file-name-sans-extension file-name))
"_" prefix))
(ext (concat "." (file-name-extension file-name)))
(temp-name (make-temp-file name nil ext))
)
(flymake-log 3 "create-temp-intemp: file=%s temp=%s" file-name temp-name)
temp-name))
;; Invoke ruby with '-c' to get syntax checking
(defun flymake-ruby-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-intemp))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "ruby" (list "-c" local-file))))
(push '(".+\\.rb$" flymake-ruby-init) flymake-allowed-file-name-masks)
(push '(".+\\.rjs$" flymake-ruby-init) flymake-allowed-file-name-masks)
(push '("Rakefile$" flymake-ruby-init) flymake-allowed-file-name-masks)
(push '("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3) flymake-err-line-patterns)
(add-hook 'ruby-mode-hook
'(lambda ()
;; Don't want flymake mode for ruby regions in rhtml files and also on read only files
(if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
(flymake-mode))
))
(require 'flymake-jslint)
(add-hook 'javascript-mode-hook
'(lambda ()
;; Don't want flymake mode for ruby regions in rhtml files and also on read only files
(if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
(flymake-mode))
))
;; Rinari
(add-to-list 'load-path "~/.emacs.d/plugins/rinari")
(require 'rinari)
(setq rinari-tags-file-name "TAGS")
;; yasnippet
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/yasnippet/snippets")
(setq require-final-newline nil)
;; yasnippet rails
(load "~/.emacs.d/plugins/yasnippets-rails/setup.el")
(add-to-list 'load-path "~/.emacs.d/plugins/autotest")
(require 'autotest)
;; rhtml-mode
(add-to-list 'load-path "~/.emacs.d/plugins/rhtml")
(require 'rhtml-mode)
(add-hook 'rhtml-mode-hook
(lambda () (rinari-launch)))
(add-hook 'rhtml-mode
(let ((original-command (lookup-key rhtml-mode-map [tab])))
`(lambda ()
(setq yas/fallback-behavior
'(apply ,original-command))
(local-set-key [tab] 'yas/expand))))
(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete")
(require 'auto-complete-config)
;(global-auto-complete-mode t)
;(define-key ac-complete-mode-map "\C-n" 'ac-next)
;(define-key ac-complete-mode-map "\C-p" 'ac-previous)
;; ;; start completion when entered 3 characters
;(setq ac-auto-start 2)
;; Add following code to your .emacs.
;;
;(define-key ac-complete-mode-map "\t" 'ac-complete)
;(define-key ac-complete-mode-map "\r" nil)
;(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete")
; (when (require 'auto-complete nil t)
; (require 'auto-complete-yasnippet)
; (require 'auto-complete-ruby)
; (require 'auto-complete-css)
(global-auto-complete-mode t) ;enable global-mode
(setq ac-auto-start t) ;automatically start
(setq ac-dwim 3) ;Do what i mean
(setq ac-override-local-map nil) ;don't override local map
;; (define-key ac-complete-mode-map "\t" 'ac-expand)
;; (define-key ac-complete-mode-map "\r" 'ac-complete)
;; (define-key ac-complete-mode-map "\M-n" 'ac-next)
;; (define-key ac-complete-mode-map "\M-p" 'ac-previous)
(set-default 'ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer))
(setq ac-modes
(append ac-modes
'(eshell-mode
;org-mode
)))
;(add-to-list 'ac-trigger-commands 'org-self-insert-command)
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer ac-source-symbols))))
(add-hook 'eshell-mode-hook
(lambda ()
(setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-files-in-current-dir ac-source-words-in-buffer))))
(add-hook 'ruby-mode-hook
(lambda ()
(setq ac-omni-completion-sources '(("\\.\\=" ac-source-rcodetools)))));)
;; ri
;(load "~/.emacs.d/plugins/ri/ri.el")
;; snippet
;(add-to-list 'load-path "~/.emacs.d/plugins/snippet")
;; rails-emacs
;(add-to-list 'load-path "~/.emacs.d/plugins/emacs-rails")
;(require 'rails)
;(kill-buffer "*ESS*")
;(kill-buffer "*Compile-Log*")
;(kill-buffer "*Messages*")
(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.
)
;; Emacs TRAMP setup
(require 'tramp nil t)
(setq tramp-default-method "ssh")
(add-to-list 'backup-directory-alist
(cons tramp-file-name-regexp nil))