Browse Source

a lot of emacs stuff

canon
Hazel Levine 5 months ago
parent
commit
94c9eeaa1c
Signed by: hazel
GPG Key ID: 1884029A28789A62
  1. 2
      config/emacs/modules/core/keybindings.el
  2. 2
      config/emacs/modules/core/sanity.el
  3. 2
      config/emacs/modules/editor/projectile.el
  4. 9
      config/emacs/modules/editor/workspaces.el
  5. 9
      config/emacs/modules/tools/org.el
  6. 7
      config/emacs/modules/ui/dashboard.el
  7. 14
      config/emacs/modules/ui/fonts.el
  8. 39
      config/emacs/modules/ui/modeline.el
  9. 14
      config/emacs/snippets/cooltt-mode/square
  10. 6
      config/emacs/snippets/org-mode/src-block
  11. 2
      config/emacs/snippets/prog-mode/hack
  12. 2
      config/emacs/snippets/prog-mode/todo

2
config/emacs/modules/core/keybindings.el

@ -22,7 +22,7 @@
:prefix "SPC"
:non-normal-prefix "C-SPC")
(global-definer "SPC" '(execute-extended-command :wk "execute command"))
;(global-definer "SPC" '(execute-extended-command :wk "execute command"))
;; Create a "general" definer for vim motions in normal/visual/motion mode, which are prefixed
;; with 'g'.

2
config/emacs/modules/core/sanity.el

@ -41,7 +41,7 @@
(setq tab-width 4)
(setq tab-stop-list (tulips/generate-tab-stops 4))
(setq indent-tabs-mode nil)
(setq-default indent-tabs-mode nil)
;; Important.
(defun tulips/insert-shruggie ()

2
config/emacs/modules/editor/projectile.el

@ -25,5 +25,7 @@
(global-definer
"r" '(rg-menu :wk "rg")))
(global-definer "SPC" '(projectile-find-file-dwim :wk "find file"))
(provide 'editor/projectile)
;;; projectile.el ends here

9
config/emacs/modules/editor/workspaces.el

@ -17,6 +17,11 @@
;; Set the first tab name.
(tab-bar-rename-tab "main")
;; Open the dashboard upon loading a new tab.
(setq tab-bar-new-tab-choice
(lambda ()
(get-buffer-create "*dashboard*")))
;; This generates the new workspace name from its index, because
;; otherwise it's named to the name of the focused buffer, which gets
;; confusing real fast.
@ -25,7 +30,7 @@
(interactive)
(let ((ntabs (length (tab-bar-tabs))))
(tab-bar-new-tab)
(tab-bar-rename-tab (format "%d" i))))
(tab-bar-rename-tab (format "%d" (1+ ntabs)))))
;; Make workspace switcher functions.
(dotimes (i 9)
@ -35,7 +40,7 @@
(interactive)
(let ((ntabs (length (tab-bar-tabs))))
(if (<= i ntabs)
(tab-select i)
(tab-select i)
(error "Workspace %d does not exist" i))))
(format "Switch to workspace %d" i))))

9
config/emacs/modules/tools/org.el

@ -125,5 +125,14 @@
"t" '(tulips/org-roam-open-todo :wk "open todos")
"c" '(org-roam-capture :wk "capture")))
(use-package org-roam-ui
:straight (:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
:after org-roam
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
(provide 'tools/org)
;;; org.el ends here

7
config/emacs/modules/ui/dashboard.el

@ -15,7 +15,12 @@
(setq initial-buffer-choice
(lambda ()
(get-buffer-create "*dashboard*"))))
(get-buffer-create "*dashboard*")))
(setq dashboard-set-init-info t)
(setq dashboard-set-footer nil)
(setq dashboard-startup-banner 'logo)
(setq dashboard-center-content t))
(provide 'ui/dashboard)
;;; dashboard.el ends here

14
config/emacs/modules/ui/fonts.el

@ -16,7 +16,7 @@
properties)))))
(defvar tulips/monospace-font
(tulips/xft-font-string "Source Code Pro" 10
(tulips/xft-font-string "Pragmata Pro" 11
'((hintstyle . 3)
(hinting . true)
(lcdfilter . 3)
@ -35,17 +35,17 @@
(lcdfilter . 3)
(antialias . true))))
(set-face-attribute 'default nil :font tulips/monospace-font)
;(set-face-attribute 'default nil :font tulips/monospace-font)
;; Try and get Unicode fallback fonts.
(set-fontset-font "fontset-default" nil tulips/monospace-font)
(set-fontset-font "fontset-default" nil tulips/unicode-font nil 'append)
;(set-fontset-font "fontset-default" nil tulips/monospace-font)
;(set-fontset-font "fontset-default" nil tulips/unicode-font nil 'append)
;; Load the Unicode Fonts package as a backup, just in case.
;; If we get here, the stuff displayed is ugly.
(use-package unicode-fonts
:straight t
:config (unicode-fonts-setup))
;(use-package unicode-fonts
; :straight t
; :config (unicode-fonts-setup))
;; Use all-the-icons.
(use-package all-the-icons

39
config/emacs/modules/ui/modeline.el

@ -1,19 +1,42 @@
;;; ui/modeline --- -*- lexical-binding: t; -*-
;;; Commentary:
;; I'm too used to DOOM, so I copy its modeline.
;; What it says on the tin.
;;; Code:
(require 'use-package)
(require 'ui/theme)
(use-package doom-modeline
(use-package telephone-line
:straight t
:hook (after-init . doom-modeline-mode)
:hook (doom-modeline-mode . size-indication-mode)
:hook (doom-modeline-mode . column-number-mode)
:config
(setq doom-modeline-support-imenu t
doom-modeline-buffer-file-name-style 'relative-from-project))
:init
(defface telephone-line-evil-symex
`((t (:background ,(doom-color 'eg-purple6) :inherit telephone-line-evil)))
"Face used in evil color-coded segments when in Symex state."
:group 'telephone-line-evil)
(telephone-line-defsegment* telephone-line-evil-symex-tag-segment ()
"Displays current evil mode, or symex mode.
Configure the face group telephone-line-evil-symex to change the colors per-mode."
(when (bound-and-true-p evil-mode)
(let ((tag (cond
((not (evil-visual-state-p)) (upcase (symbol-name evil-state)))
((eq evil-visual-selection 'block)
(if telephone-line-evil-use-short-tag "VB" "V-BLOCK"))
((eq evil-visual-selection 'line)
(if telephone-line-evil-use-short-tag "VL" "V-LINE"))
(t "VISUAL"))))
(if telephone-line-evil-use-short-tag
(seq-take tag 2)
tag))))
(setq telephone-line-primary-left-separator 'telephone-line-cubed-left
telephone-line-primary-right-separator 'telephone-line-cubed-right
telephone-line-secondary-left-separator 'telephone-line-cubed-hollow-left
telephone-line-secondary-right-separator 'telephone-line-cubed-hollow-right
telephone-line-height 24)
:config (telephone-line-mode 1))
(provide 'ui/modeline)
;;; modeline.el ends here

14
config/emacs/snippets/cooltt-mode/square

@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: square
# key: !square
# --
--
-- ------------>
-- | |
-- | |
-- | |
-- | |
-- v v
-- ------------>
--

6
config/emacs/snippets/org-mode/src-block

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: src-block
# key: !src
# --
#+BEGIN_SRC
#+END_SRC

2
config/emacs/snippets/prog-mode/hack

@ -2,4 +2,4 @@
# name: hack
# key: !hack
# --
[HACK: ${1:`(string-join (tulips/current-pk-fronters) ", ")`}; `(format-time-string "%Y-%m-%d")`] $2`(comment-line (point))`
`(string-trim comment-start)` [HACK: ${1:`(string-join (tulips/current-pk-fronters) ", ")`}; `(format-time-string "%Y-%m-%d")`] `(string-trim comment-end)`

2
config/emacs/snippets/prog-mode/todo

@ -1,4 +1,4 @@
# key: !todo
# name: todo
# --
[TODO: ${1:`(string-join (tulips/current-pk-fronters) ", ")`}; `(format-time-string "%Y-%m-%d")`] $2`(comment-line (point))`
`(string-trim comment-start)` [TODO: ${1:`(string-join (tulips/current-pk-fronters) ", ")`}; `(format-time-string "%Y-%m-%d")`] `(string-trim comment-end)`
Loading…
Cancel
Save