Skip to content

Commit 0072a29

Browse files
committed
Refactor shortcuts to default directories; add 'my/pick-destination
1 parent 10ad631 commit 0072a29

File tree

1 file changed

+57
-30
lines changed

1 file changed

+57
-30
lines changed

sean.org

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#+TITLE: Sean Miller’s Emacs Configuration
2+
#+STARTUP: showall
23

34
* Emacs Config
45

@@ -106,41 +107,67 @@
106107
** Project-specific shortcuts
107108

108109
#+BEGIN_SRC emacs-lisp :tangle ~/.emacs.d/tangled-settings.el
109-
(global-set-key (kbd "C-c C-g C-c")
110-
(lambda ()
111-
(interactive)
112-
(setq default-directory "~/.emacs.d/")
113-
(dired ".")))
110+
(defun my/to-file (dir file)
111+
(interactive)
112+
(setq default-directory dir)
113+
(find-file file))
114114

115-
(global-set-key (kbd "C-c C-g C-d")
116-
(lambda ()
117-
(interactive)
118-
(setq default-directory "~/Dropbox/gesta/")
119-
(dired ".")))
115+
(defun my/to-dir (dir)
116+
(interactive)
117+
(setq default-directory dir)
118+
(dired "."))
120119

121-
(global-set-key (kbd "C-c C-g C-h")
122-
(lambda ()
123-
(interactive)
124-
(setq default-directory "~/Dropbox/gesta/")
125-
(find-file "2015.org")))
120+
(defun my/to-gesta-file (file)
121+
(interactive)
122+
(my/to-file "~/Dropbox/gesta/" file))
126123

127-
(global-set-key (kbd "C-c C-g C-r")
128-
(lambda ()
129-
(interactive)
130-
(setq default-directory "~/Dropbox/gesta/")
131-
(find-file "emacs_roughs.org")))
124+
(defun my/to-emacs-config ()
125+
(interactive)
126+
(my/to-file "~/.emacs.d/" "sean.org"))
132127

133-
(global-set-key (kbd "C-c C-g C-u")
134-
(lambda ()
135-
(interactive)
136-
(setq default-directory "~/code/autrui/")
137-
(dired ".")))
128+
(defun my/to-autrui ()
129+
(interactive)
130+
(my/to-dir "~/code/autrui/"))
138131

139-
(global-set-key (kbd "C-c C-g C-w")
140-
(lambda ()
141-
(interactive)
142-
(setq default-directory "~/Dropbox/gesta/twc/")
143-
(dired ".")))
132+
(defun my/to-gesta ()
133+
(interactive)
134+
(my/to-dir "~/Dropbox/gesta/"))
135+
136+
(defun my/to-today ()
137+
(interactive)
138+
(my/to-gesta-file "2015.org"))
139+
140+
(defun my/to-readings ()
141+
(interactive)
142+
(my/to-gesta-file "readings.org"))
143+
144+
(defun my/to-writings ()
145+
(interactive)
146+
(my/to-gesta-file "writings.org"))
147+
148+
(defun my/to-twc ()
149+
(interactive)
150+
(my/to-dir "~/Dropbox/gesta/twc/"))
151+
152+
(defun my/pick-destination (pick)
153+
(interactive "ce = ~/.emacs.d/sean.org a = ~/code/autrui/ g = ~/Dropbox/gesta/ h = …/2015.org r = …/readings.org w = …/writings.org t = …/twc/ ? ")
154+
(case pick
155+
(?e (my/to-emacs-config))
156+
(?a (my/to-autrui))
157+
(?g (my/to-gesta))
158+
(?h (my/to-today))
159+
(?r (my/to-readings))
160+
(?w (my/to-writings))
161+
(?t (my/to-twc))))
162+
163+
(global-set-key (kbd "C-x j e") 'my/to-emacs-config)
164+
(global-set-key (kbd "C-x j a") 'my/to-autrui)
165+
(global-set-key (kbd "C-x j g") 'my/to-gesta)
166+
(global-set-key (kbd "C-x j h") 'my/to-today)
167+
(global-set-key (kbd "C-x j r") 'my/to-readings)
168+
(global-set-key (kbd "C-x j w") 'my/to-writings)
169+
(global-set-key (kbd "C-x j t") 'my/to-twc)
170+
(global-set-key (kbd "C-x j j") 'my/pick-destination)
144171
#+END_SRC
145172

146173
** Zenburn Theme

0 commit comments

Comments
 (0)