-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
140 lines (116 loc) · 3.25 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
;;; startup -- summary
;;; Commentary:
;;; Just an init.
;;; Code:
;;No scrolling no tool-bar.
(tool-bar-mode -1)
(scroll-bar-mode -1)
(setq mac-option-key-is-meta 1)
(setq vc-follow-symlinks t)
;Show column.
(setq column-number-mode t)
;;Packages
(require 'package)
;;(require 'melpa)
;;(add-to-list 'package-archives
;; '("melpa-stable" . "https://stable.melpa.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
;;(setq exec-path (append exec-path '("/usr/local/bin")))
;;
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)
(defvar packages-my-packages
'(elpy
ess
company
find-file-in-project
highlight-indentation
ivy
magit
git-commit
magit-popup
markdown-mode
material-theme
pyenv-mode
python-mode
pythonic
f
pyvenv
s
with-editor
dash
async
yaml-mode
yasnippet
better-shell
julia-mode
ledger-mode
polymode
poly-R
poly-markdown
flycheck
))
(mapc #'(lambda (package)
(unless (package-installed-p package)
(package-install package)))
packages-my-packages)
;; BASIC CUSTOMIZATION
;; --------------------------------------
(load-theme 'material t) ;; load material theme
(setq-default indent-tabs-mode nil)
;;Elpy
;;(elpy-enable)
;;(elpy-use-ipython)
(pyenv-mode)
;;(setq python-shell-interpreter-args "--simple-prompt --pprint")
;;m magit
(global-set-key (kbd "C-x g") 'magit-status)
;; make backup to a designated dir, mirroring the full path
(defun my-backup-file-name (fpath)
"Return a new file path of a given file path.
FPATH is a path
If the new path's directories does not exist, create them."
(let* (
(backupRootDir "~/.emacs.d/emacs-backup/")
(backupFilePath (replace-regexp-in-string "//" "/" (concat backupRootDir fpath "~") ))
)
(make-directory (file-name-directory backupFilePath) (file-name-directory backupFilePath))
backupFilePath
)
)
(setq make-backup-file-name-function 'my-backup-file-name)
;;;;;;;
;;org-mode stuff...
;;;;;;;
(global-set-key "\C-ca" 'org-agenda)
(setq org-startup-indented 1)
(setq org-return-follows-link 1)
(setq org-directory "~/org/notes")
(setq org-agenda-files (list org-directory))
(setq org-archive-location "%s_archive::")
;;(setq org-default-notes-file (concat org-directory "/notes.org"))
(define-key global-map "\C-cc" 'org-capture)
(setq org-log-done 'time)
(setq org-agenda-custom-commands
'(("S" "Last week's snippet" tags
"CLOSED>=\"<-1w>\""
((org-agenda-overriding-header "Last week's completed TODOs")))))
;; Rmd files edit as Markdown!
(require 'poly-R)
(require 'poly-markdown)
(add-to-list 'auto-mode-alist '("\\.Rmd" . poly-markdown+r-mode))
;; ediff customization
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
;; Set up how to open links
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "google-chrome")
(define-key global-map "\C-c\C-v" 'browse-url-at-point)
;;;;;;;
;;ledger-mode stuff...
;;;;;;;
(global-set-key "\C-clr" 'ledger-report-select-report)
(setq ledger-schedule-file "~/ledger/isaac_personal_schedule.ledger")
(define-key global-map "\C-cu" 'ledger-schedule-upcoming)
;;; Init.el ends here