Skip to content

Commit 82d8977

Browse files
committed
reorganization and tidying. Now with org-mode!
1 parent 616e314 commit 82d8977

File tree

11 files changed

+130
-99
lines changed

11 files changed

+130
-99
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ custom.el
1414
archive-contents
1515
*.elc
1616
.cache
17+
recentf
18+
transient

customizations/editing.el

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@
1818
;; Highlight current line
1919
(global-hl-line-mode 1)
2020

21-
;; Interactive search key bindings. By default, C-s runs
22-
;; isearch-forward, so this swaps the bindings.
23-
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
24-
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
25-
(global-set-key (kbd "C-M-s") 'isearch-forward)
26-
(global-set-key (kbd "C-M-r") 'isearch-backward)
27-
2821
;; Don't use hard tabs
2922
(setq-default indent-tabs-mode nil)
3023

24+
;; shell scripts
25+
(setq-default sh-basic-offset 2
26+
sh-indentation 2)
27+
3128
;; When you visit a file, point goes to the last place where it
3229
;; was when you previously visited the same file.
3330
;; http://www.emacswiki.org/emacs/SavePlace
@@ -43,7 +40,6 @@
4340
"backups"))))
4441
(setq auto-save-default nil)
4542

46-
4743
;; comments
4844
(defun toggle-comment-on-line ()
4945
"comment or uncomment current line"

customizations/elisp-editing.el

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
;; Automatically load paredit when editing a lisp file
2-
;; More at http://www.emacswiki.org/emacs/ParEdit
31
(setup (:package paredit)
42
(:hook-into emacs-lisp-mode
5-
eval-expression-minibuffer-setup
6-
ielm-mode
7-
lisp-mode
8-
lisp-interaction-mode
9-
scheme-mode))
3+
eval-expression-minibuffer-setup
4+
ielm-mode
5+
lisp-mode
6+
lisp-interaction-mode
7+
scheme-mode))
108

11-
;; eldoc-mode shows documentation in the minibuffer when writing code
12-
;; http://www.emacswiki.org/emacs/ElDoc
13-
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
14-
(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
15-
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)
9+
(setup turn-on-eldoc-mode
10+
(:hook-into emacs-lisp-mode
11+
lisp-interaction-mode
12+
iel-mode))

customizations/markdown.el

Lines changed: 0 additions & 5 deletions
This file was deleted.

customizations/misc.el

Lines changed: 0 additions & 12 deletions
This file was deleted.

customizations/navigation.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@
2727
"C-x C-b" counsel-switch-buffer
2828
"M-x" counsel-M-x))
2929

30-
(setup (:package ivy-rich))
30+
;; ivy-rich-mode adds docstrings and additional metadata
31+
;; in the ivy picker minibuffer
32+
;; see screenshots: https://github.com/Yevgnen/ivy-rich/blob/master/screenshots.org
33+
(setup (:package ivy-rich)
34+
(ivy-rich-mode))

customizations/setup-clojure.el

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
;; See https://clojure-lsp.io/
2-
(setup (:package lsp-mode)
3-
(:bind "M-<f7>" #'lsp-find-references))
2+
(when (executable-find "clojure-lsp")
3+
(setup (:package lsp-mode)
4+
(:bind "M-<f7>" lsp-find-references)))
45

56
;; clojure-mode is (naturally) the major mode for editing
67
;; Clojure and ClojureScript. subword-mode allows words
@@ -12,17 +13,16 @@
1213
(setup (:package clojure-mode)
1314
(:hook subword-mode
1415
paredit-mode
15-
lsp-mode)
16-
(:bind "C-c C-v" #'cider-start-http-server
17-
"C-M-r" #'cider-refresh
18-
"C-c u" #'cider-user-ns))
16+
lsp)
17+
(:bind "C-M-r" cider-refresh
18+
"C-c u" cider-user-ns))
1919

2020
;; CIDER is a whole interactive development environment for
2121
;; Clojure. There is a ton of functionality here, so be sure
2222
;; to check out the excellent documentation at
2323
;; https://docs.cider.mx/cider/index.html
2424
(setup (:package cider)
25-
(:bind "C-c u" #'cider-user-ns)
25+
(:bind "C-c u" cider-user-ns)
2626
(:option cider-show-error-buffer t
2727
cider-auto-select-error-buffer t
2828
cider-repl-history-file "~/.emacs.d/cider-history"
@@ -52,17 +52,14 @@
5252
(add-hook 'cider-repl-mode-hook 'paredit-mode)
5353

5454
;; Use clojure mode for other extensions
55-
(add-to-list 'auto-mode-alist '("\\.edn$" . clojure-mode))
5655
(add-to-list 'auto-mode-alist '("\\.boot$" . clojure-mode))
5756
(add-to-list 'auto-mode-alist '("\\.cljs.*$" . clojure-mode))
5857
(add-to-list 'auto-mode-alist '("lein-env" . enh-ruby-mode))
5958

60-
61-
;; key bindings
6259
;; these help me out with the way I usually develop web apps
6360
(defun cider-start-http-server ()
6461
(interactive)
65-
(cider-load-current-buffer)
62+
(cider-load-buffer)
6663
(let ((ns (cider-current-ns)))
6764
(cider-repl-set-ns ns)
6865
(cider-interactive-eval (format "(println '(def server (%s/start))) (println 'server)" ns))
@@ -75,3 +72,4 @@
7572
(defun cider-user-ns ()
7673
(interactive)
7774
(cider-repl-set-ns "user"))
75+

customizations/setup-js.el

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22
(setup (:package tagedit)
33
(:hook-into html-mode))
44

5-
(add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
6-
(add-hook 'js-mode-hook 'subword-mode)
7-
(add-hook 'html-mode-hook 'subword-mode)
5+
(setup subword-mode
6+
(:hook-into js-mode
7+
html-mode
8+
coffee-mode))
9+
810
(setq js-indent-level 2)
911

1012
;; coffeescript
11-
(add-to-list 'auto-mode-alist '("\\.coffee.erb$" . coffee-mode))
12-
(add-hook 'coffee-mode-hook 'subword-mode)
13-
(add-hook 'coffee-mode-hook 'highlight-indentation-current-column-mode)
14-
(add-hook 'coffee-mode-hook
15-
(defun coffee-mode-newline-and-indent ()
16-
(define-key coffee-mode-map "\C-j" 'coffee-newline-and-indent)
17-
(setq coffee-cleanup-whitespace nil)))
13+
(setup coffee-mode
14+
(:hook highlight-indentation-current-column-mode
15+
(defun coffee-mode-newline-and-indent ()
16+
(define-key coffee-mode-map "\C-j" 'coffee-newline-and-indent)
17+
(setq coffee-cleanup-whitespace nil))))
18+
1819
(custom-set-variables
1920
'(coffee-tab-width 2))

customizations/setup-org.el

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
;; some people consider org-mode to be emacs's killer app
2+
;; on the face of it, it's a plaintext outliner for organizing
3+
;; notes, plans, ideas, articles, etc. But it goes way beyond that,
4+
;; including calendar features, executable code blocks, task statuses,
5+
;; and even a pomodoro timer!
6+
;; See https://orgmode.org/ for _tons_ of information
7+
;; All of the beautifying configuration comes from https://zzamboni.org/post/beautifying-org-mode-in-emacs/
8+
;; Tip of the had to Diego Zamboni for that.
9+
(defun efc/org-font-setup ()
10+
;; Replace list hyphen with dot
11+
(font-lock-add-keywords 'org-mode
12+
'(("^ *\\([-]\\) "
13+
(0 (prog1 () (compose-region (match-beginning 1) (match-end 1) ""))))))
14+
15+
(let* ((variable-tuple
16+
(cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
17+
((x-list-fonts "Lucida Grande") '(:font "Lucida Grande"))
18+
((x-list-fonts "Verdana") '(:font "Verdana"))
19+
((x-family-fonts "Sans Serif") '(:family "Sans Serif"))
20+
(nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
21+
(base-font-color (face-foreground 'default nil 'default))
22+
(headline `(:inherit default :weight bold :foreground ,base-font-color)))
23+
24+
(custom-theme-set-faces
25+
'user
26+
`(org-level-8 ((t (,@headline ,@variable-tuple))))
27+
`(org-level-7 ((t (,@headline ,@variable-tuple))))
28+
`(org-level-6 ((t (,@headline ,@variable-tuple))))
29+
`(org-level-5 ((t (,@headline ,@variable-tuple))))
30+
`(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1))))
31+
`(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25))))
32+
`(org-level-2 ((t (,@headline ,@variable-tuple :height 1.33))))
33+
`(org-level-1 ((t (,@headline ,@variable-tuple :height 1.5))))
34+
`(org-document-title ((t (,@headline ,@variable-tuple :height 1.75 :underline nil))))))
35+
36+
(custom-theme-set-faces
37+
'user
38+
'(org-block ((t (:inherit fixed-pitch))))
39+
'(org-code ((t (:inherit (shadow fixed-pitch)))))
40+
'(org-document-info ((t (:foreground "dark orange"))))
41+
'(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
42+
'(org-indent ((t (:inherit (org-hide fixed-pitch)))))
43+
'(org-link ((t (:foreground "royal blue" :underline t))))
44+
'(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch)))))
45+
'(org-property-value ((t (:inherit fixed-pitch))) t)
46+
'(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))
47+
'(org-table ((t (:inherit fixed-pitch :foreground "#83a598"))))
48+
'(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8))))
49+
'(org-verbatim ((t (:inherit (shadow fixed-pitch)))))))
50+
51+
(setup (:package org-bullets))
52+
53+
(setup org-mode
54+
(:global "<f12>" org-agenda)
55+
(:option org-hide-emphasis-markers t)
56+
(:hook org-bullets-mode
57+
visual-line-mode
58+
(lambda () (variable-pitch-mode 1)))
59+
(efc/org-font-setup))

customizations/ui.el

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,34 @@
44
;; a matter of preference and may require some fiddling to match your
55
;; preferences
66

7-
;; Turn off the menu bar at the top of each frame because it's distracting
8-
(menu-bar-mode -1)
7+
(tooltip-mode -1) ;; disable tooltips
8+
(tool-bar-mode -1) ;; the toolbar is pretty ugly
9+
(scroll-bar-mode -1) ;; disable visible scrollbar
10+
(blink-cursor-mode 0) ;; turn off blinking cursor. distracting!
11+
(setq create-lockfiles nil) ;; no need for ~ files when editing
12+
(fset 'yes-or-no-p 'y-or-n-p) ;; changes all yes/no questions to y/n type
13+
(setq inhibit-startup-message t) ;; go straight to scratch buffer on startup
14+
(setq ring-bell-function 'ignore) ;; turn off audible bell
15+
16+
;; show full path in title bar
17+
(setq-default frame-title-format "%b (%f)")
918

10-
;; Show line numbers
11-
(global-linum-mode)
19+
;; initial frame height and width
20+
(add-to-list 'default-frame-alist '(height . 95))
21+
(add-to-list 'default-frame-alist '(width . 154))
1222

13-
;; You can uncomment this to remove the graphical toolbar at the top. After
14-
;; awhile, you won't need the toolbar.
15-
;; (when (fboundp 'tool-bar-mode)
16-
;; (tool-bar-mode -1))
23+
;; increase font size for better readability
24+
(set-face-attribute 'default nil :height 140)
1725

18-
;; Don't show native OS scroll bars for buffers because they're redundant
19-
(when (fboundp 'scroll-bar-mode)
20-
(scroll-bar-mode -1))
26+
;; on a Mac, don't pop up font menu
27+
(when (string-equal system-type "darwin")
28+
(global-set-key (kbd "s-t") '(lambda () (interactive))))
2129

2230
;; doom is a whole Emacs distribution unto itself,
2331
;; but it's got some really nice packages that you
2432
;; can use a-la-carte. doom-modeline is simply a more
2533
;; modern and more beautiful modeline.
26-
34+
;; doom-modeline uses nice icons from all-the-icons
2735
(setup (:package all-the-icons))
2836

2937
(setup (:package doom-modeline)
@@ -36,15 +44,7 @@
3644
;; look like here:
3745
;; https://github.com/doomemacs/themes/tree/screenshots
3846
(setup (:package doom-themes)
39-
(load-theme 'doom-laserwave t))
40-
41-
;; increase font size for better readability
42-
(set-face-attribute 'default nil :height 140)
43-
44-
;; Uncomment the lines below by removing semicolons and play with the
45-
;; values in order to set the width (in characters wide) and height
46-
;; (in lines high) Emacs will have whenever you start it
47-
;; (setq initial-frame-alist '((top . 0) (left . 0) (width . 177) (height . 53)))
47+
(load-theme 'doom-dracula t))
4848

4949
;; These settings relate to how emacs interacts with your operating system
5050
(setq ;; makes killing/yanking interact with the clipboard
@@ -66,22 +66,14 @@
6666
;; Mouse yank commands yank at point instead of at click.
6767
mouse-yank-at-point t)
6868

69-
(tool-bar-mode -1)
70-
71-
(tooltip-mode -1)
72-
73-
;; No cursor blinking, it's distracting
74-
(blink-cursor-mode 0)
75-
76-
;; full path in title bar
77-
(setq-default frame-title-format "%b (%f)")
69+
;; CUSTOMIZE
7870

79-
;; don't pop up font menu
80-
(global-set-key (kbd "s-t") '(lambda () (interactive)))
71+
;; You can uncomment this to remove the graphical toolbar at the top. After
72+
;; awhile, you won't need the toolbar.
73+
;; (tool-bar-mode -1)
8174

82-
;; no bell
83-
(setq ring-bell-function 'ignore)
75+
;; Your choice of font is very personal, and you must have installed it
76+
;; on your system before you specify it here,
77+
;; Some font suggestions: https://www.creativebloq.com/features/the-best-monospace-fonts-for-coding
78+
;; (set-face-attribute 'default nil :font "Fira Code")
8479

85-
;; initial frame height and width
86-
(add-to-list 'default-frame-alist '(height . 95))
87-
(add-to-list 'default-frame-alist '(width . 154))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy