-
Notifications
You must be signed in to change notification settings - Fork 0
/
emacs
118 lines (104 loc) · 4.58 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
;; 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.
(package-initialize)
;; Custom setting
(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.
'(custom-enabled-themes (quote (deeper-blue)))
'(package-selected-packages
(quote
(markdown-mode pungi exec-path-from-shell auto-virtualenv jedi company-jedi)))
'(show-paren-mode t))
(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.
)
;;---------------------------------------------------------------------------------------
;; ORG mode
;;---------------------------------------------------------------------------------------
(require 'org)
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
(setq org-startup-indented t)
(setq org-todo-keywords
'((sequence "TODO" "WAITING" "VERIFY" "|" "✔ DONE" "DELEGATED" "✘ CANCELED")
(sequence "REPORT" "BUG" "IMPROVE" "|" "FIXED")))
(setq org-todo-keyword-faces
'(("TODO" . org-warning)
("WAITING" . "yellow")
("VERIFY" . "orange")
("DONE" . "green")
("DELEGATED" . "blue")
("CANCELED" . "blue")))
;;---------------------------------------------------------------------------------------
;; Miscellaneous
;;---------------------------------------------------------------------------------------
;; Highligh matching parentesis
(show-paren-mode 1)
;; no startup msg
(setq inhibit-startup-message t) ; Disable startup message
;; OsX Italian keyboard: cmd, not ctrl as command and alt as modifier (brakets and hastag)
(setq ns-command-modifier 'meta)
(setq ns-alternate-modifier nil)
;; Enable CUA mode for rectangle selection
(cua-mode t)
(setq cua-auto-tabify-rectangles nil) ;; Don't tabify after rectangle commands
(transient-mark-mode 1) ;; No region when it is not highlighted
;; This is not enable by default in emacs
(setq vc-follow-symlinks t)
;; Set tabs
(setq-default indent-tabs-mode nil)
(setq tab-stop-list (number-sequence 4 120 4))
(setq-default tab-width 4)
;; Delete trailing whitespace automatically on save.
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;;---------------------------------------------------------------------------------------
;; Organize backups
;;---------------------------------------------------------------------------------------
(setq
backup-by-copying t ; don't clobber symlinks
backup-directory-alist
'(("." . "~/.saves/")) ; don't litter my fs tree
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t) ; use versioned backups
;;---------------------------------------------------------------------------------------
;; Packages manager
;;---------------------------------------------------------------------------------------
;; packages
(when (>= emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
)
;;---------------------------------------------------------------------------------------
;; Python syntax
;;---------------------------------------------------------------------------------------
;; set jedi
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t) ; optional
;;---------------------------------------------------------------------------------------
;; SSH service config
;;---------------------------------------------------------------------------------------
;; TRAMP
(require 'tramp)
;; (custom-set-variables '(tramp-verbose 0))
(setq tramp-debug-buffer t)
;; Escape properly: if you have custom prompt TRAMP may hang waiting for a good shell. Escape your custom shit.
(setq shell-prompt-pattern "\\(?:^\\|\r\\)[^]#$%>\n]*#?[]#$%>].* *\\(^[\\[[0-9;]*[a-zA-Z] *\\)*" )
;;---------------------------------------------------------------------------------------
;; MARKDOWN MODE (README.md)
;;---------------------------------------------------------------------------------------
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)