about summary refs log tree commit diff stats
path: root/emacs-prelude/personal/lisp
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2021-07-03 21:02:12 +0100
committerDavid Morgan <djm_uk@protonmail.com>2021-07-03 21:02:12 +0100
commit3fbaf487183e7b7e3785628ab8ed6290ddd94fd7 (patch)
tree10c7e584e5b1e054dea84dd4d8fa8c397f0a1519 /emacs-prelude/personal/lisp
parentb5e8c2052c43e9865aad35380ff0b36cabae19d2 (diff)
downloaddotfiles-3fbaf487183e7b7e3785628ab8ed6290ddd94fd7.tar.gz
Update emacs prelude config
Diffstat (limited to 'emacs-prelude/personal/lisp')
-rw-r--r--emacs-prelude/personal/lisp/init-clojure.el18
-rw-r--r--emacs-prelude/personal/lisp/init-completion.el43
-rw-r--r--emacs-prelude/personal/lisp/init-dashboard.el2
-rw-r--r--emacs-prelude/personal/lisp/init-git.el15
-rw-r--r--emacs-prelude/personal/lisp/init-ivy.el53
-rw-r--r--emacs-prelude/personal/lisp/init-lsp.el4
-rw-r--r--emacs-prelude/personal/lisp/init-mac.el7
-rw-r--r--emacs-prelude/personal/lisp/init-misc.el14
-rw-r--r--emacs-prelude/personal/lisp/init-modeline.el28
-rw-r--r--emacs-prelude/personal/lisp/init-prelude.el16
-rw-r--r--emacs-prelude/personal/lisp/init-ui.el20
11 files changed, 162 insertions, 58 deletions
diff --git a/emacs-prelude/personal/lisp/init-clojure.el b/emacs-prelude/personal/lisp/init-clojure.el
index 174dffd..191eae2 100644
--- a/emacs-prelude/personal/lisp/init-clojure.el
+++ b/emacs-prelude/personal/lisp/init-clojure.el
@@ -2,7 +2,7 @@
 
 (prelude-require-package 'yasnippet)
 (use-package yasnippet
-  :diminish yas)
+  :diminish yas-minor-mode)
 
 (prelude-require-package 'flycheck-clj-kondo)
 (use-package clojure-mode
@@ -12,6 +12,7 @@
 (prelude-require-package 'clj-refactor)
 (use-package clj-refactor
   :diminish
+  :after yasnippet
   :bind ("C-c '" . hydra-cljr-help-menu/body)
   :config
   (cljr-add-keybindings-with-prefix "C-c C-m")
@@ -23,13 +24,18 @@
       (yas-minor-mode 1))))
 
 (use-package cider
+  :diminish
+  :after key-chord
   :config
   (setq cider-repl-pop-to-buffer-on-connect 'display-only
-	cider-repl-display-help-banner nil
-	cider-repl-history-highlight-current-entry t
-	cider-repl-history-highlight-inserted-item t
-	cider-repl-use-clojure-font-lock t
-	cider-repl-use-pretty-printing t))
+        cider-repl-display-help-banner nil
+        cider-repl-history-highlight-current-entry t
+        cider-repl-history-highlight-inserted-item t
+        cider-repl-use-clojure-font-lock t
+        cider-repl-use-pretty-printing t
+        clojure-toplevel-inside-comment-form t)
+  (key-chord-define-global "??" 'cider-xref-fn-refs-select)
+  (key-chord-define-global "qq" 'cider-xref-fn-refs))
 
 (provide 'init-clojure)
 
diff --git a/emacs-prelude/personal/lisp/init-completion.el b/emacs-prelude/personal/lisp/init-completion.el
index c34ea45..213a91a 100644
--- a/emacs-prelude/personal/lisp/init-completion.el
+++ b/emacs-prelude/personal/lisp/init-completion.el
@@ -5,7 +5,7 @@
   :hook (after-init . company-tng-mode)
   :config
   (global-company-mode)
-  (setq company-idle-delay 0.3 
+  (setq ;company-idle-delay 0.3
         company-selection-wrap-around t
         company-show-numbers t
         company-tooltip-align-annotations t
@@ -22,48 +22,15 @@
   :hook (company-mode . company-box-mode)
   :config
   (setq company-box-backends-colors nil ;; TODO why?
-        company-box-doc-delay 0.3))
-
-(prelude-require-package 'ivy-prescient)
-(use-package ivy-prescient
-  :diminish
-  :config
-  (ivy-prescient-mode 1))
+        ;company-box-doc-delay 0.3
+	))
 
 (prelude-require-package 'company-prescient)
 (use-package company-prescient
   :diminish
   :config
-  (company-prescient-mode 1))
-
-(use-package counsel
-  :diminish ivy-mode counsel-mode
-  :config
-  (setq counsel-grep-base-command "rg -i -M 120 --no-heading --line-number --color never '%s' %s"
-        counsel-rg-base-command "rg -i -M 120 --no-heading --line-number --color never '%s' %s")
-  :bind (("C-c h" . counsel-command-history)
-         ;("C-c i" . counsel-git)
-         ;("C-c j" . counsel-git-grep)
-	 ("C-c c g" . counsel-grep)
-         ("C-c c r" . counsel-rg)
-         ("C-c c o" . counsel-outline)
-         ("C-c z" . counsel-fzf)
-         ("C-c c z" . counsel-fzf)
-	 ("C-c c a" . counsel-apropos)
-         ("C-c c f" . counsel-recentf)
-         ("C-c C-f" . counsel-recentf)
-         :map counsel-mode-map
-         ([remap swiper] . counsel-grep-or-swiper)
-         ([remap swiper-backward] . counsel-grep-or-swiper-backward)
-         ;([remap recentf-open-files] . counsel-recentf)
-         ([remap dired] . counsel-dired))
-    :hook ((after-init . ivy-mode)
-          (ivy-mode . counsel-mode)))
-
-(prelude-require-package 'counsel-projectile)
-(use-package counsel-projectile
-  :config
-  (counsel-projectile-mode))
+  (company-prescient-mode 1)
+  (prescient-persist-mode +1))
 
 (provide 'init-completion)
 
diff --git a/emacs-prelude/personal/lisp/init-dashboard.el b/emacs-prelude/personal/lisp/init-dashboard.el
index 7256c37..2c44ac6 100644
--- a/emacs-prelude/personal/lisp/init-dashboard.el
+++ b/emacs-prelude/personal/lisp/init-dashboard.el
@@ -3,7 +3,7 @@
   :init
   (setq dashboard-center-content t
         dashboard-set-footer nil
-        dashboard-items '((recents  . 5)
+        dashboard-items '((recents  . 15)
                         (bookmarks . 5)
                         (projects . 5)
                         (agenda . 5)
diff --git a/emacs-prelude/personal/lisp/init-git.el b/emacs-prelude/personal/lisp/init-git.el
new file mode 100644
index 0000000..5cb0b78
--- /dev/null
+++ b/emacs-prelude/personal/lisp/init-git.el
@@ -0,0 +1,15 @@
+(defun magit-set-upstream ()
+  (interactive)
+  (magit-shell-command-topdir "git upstream"))
+
+(use-package magit
+  :after key-chord
+  :config
+  (key-chord-define-global "UU" 'magit-set-upstream))
+;  :bind (("C-c g y" . magit-upstream))) ;; TODO
+
+(use-package forge
+  :after magit)
+
+(provide 'init-git)
+
diff --git a/emacs-prelude/personal/lisp/init-ivy.el b/emacs-prelude/personal/lisp/init-ivy.el
new file mode 100644
index 0000000..44f53ac
--- /dev/null
+++ b/emacs-prelude/personal/lisp/init-ivy.el
@@ -0,0 +1,53 @@
+(prelude-require-package 'ivy-prescient)
+(use-package ivy-prescient
+  :diminish
+  :config
+  (ivy-prescient-mode 1))
+
+(prelude-require-package 'ivy-rich)
+(use-package ivy-rich
+  :config
+  (setcdr (assq t ivy-format-functions-alist) #'ivy-format-function-line)
+  (ivy-rich-mode 1))
+
+(use-package counsel
+  :diminish ivy-mode counsel-mode
+  :config
+  (setq ;counsel-grep-base-command "rg -i -M 120 --no-heading --line-number --color never '%s' %s"
+        counsel-rg-base-command "rg -S -M 120 --no-heading --line-number --color never %s .")
+  :bind (("C-c h" . counsel-command-history)
+         ;("C-c i" . counsel-git)
+         ;("C-c j" . counsel-git-grep)
+	 ("C-c c g" . counsel-grep)
+         ("C-c c r" . counsel-rg)
+         ("C-c c o" . counsel-outline)
+         ("C-c z" . counsel-fzf)
+         ("C-c c z" . counsel-fzf)
+	 ("C-c c a" . counsel-apropos)
+         ("C-c c f" . counsel-recentf)
+         ("C-c C-f" . counsel-recentf)
+         :map counsel-mode-map
+         ([remap swiper] . counsel-grep-or-swiper)
+         ([remap swiper-backward] . counsel-grep-or-swiper-backward)
+         ;([remap recentf-open-files] . counsel-recentf)
+         ([remap dired] . counsel-dired))
+    :hook ((after-init . ivy-mode)
+          (ivy-mode . counsel-mode)))
+
+(defun counsel-projectile-rg-glob ()
+  (interactive)
+  (let ((glob (ivy-completing-read "Glob?: " '("*.cljs"
+                                               "*.clj"
+                                               "*.md"
+                                               "*.css"))))
+    (counsel-projectile-rg (concat "--glob " glob))))
+
+(prelude-require-package 'counsel-projectile)
+(use-package counsel-projectile
+  :config
+  (counsel-projectile-mode)
+  :bind (:map projectile-mode-map
+         ("C-c p s R" . counsel-projectile-rg-glob)))
+         
+(provide 'init-ivy)
+
diff --git a/emacs-prelude/personal/lisp/init-lsp.el b/emacs-prelude/personal/lisp/init-lsp.el
index c92ade7..875bc9c 100644
--- a/emacs-prelude/personal/lisp/init-lsp.el
+++ b/emacs-prelude/personal/lisp/init-lsp.el
@@ -15,9 +15,11 @@
         lsp-ui-sideline-show-code-actions nil
         lsp-modeline-code-actions-enable nil ;; TODO this causes errors in *Messages* if t
         lsp-modeline-diagnostics-enable nil
+        lsp-ui-doc-position 'top
         ;; user cider for indendation and completion instead
         lsp-enable-indentation nil
-        lsp-completion-enable nil))
+        lsp-completion-enable nil)
+  (key-chord-define-global "QQ" 'lsp-find-references)) ;; TODO?
 
 (provide 'init-lsp)
 
diff --git a/emacs-prelude/personal/lisp/init-mac.el b/emacs-prelude/personal/lisp/init-mac.el
new file mode 100644
index 0000000..26e4889
--- /dev/null
+++ b/emacs-prelude/personal/lisp/init-mac.el
@@ -0,0 +1,7 @@
+(when (eq system-type 'darwin)
+  (setq mac-option-modifier 'meta)
+  (setq mac-right-option-modifier 'none)
+  (setq mac-command-modifier 'super))
+
+(provide 'init-mac)
+
diff --git a/emacs-prelude/personal/lisp/init-misc.el b/emacs-prelude/personal/lisp/init-misc.el
new file mode 100644
index 0000000..c146e9b
--- /dev/null
+++ b/emacs-prelude/personal/lisp/init-misc.el
@@ -0,0 +1,14 @@
+(prelude-require-package 'envrc)
+(use-package envrc
+ :diminish
+ :config
+ (envrc-global-mode))
+
+(prelude-require-package 'rg)
+(use-package rg
+  :config
+  (rg-enable-default-bindings))
+
+
+(provide 'init-misc)
+
diff --git a/emacs-prelude/personal/lisp/init-modeline.el b/emacs-prelude/personal/lisp/init-modeline.el
index 5ae8281..159bdb5 100644
--- a/emacs-prelude/personal/lisp/init-modeline.el
+++ b/emacs-prelude/personal/lisp/init-modeline.el
@@ -1,14 +1,24 @@
-(prelude-require-package 'doom-modeline)
-(use-package doom-modeline
-  :hook (after-init . doom-modeline-mode)
-  :config ;(add-hook 'after-init-hook #'doom-modeline-mode)
-  (setq doom-modeline-minor-modes t
-        doom-modeline-major-mode-icon t))
+(prelude-require-package 'simple-modeline)
 
-(prelude-require-package 'minions)
-(use-package minions
-  :hook (doom-modeline-mode . minions-mode))
+(use-package simple-modeline
+  :hook (after-init . simple-modeline-mode))
 
+(prelude-require-package 'flycheck-indicator)
+(use-package flycheck-indicator
+  :after flycheck
+  :hook (flycheck-mode . flycheck-indicator-mode)
+  :custom
+  (flycheck-indicator-icon-error 9632)
+  (flycheck-indicator-icon-info 9679)
+  (flycheck-indicator-icon-warning 9650)
+  (flycheck-indicator-status-icons
+   '((running . "◉")
+     (errored . "◙")
+     (finished . "●")
+     (interrupted . "◘")
+     (suspicious . "◘")
+     (no-checker . "○")
+     (not-checked . "○"))))
 
 (provide 'init-modeline)
 
diff --git a/emacs-prelude/personal/lisp/init-prelude.el b/emacs-prelude/personal/lisp/init-prelude.el
index a8cb3af..65fc870 100644
--- a/emacs-prelude/personal/lisp/init-prelude.el
+++ b/emacs-prelude/personal/lisp/init-prelude.el
@@ -1,7 +1,6 @@
 ;; config for misc packages included with prelude
 
 (use-package flycheck
-  :diminish
   :config
   (global-flycheck-mode))
 
@@ -11,6 +10,15 @@
 (use-package whitespace
   :diminish)
 
+(use-package projectile
+  :diminish)
+
+(use-package smartparens
+  :diminish)
+
+(use-package subword
+  :diminish)
+
 (use-package ace-window
   :diminish
   :custom-face
@@ -18,5 +26,11 @@
     ((t (:foreground "white" :background "red"
          :weight bold :height 2.5 :box (:line-width 10 :color "red"))))))
 
+;; allow other things to use C-c s
+(define-key prelude-mode-map (kbd "C-c s") nil)
+(define-key prelude-mode-map (kbd "C-c S") 'crux-swap-windows)
+
+(diminish 'prelude-mode)
+
 (provide 'init-prelude)
 
diff --git a/emacs-prelude/personal/lisp/init-ui.el b/emacs-prelude/personal/lisp/init-ui.el
index b40e207..fefd637 100644
--- a/emacs-prelude/personal/lisp/init-ui.el
+++ b/emacs-prelude/personal/lisp/init-ui.el
@@ -1,16 +1,32 @@
-;(prelude-require-package 'all-the-icons)
-
 (toggle-frame-maximized)
 
 (menu-bar-mode -1)
 (tool-bar-mode -1)
 (scroll-bar-mode -1)
 
+(prelude-require-package 'solarized-theme)
+(load-theme 'solarized-dark t)
+;(set-face-background 'hi-yellow "yellow")
+
 (setq whitespace-line-column 120)
 
+(require 'hi-lock)
+(defun toggle-highlight-symbol-at-point ()
+  (interactive)
+  (if hi-lock-interactive-patterns
+      (unhighlight-regexp (car (car hi-lock-interactive-patterns)))
+    (highlight-symbol-at-point)))
+(global-set-key (kbd "s-.") 'toggle-highlight-symbol-at-point)
+
 (use-package paren
   :config
   (show-paren-mode +1))
 
+(global-set-key (kbd "C-x C-S-k") 'kill-this-buffer)
+
+(use-package miniedit
+  :commands minibuffer-edit
+  :init (miniedit-install))
+
 (provide 'init-ui)