|
|
- ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
-
- ;; Place your private configuration here! Remember, you do not need to run 'doom
- ;; sync' after modifying this file!
-
- ;; Some functionality uses this to identify you, e.g. GPG configuration, email
- ;; clients, file templates and snippets.
- (setq user-full-name "Levi Olson"
- user-mail-address "olson.levi@gmail.com")
-
- ;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
- ;; are the three important ones:
- ;;
- ;; + `doom-font'
- ;; + `doom-variable-pitch-font'
- ;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
- ;; presentations or streaming.
- ;;
- ;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
- ;; font string. You generally only need these two:
- ;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
- ;; doom-variable-pitch-font (font-spec :family "sans" :size 13))
-
- (setq doom-font (font-spec :family "PragmataPro Liga" :size 18 :weight 'regular)
- doom-big-font (font-spec :family "PragmataPro Liga" :size 18 :weight 'regular)
- ;; doom-variable-pitch-font (font-spec :family "PragmataPro Liga" :size 20)
- doom-variable-pitch-font (font-spec :family "Overpass" :size 20 :weight 'thin)
- doom-unicode-font (font-spec :family "Fira Code" :size 15 :weight 'regular) ;;Fira Code
- doom-serif-font (font-spec :family "Baskerville" :size 20))
-
- ;; There are two ways to load a theme. Both assume the theme is installed and
- ;; available. You can either set `doom-theme' or manually load a theme with the
- ;; `load-theme' function. This is the default:
- (setq doom-theme 'doom-one) ;; doom-material is nice too
- ;; Light theme alternatives
- ;; doom-ayu-light
- ;; doom-acario-light
- ;; doom-earl-grey
- ;; doom-flatwhite
- ;; doom-one-light
- ;; doom-nord-light *
- ;; doom-opera-light
- ;; doom-solarized-light
- ;; doom-tomorrow-day *
- (remove-hook 'window-setup-hook #'doom-init-theme-h)
- (add-hook 'after-init-hook #'doom-init-theme-h 'append)
- (delq! t custom-theme-load-path)
- (setq doom-modeline-height 60)
-
- ;; If you use `org' and don't want your org files in the default location below,
- ;; change `org-directory'. It must be set before org loads!
- (setq org-directory "~/Nextcloud/Org")
-
- ;; Some nicer defaults
- (setq doom-fallback-buffer-name "*Doom*"
- +doom-dashboard-name "*Doom*")
-
- (map! :g "s-<right>" #'next-buffer
- :g "s-<left>" #'previous-buffer)
-
- ;; Enable tramp so we can use webdav to connect to nextcloud
- (use-package! tramp-gvfs
- :init
- (setq tramp-gvfs-enabled t)
- )
-
-
- ;; This determines the style of line numbers in effect. If set to `nil', line
- ;; numbers are disabled. For relative line numbers, set this to `relative'.
- (setq display-line-numbers-type t)
- (setq projectile-project-search-path "~/Projects")
-
- (require 's)
-
- (when (eq system-type 'gnu/linux)
- (when (s-contains? "microsoft" operating-system-release t) ;; TODO: maybe use variable system-configuration instead?
- (progn
- (setq org-directory "/mnt/c/Users/Levi/Nextcloud/Org")
- (add-to-list 'default-frame-alist '(top . 400))
- (add-to-list 'default-frame-alist '(left . 750))
- (add-to-list 'default-frame-alist '(height . 60))
- (add-to-list 'default-frame-alist '(width . 235))
- (setq browse-url-chrome-program "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")
- (setq browse-url-chromium-program "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")
- )))
- (when (eq system-type 'darwin)
- (progn
- (setq org-directory "/Users/Levi_Olson/Nextcloud/Org")
- (add-to-list 'default-frame-alist '(top . 0))
- (add-to-list 'default-frame-alist '(left . 0))
- (add-to-list 'default-frame-alist '(height . 49))
- (add-to-list 'default-frame-alist '(width . 178))
- (setq browse-url-chrome-program "/Applications/Safari.app")
- (setq browse-url-chromium-program "/Applications/Safari.app")
- ))
-
-
- ;; Here are some additional functions/macros that could help you configure Doom:
- ;;
- ;; - `load!' for loading external *.el files relative to this one
- ;; - `use-package!' for configuring packages
- ;; - `after!' for running code after a package has loaded
- ;; - `add-load-path!' for adding directories to the `load-path', relative to
- ;; this file. Emacs searches the `load-path' when you load packages with
- ;; `require' or `use-package'.
- ;; - `map!' for binding new keys
- ;;
- ;; To get information about any of these functions/macros, move the cursor over
- ;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
- ;; This will open documentation for it, including demos of how they are used.
- ;;
- ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
- ;; they are implemented.
-
- (unless (string-match-p "^Power N/A" (battery)) ; On laptops...
- (display-battery-mode 1))
- (display-time-mode 1)
- (global-subword-mode 1)
-
-
- (defvar mixed-pitch-modes '(org-mode LaTeX-mode markdown-mode gfm-mode Info-mode)
- "Modes that `mixed-pitch-mode' should be enabled in, but only after UI initialisation.")
- (defun init-mixed-pitch-h ()
- "Hook `mixed-pitch-mode' into each mode in `mixed-pitch-modes'.
- Also immediately enables `mixed-pitch-modes' if currently in one of the modes."
- (when (memq major-mode mixed-pitch-modes)
- (mixed-pitch-mode 1))
- (dolist (hook mixed-pitch-modes)
- (add-hook (intern (concat (symbol-name hook) "-hook")) #'mixed-pitch-mode)))
- (add-hook 'doom-init-ui-hook #'init-mixed-pitch-h)
-
-
- (defun my-generate-tab-stops (&optional width max)
- "Return a sequence suitable for `tab-stop-list'."
- (let* ((max-column (or max 200))
- (tab-width (or width tab-width))
- (count (/ max-column tab-width)))
- (number-sequence tab-width (* tab-width count) tab-width)))
-
- (defun my-setup-indent (n)
- (setq c-basic-offset n)
- (setq coffee-tab-width n) ; coffeescript
- (setq javascript-indent-level n) ; javascript-mode
- (setq js-indent-level n) ; js-mode
- (setq js2-basic-offset n) ; js2-mode, in latest js2-mode, it's alias of js-indent-level
- (setq web-mode-markup-indent-offset n) ; web-mode, html tag in html file
- (setq web-mode-css-indent-offset n) ; web-mode, css in html file
- (setq web-mode-code-indent-offset n) ; web-mode, js code in html file
- (setq css-indent-offset n) ; css-mode
- (setq tab-width n)
- (setq indent-tabs-mode nil)
- (setq tab-stop-list (my-generate-tab-stops))
- )
-
- (my-setup-indent 2)
-
-
-
- (load! "functions.el")
- (use-package! functions)
-
- ;; (use-package! setup-elfeed)
-
- ;; (load! "fancy-banner.el")
- ;; (use-package! fancy-banner)
-
- (use-package! emacs
- :config
- (setq +ligatures-in-modes '(not special-mode comint-mode eshell-mode term-mode
- vterm-mode Info-mode elfeed-search-mode elfeed-show-mode)))
- (use-package! magit-delta
- :hook (magit-mode . magit-delta-mode))
-
- ;; Tabnine::version ;; Which version of Tabnine
- ;; Tabnine::restart ;; restart the Tabnine service
- ;; Tabnine::sem ;; enables semantic completion for the current language
- ;; Tabnine::no_sem ;; disables semantic completion for the current language
- ;; Tabnine::active ;; checks if Tabnine is activated
- ;; Tabnine::config ;; to open the config
- ;; Tabnine::config_dir ;; /Users/leviolson/Library/Preferences/TabNine
- ;; Tabnine::config
- (use-package! company-tabnine
- :config
- (add-to-list 'company-backends 'company-tabnine))
-
- (use-package! graphql-mode
- :config
- (set-company-backend! 'graphql-mode '(:separate company-tabnine company-capf company-yasnippet)))
- (use-package! emacs
- :config
- (set-company-backend! 'emacs-lisp-mode '(:separate company-tabnine company-capf company-yasnippet)))
- ;; (use-package! typescript-mode
- ;; :config
- ;; (set-company-backend! 'typescript-mode '(company-tabnine company-capf company-yasnippet)))
-
- (use-package! company
- :config
- ;; Trigger completion immediately.
- (setq company-idle-delay 0.2)
-
- ;; Number the candidates (use M-1, M-2 etc to select completions).
- (setq company-show-quick-access t))
-
- (use-package! darkroom
- :commands darkroom-mode
- :custom
- (darkroom-margins (cons 40 0))
- (darkroom-text-scale-increase 0)
- (darkroom-fringes-outside-margins nil)
- (darkroom-margin-increment 0.2)
- )
-
- (use-package! org
- ;; :disabled t
- :commands org-capture
- :mode ("\\.org\\'" . org-mode)
- :bind (
- ("C-," . org-cycle-agenda-files)
- ;; ("C-c C-d" . org-capture)
- :map org-mode-map
- ;; ("M-n" . leo/org-narrow-next-tree)
- ;; ("M-p" . leo/org-narrow-prev-tree)
- ;; ("M-P" . leo/org-present)
- )
- :preface
- (defvar org-html-validation-link)
- (defvar org-html-text-markup-alist)
- (defvar org-capture-templates)
- :init
- (setq org-agenda-files (list
- (concat org-directory "/todo.org")
- (concat org-directory "/projects.org")
- (concat org-directory "/Recipies.org")
- (concat org-directory "/help.org")
- (concat org-directory "/personal.org")
- (concat org-directory "/archive.org")
- (concat "/Users/Levi_Olson/Projects" "/verastar/epc_guided_flow.org")
- ))
- (setq org-agenda-include-diary t)
- (add-to-list 'safe-local-variable-values '(eval leo/deft-insert-boilerplate))
- (setq org-refile-targets '((nil :maxlevel . 3)
- (org-agenda-files :maxlevel . 3)))
- (setq org-todo-keyword-faces
- '(("TODO" . org-roam-link-shielded)
- ("WAIT" . org-roam-link-shielded)
- ("NEXT" . org-roam-link-current)
- ("PLAN" . org-target)
- ("SPIKE" . org-target)
- ("ACTIVE" . org-todo)))
- (setq org-todo-keywords '(
- (sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
- (sequence "PLAN(p)" "SPIKE(s)" "ACTIVE(a)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELLED(c@)")
- ))
- :config
- (require 'org-protocol)
-
- (setq org-default-notes-file (concat org-directory "/todo.org"))
- (setq org-display-remote-inline-images t)
- (setq org-image-actual-width (list 1000))
-
- (org-babel-do-load-languages 'org-babel-load-languages '((js . t)
- (typescript . t)
- (shell . t)
- (apex . t)
- (soql . t)
- (emacs-lisp . t)))
-
- (setq org-capture-templates
- '(("w" "Default template" entry (file+headline org-default-notes-file "Unfiled")
- "* %^{Title}%?\n\nSource: %:link\n:COPIED_TEXT:\n %i\n:END:\n")
- ("t" "new task" entry (file+headline org-default-notes-file "Tasks")
- "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n")
- ("n" "new note" entry (file+headline org-default-notes-file "Notes")
- "* %?\n%i\n")
- ("l" "store link" entry (file+olp org-default-notes-file "Links" "Unfiled")
- "* %a\n%?\n")
- ))
- (setq org-structure-template-alist
- '(("r" . "src restclient :results raw")
- ("j" . "src js :cmd \"/usr/local/bin/babel-node\" :results output code")
- ("e" . "src emacs-lisp :results silent")
- ("a" . "export ascii")
- ("c" . "center")
- ("C" . "comment")
- ("E" . "export")
- ("h" . "export html")
- ("l" . "export latex")
- ("q" . "quote")
- ("s" . "src")
- ("v" . "verse")))
- (defconst checkbox-fontlock-keywords-alist
- (mapcar (lambda (regex-char-pair)
- `(,(car regex-char-pair)
- (0 (prog1 ()
- (compose-region (match-beginning 1)
- (match-end 1)
- ,(concat (list ?\C-i)
- (list (decode-char 'ucs (cadr regex-char-pair)))))))))
- '(
- ;; Fira Code PragmataPro Liga Alternate
- ;; 2B1C -> ⬜ F096 ->
- ;; 29C7 -> ⧇ F147 -> F458 ->
- ;; 2BBD -> ⮽ F046 ->
- ;; 25A1 -> □
- ;; 25A2 -> ▢
- ;; 25A3 -> ▣
- ;; 25C6 -> ◆
- ;; 25C7 -> ◇
- ;; 25C9 -> ◉
- ;; 2610 -> ☐
- ;; 2611 -> ☑
- ;; 229F -> ⊟
- ;; 2612 -> ☒
-
- ;; PragmataPro Liga
- ;; ("\\(\\[ \\]\\)" #XF096)
- ;; ("\\(\\[-\\]\\)" #XF147)
- ;; ("\\(\\[X\\]\\)" #XF046)
-
- ;; Fira Code
- ("\\(\\[ \\]\\)" #X2B1C)
- ("\\(\\[-\\]\\)" #XF147)
- ("\\(\\[X\\]\\)" #X2BBD)
-
- )))
- (defun add-checkbox-symbol-keywords ()
- "Add checkbox font to font-lock."
- (font-lock-add-keywords nil checkbox-fontlock-keywords-alist))
-
- (add-hook 'org-mode-hook 'add-checkbox-symbol-keywords)
- (add-hook 'org-mode-hook '(lambda ()
- (visual-line-mode 0)
- (variable-pitch-mode 1)
- (org-indent-mode 1)
- (auto-fill-mode 0)
- ))
- (setq org-display-remote-inline-images t)
- (setq org-image-actual-width (list 1000))
-
- )
-
- (use-package org-roam
- :disabled t
- :custom
- (org-roam-directory (concat org-directory "/Roam/"))
- (org-roam-link-title-format "r::%s")
- :bind (:map org-roam-mode-map
- (("C-c n l" . org-roam)
- ("C-c n f" . org-roam-find-file)
- ("C-c n g" . org-roam-graph))
- :map org-mode-map
- (("C-c n i" . org-roam-insert))
- (("C-c n I" . org-roam-insert-immediate))))
-
- (use-package! org-agenda
- :after org
- :bind ("C-c a" . (lambda() (interactive) (org-agenda nil "z")))
- :init
- (set-face-attribute 'org-agenda-structure nil :weight 'bold :slant 'italic :foreground "#51afef")
-
- ;; Override stubborn vars
- (setq org-deadline-warning-days 0)
-
-
- (setq org-agenda-custom-commands
- '(
- ("z" "Show All Ze Things"
- (
- (todo "TODO"
- ((org-agenda-skip-function '(org-agenda-skip-if nil '(timestamp)))
- (org-agenda-skip-function
- `(org-agenda-skip-entry-if
- 'notregexp ,(format "\\[#%s\\]" (char-to-string org-priority-highest))))
- ;; (org-agenda-skip-function '(org-agenda-skip-entry-if 'wait))
- (org-agenda-block-separator nil)
- (org-agenda-overriding-header "\nImportant tasks without a date\n")
- ))
- (todo "TODO"
- ((org-agenda-overriding-header "\nTasks Ready\n")
- (org-agenda-skip-function '(org-agenda-skip-entry-if 'regexp "\\[#A\\]"))
- (org-agenda-block-separator nil)
- ))
- (todo "WAIT"
- ((org-agenda-overriding-header "\nTasks on hold\n")
- (org-agenda-block-separator nil)
- ))
- (agenda ""
- ((org-agenda-overriding-header "\nDaily Agenda\n")
- (org-agenda-span 1)
- (org-agenda-start-day nil)
- (org-deadline-warning-days 0)
- (org-deadline-warning-days 0)
- (org-scheduled-past-days 0)
- (org-deadline-past-days 0)
-
- (org-agenda-day-face-function (lambda(date) 'org-agenda-date))
- (org-agenda-format-date "")
- (org-agenda-skip-deadline-if-done t)
- (org-agenda-skip-scheduled-if-done t)
- (org-agenda-block-separator nil)))))
-
- ))
- )
-
- (use-package! org-super-agenda
- :disabled t
- :after org-agenda
- :init
- (setq
- org-agenda-time-grid '((daily today require-timed) (800 1000 1200 1400 1600 1800 2000) "----------------------" "......")
- org-agenda-skip-scheduled-if-done t
- org-agenda-skip-deadline-if-done t
- org-agenda-include-deadlines t
- org-agenda-include-diary t
- org-agenda-block-separator nil
- org-agenda-compact-blocks t
- org-agenda-start-day nil
- org-agenda-span 'day
- org-agenda-start-on-weekday nil
- org-agenda-start-with-log-mode t
- )
- (setq org-super-agenda-groups
- '((:discard (:and (:scheduled t
- :todo "DONE"
- :not (:log closed))))
- (:name "Done today"
- :log closed
- :order 4)
- (:name "Today"
- :time-grid t)
- (:name "Deadlines"
- :deadline today
- :order 0)
- (:name "Overdue"
- :deadline past
- :order 2)
- (:name "Next"
- :category "next")
- (:name "Personal tasks"
- :scheduled today)))
-
- (setq org-agenda-custom-commands
- '(("z" "Super view"
- ((agenda "" ((org-agenda-span 1)
- (org-agenda-start-day nil)
- (org-super-agenda-groups
- '((:name "Today"
- :time-grid t
- ;; :date today
- ;; :todo "TODAY"
- :scheduled today
- :order 1)))))
- (alltodo "" ((org-agenda-span 1)
- (org-agenda-start-day nil)
- (org-agenda-overriding-header "")
- (org-super-agenda-groups
- '(
- (:name "Next to do"
- :todo "NEXT"
- :order 1)
-
- (:name "Important"
- :tag "Important"
- :priority "A"
- :order 2)
-
- (:name "Due Today"
- :deadline today
- :order 3)
-
- (:name "Overdue"
- :deadline past
- :order 7)
-
- (:name "Due Soon"
- :deadline future
- :order 8)
-
- ;; (:name "Assignments"
- ;; :tag "Assignment"
- ;; :order 10)
- ;; (:name "Issues"
- ;; :tag "Issue"
- ;; :order 12)
- ;; (:name "Projects"
- ;; :tag "Project"
- ;; :order 14)
- ;; (:name "Emacs"
- ;; :tag "Emacs"
- ;; :order 13)
- ;; (:name "Research"
- ;; :tag "Research"
- ;; :order 15)
- ;; (:name "To read"
- ;; :tag "Read"
- ;; :order 30)
- ;; (:name "Waiting"
- ;; :todo "WAITING"
- ;; :order 20)
- ;; (:name "trivial"
- ;; :priority<= "C"
- ;; :tag ("Trivial" "Unimportant")
- ;; :todo ("SOMEDAY" )
- ;; :order 90)
- ;; (:discard (:tag ("Chore" "Routine" "Daily")))
- ))))))))
-
- :config
- (org-super-agenda-mode)
- )
-
- (use-package! deft
- :bind
- ("C-c n d" . deft)
- :config
- (setq deft-recursive t
- deft-use-filter-string-for-filename t
- deft-default-extension "org"
- deft-directory (concat org-directory "/Roam/")
- deft-recursive-ignore-dir-regexp "\\(?:\\.\\|\\.\\.\\|setup\\)$"))
-
- (use-package! org-pandoc-import
- :after org
- :commands (org-pandoc-import-html-as-org org-pandoc-import-html-to-org)
- :config
- (org-pandoc-import-backend html)
- )
-
- (use-package! lsp-mode
- :disabled t
- :config
- (setq +lsp-company-backends '(:separate company-tabnine company-lsp company-yasnippet company-capf))
- (setq lsp-enable-symbol-highlighting nil
- lsp-headerline-breadcrumb-enable t))
-
- (use-package! apex-mode
- :mode "\\.cls\\'"
- :bind ("M-q" . #'leo/kill-this-buffer-unless-scratch)
- )
-
- (use-package! web-mode
- :mode "\\.\\(app\\|page\\)\\'")
-
- (use-package! so-long
- :config
- (setq so-long-action 'so-long-minor-mode))
-
- (use-package! dired
- :config
- (setq dired-listing-switches "-ahgo --group-directories-first"))
-
- (use-package! dired-x
- :disabled t
- :custom
- (dired-omit-files nil))
-
- (use-package! hydra
- :config
- ;; (global-set-key (kbd "C-x o") (defhydra hydra-window ()
- ;; "window"
- ;; ("v" (lambda()
- ;; (interactive)
- ;; (split-window-right)
- ;; (windmove-right))
- ;; "vert")
- ;; ("x" (lambda()
- ;; (interactive)
- ;; (split-window-below)
- ;; (windmove-down))
- ;; "horz")
- ;; ("o" delete-other-windows "one" :color blue)
- ;; ("m" ace-window "ace")
- ;; ("b" ivy-switch-buffer "buf")
- ;; ("q" nil "quit")
- ;; ))
- )
-
- (use-package! pretty-hydra
- :init
- (defun with-faicon (icon str &optional height v-adjust)
- (s-concat (all-the-icons-faicon icon :v-adjust (or v-adjust 0) :height (or height 1)) " " str))
-
- (defun with-fileicon (icon str &optional height v-adjust)
- (s-concat (all-the-icons-fileicon icon :v-adjust (or v-adjust 0) :height (or height 1)) " " str))
-
- (defun with-octicon (icon str &optional height v-adjust)
- (s-concat (all-the-icons-octicon icon :v-adjust (or v-adjust 0) :height (or height 1)) " " str))
-
- (defun with-material (icon str &optional height v-adjust)
- (s-concat (all-the-icons-material icon :v-adjust (or v-adjust 0) :height (or height 1)) " " str))
-
- (defun with-mode-icon (mode str &optional height nospace face)
- (let* ((v-adjust (if (eq major-mode 'emacs-lisp-mode) 0.0 0.05))
- (args `(:height ,(or height 1) :v-adjust ,v-adjust))
- (_ (when face
- (lax-plist-put args :face face)))
- (icon (apply #'all-the-icons-icon-for-mode mode args))
- (icon (if (symbolp icon)
- (apply #'all-the-icons-octicon "file-text" args)
- icon)))
- (s-concat icon (if nospace "" " ") str)))
-
- (defun icon-displayable-p ()
- "Return non-nil if icons are displayable."
- (and t
- (or (display-graphic-p) (daemonp))
- (or (featurep 'all-the-icons)
- (require 'all-the-icons nil t))))
- (cl-defun pretty-hydra-title (title &optional icon-type icon-name
- &key face height v-adjust)
- "Add an icon in the hydra title."
- (let ((face (or face `(:foreground ,(face-background 'highlight))))
- (height (or height 1.0))
- (v-adjust (or v-adjust 0.0)))
- (concat
- (when (and (icon-displayable-p) icon-type icon-name)
- (let ((f (intern (format "all-the-icons-%s" icon-type))))
- (when (fboundp f)
- (concat
- (apply f (list icon-name :face face :height height :v-adjust v-adjust))
- " "))))
- (propertize title 'face face))))
- (defun leo/load-theme (theme)
- (setq doom-theme theme)
- (load-theme theme))
-
- (defvar leo/toggles--title (with-faicon "toggle-on" "Toggles" 1 -0.05))
- (pretty-hydra-define leo/toggles
- (:color amaranth :quit-key ("q" "C-g") :title leo/toggles--title)
- ("Basic"
- (
- ("n" doom/toggle-line-numbers "line numbers")
- ("w" whitespace-mode "whitespace" :toggle t)
- ("r" rainbow-mode "rainbow" :toggle t)
- )
- "Highlight"
- (
- ("h l" hl-line-mode "line" :toggle t)
- ("h t" hl-todo-mode "todo" :toggle t)
- )
- "UI"
- (
- ("d" (leo/load-theme 'doom-one) "dark theme" :toggle (eq doom-theme 'doom-one))
- ("l" (leo/load-theme 'doom-nord-light) "light theme" :toggle (eq doom-theme 'doom-nord-light))
- )
- "Modeline"
- (
- ("m" doom-modeline-mode "modern mode-line" :toggle t)
- ("b" display-battery-mode "battery" :toggle t)
- ("t" display-time-mode "time" :toggle t)
- )
- "Coding"
- (
- ("f" flycheck-mode "flycheck" :toggle t)
- ("F" flymake-mode "flymake" :toggle t)
- ("p" smartparens-mode "smartparens" :toggle t)
- ("P" smartparens-strict-mode "smartparens strict" :toggle t)
- ("S" show-smartparens-mode "show smartparens" :toggle t)
- )
- "Emacs"
- (
- ("D" toggle-debug-on-error "debug on error" :toggle (default-value 'debug-on-error))
- ("X" toggle-debug-on-quit "debug on quit" :toggle (default-value 'debug-on-quit))
- )
- )
- )
- )
-
- (use-package! podcaster
- :custom
- (podcaster-mp3-player "mpv")
- (podcaster-feeds-urls '(
- "https://feeds.fireside.fm/linuxunplugged/rss" ;; Linux Unplugged
- "https://feeds.fireside.fm/office/rss" ;; Office Hours
- "https://feeds.fireside.fm/linuxactionnews/rss" ;; Linux Action News
- "https://feeds.fireside.fm/selfhosted/rss" ;; Self Hosted
- "https://feeds.fireside.fm/coder/rss" ;; Coder Radio
- "https://feeds.fireside.fm/extras/rss" ;; Extras
- ))
- (podcaster-mp3-player-extra-params '("--quiet" "--really-quiet" "--no-audio-display" "--force-window=no"))
- :config
- (defun podcaster ()
- "Play podcasts."
- (interactive)
- (let* ((ivy-sort-functions-alist nil)
- (items (podcaster--collect-podcasts))
- (titles (mapcar #'car items))
- (title (completing-read "Podcasts: " titles))
- (item (cdr (assoc-string title items))))
- (when (ignore-errors (podcaster--player-process))
- (podcaster-stop))
- (podcaster--play-podcast item)))
- )
-
- (use-package! emms
- :disabled t
- :commands emms
- :init
- (add-hook 'emms-player-started-hook 'emms-show)
- (setq emms-show-format "Playing: %s")
- :config
- (emms-minimalistic)
- (emms-default-players)
- (setq emms-player-list '(emms-player-mpv)
- emms-playlist-buffer-name "*Media*")
- (setq emms-info-asynchronously nil)
-
- (setq-default
- emms-source-file-default-directory "~/Music/"
-
- emms-source-playlist-default-format 'm3u
- emms-playlist-mode-center-when-go t
- emms-playlist-default-major-mode 'emms-playlist-mode
- emms-show-format "NP: %s"
-
- emms-player-list '(emms-player-mpv))
- :bind (:map global-map
- ("C-c m" . nil)
- ("C-c m" . emms-hydra/body))
- :pretty-hydra
- ((:color amaranth :quit-key "q")
- ("emms"
- (("p" emms-start "Play/Pause")
- ("s" emms-stop "Stop")
- ("i" emms-show "Info")
- )
- )
- )
- )
-
- (use-package! emacs
- :bind (:map global-map
- ("s-." . emacs-hydra/body))
- :config
- (defun leo/music-play (url title album)
- (setq podcast-hard-link (car (car org-stored-links)))
- (message podcast-hard-link)
- (do-applescript
- (format "
- tell application \"Music\"
- open location \"%s\"
- play
- set name of current track to \"%s\"
- set album of current track to \"%s\"
- end tell" url title album)))
-
- (defun leo/music-visual-scrubber ()
- "Show a graphical representation of the player progress bar."
- (interactive)
- (dotimes (i 5)
- (message (do-applescript
- "tell application \"Music\"
- set player_pos to get player position
- set player_dur to get duration of current track
- set player_time to get time of current track
- set get_seconds to round (player_pos) mod 60
- set get_minutes to round (player_pos) / 60
- set get_hours to round (player_pos) / (60 * 60)
- set pad_seconds to text -2 thru -1 of (\"00\" & get_seconds)
- set pad_minutes to text -2 thru -1 of (\"00\" & get_minutes)
- set pad_hours to text -2 thru -1 of (\"00\" & get_hours)
- set current_pos to pad_hours & \":\" & pad_minutes & \":\" & pad_seconds
- set final_pos to text -1 thru -8 of (\"00000000\" & player_time)
- set perc to player_pos / player_dur
- set bar_length to 40
- set done to round (bar_length * perc)
- if done is 0 then set done to 1
- set progress_completed to text 1 thru done of (\"\")
- set total_progress to text 1 thru bar_length of (progress_completed & \"\")
- set total_progress to \"\" & total_progress & \"\"
- set right_aligned_final_pos to text -1 thru -(bar_length - 8 + 2) of (\" \" & final_pos)
- set total_progress to total_progress & \"
- \" & current_pos & right_aligned_final_pos
- end tell"))
- (sit-for 1)
- )
- (message "")
- )
-
- ;;
- ;;01:34:37 01:21:27
- ;;
- ;;00000
-
-
- (defun leo/music-get-info ()
- (interactive)
- (do-applescript "tell application \"Music\"
- set myName to get name of current track
- set myAlbum to get album of current track
- myName & \" - \" & myAlbum
- end tell"))
-
- (defun leo/music-playpause ()
- (interactive)
- (do-applescript
- (format "tell application \"Music\" to playpause")))
-
- (defun leo/music-skip-forward-30 ()
- (interactive)
- (do-applescript
- (format "tell application \"Music\" to set player position to (player position + 30)")))
-
- (defun leo/music-skip-backward-10 ()
- (interactive)
- (do-applescript
- (format "tell application \"Music\" to set player position to (player position - 10)")))
-
- (defun leo/play-podcast-in-music-app ()
- "When in an elfeed-entry buffer, open mp3 url in Music.app on macos."
- (interactive)
- (org-store-link nil nil)
- (when (not (string= (buffer-name) "*elfeed-entry*"))
- (error "Not in an elfeed entry buffer"))
-
- (let (
- (url (car (car (elfeed-entry-enclosures elfeed-show-entry))))
- (title (elfeed-entry-title elfeed-show-entry))
- (podcast (elfeed-feed-title (elfeed-entry-feed elfeed-show-entry)))
- )
- (leo/music-play url title podcast)
- ))
- (defun leo/music-open-show-notes ()
- (interactive)
- (org-link-open-from-string podcast-hard-link)
- (elfeed-show-refresh--mail-style)
- )
-
- :pretty-hydra
- ((:title (pretty-hydra-title (leo/music-get-info) 'faicon "headphones" :face 'all-the-icons-purple :height 1.1 :v-adjust -0.05)
- :color amaranth
- :quit-key ("q" "C-g" "s-."))
- ("Scrub"
- (
- ("j" leo/music-skip-backward-10 "back 10 sec")
- ("l" leo/music-skip-forward-30 "forward 30 sec")
- ("v" leo/music-visual-scrubber "view scrubber")
- )
- "Controls"
- (
- ("p" leo/music-playpause "play/pause" :color blue)
- ("SPC" leo/music-playpause "play/pause" :color blue) ;; [[elfeed:feeds.fireside.fm#e27c3bf8-55cd-47fa-9a14-4eb93d6dc632][475: I Do Declare]]
- )
- "Other"
- (
- ("s" leo/music-open-show-notes "show notes" :color blue)
- ("b" elfeed "browse" :color blue)
- )
- ))
- )
-
-
- (use-package! elfeed
- :after hydra
- :bind (:map elfeed-search-mode-map
- ("?" . elfeed-hydra/body))
- :config
- (load! "setup-elfeed.el")
- (setq elfeed-show-refresh-function 'elfeed-show-refresh--mail-style)
- :init
- (defun elfeed-search-clear () (interactive) (setq elfeed-search-filter "") (elfeed-search-update :force))
- (defun elfeed-search-emacs () (interactive) (setq elfeed-search-filter "+emacs") (elfeed-search-update :force))
- (defun elfeed-search-tesla () (interactive) (setq elfeed-search-filter "+tesla") (elfeed-search-update :force))
- (defun elfeed-search-podcast () (interactive) (setq elfeed-search-filter "+podcast") (elfeed-search-update :force))
- (defun elfeed-search-video () (interactive) (setq elfeed-search-filter "+youtube") (elfeed-search-update :force))
-
- (defun elfeed-search-toggle-unread ()
- (interactive)
- (let ((filter elfeed-search-filter))
- (if (s-contains-p "+unread" filter)
- (setq elfeed-search-filter (s-trim (s-replace "+unread" "" filter)))
- (setq elfeed-search-filter (concat filter " +unread"))))
- (elfeed-search-update :force)
- )
-
- (defun elfeed-search-toggle (term)
- "Accepts a TERM and returns a function that toggles TERM in the `elfeed' filter."
- (interactive "Mtag: ")
- (let ((filter elfeed-search-filter))
- (if (s-contains-p term filter)
- (setq elfeed-search-filter (s-trim (s-replace term "" filter)))
- (setq elfeed-search-filter (concat filter " " term))))
- (elfeed-search-update :force))
-
- :pretty-hydra
- ((:title (pretty-hydra-title "Elfeed" 'faicon "rss-square" :face 'all-the-icons-orange :height 1.1 :v-adjust -0.05)
- :color amaranth
- :quit-key ("q" "C-g" "s-."))
- ("Search"
- (("c" elfeed-db-compact "compact db")
- ("g" elfeed-search-update--force "refresh")
- ("G" elfeed-search-fetch "update")
- ("y" elfeed-search-yank "copy URL")
- ("+" elfeed-search-tag-all "tag all")
- ("-" elfeed-search-untag-all "untag all"))
- "Filter"
- (("/" elfeed-search-live-filter "live filter")
- ("f" (elfeed-search-set-filter "@6-months-ago +f") "favorites")
- ("c" (elfeed-search-set-filter "@6-months-ago") "clear search")
- ("t" (elfeed-search-set-filter "@1-day-ago") "today"))
- "Search Toggles"
- (
- ("se" (elfeed-search-toggle "+emacs") "emacs")
- ("st" (elfeed-search-toggle "+tesla") "tesla")
- ("sp" (elfeed-search-toggle "+podcast") "podcasts")
- ("sj" (elfeed-search-toggle "+jb") "jb")
- ("sy" (elfeed-search-toggle "+youtube") "youtube")
- ("sl" (elfeed-search-toggle "+linux") "linux")
- )
- "Media"
- (
- ("P" leo/play-podcast-in-music-app "Play Media")
- ("A" elfeed-show-add-enclosure-to-playlist "Add to playlist")
- )
- "Article"
- (("b" elfeed-search-browse-url "browse")
- ("n" next-line "next")
- ("p" previous-line "previous")
- ("u" elfeed-search-tag-all-unread "mark unread")
- ("r" elfeed-search-untag-all-unread "mark read")
- ("RET" elfeed-search-show-entry "show"))))
- )
-
- (after! xref
- (add-to-list '+lookup-provider-url-alist '("Melpa" "https://melpa.org/#/?q=%s"))
- (add-to-list '+lookup-provider-url-alist '("GitHub - LifeOmic" "https://github.com/search?q=user:LifeOmic+%s"))
- (add-to-list '+lookup-provider-url-alist '("Nix Packages" "https://search.nixos.org/packages?channel=22.05&from=0&size=50&sort=relevance&type=packages&query=%s"))
- (add-to-list '+lookup-provider-url-alist '("Home Manager" "https://mipmip.github.io/home-manager-option-search/?%s"))
- (add-to-list '+lookup-provider-url-alist '("Github - Nix Darwin" "https://github.com/LnL7/nix-darwin/search?q=%s"))
- )
-
- (after! world-clock
- ;; Seattle 13:27 PDT
- ;; New York 16:27 EDT
- ;; London 21:27 BST
- ;; Paris 22:27 CEST
- ;; Bangalore 01:57 IST
- ;; Tokyo 05:27 JST
- :config
- (setq world-clock-time-format "%I:%M %p")
- (setq world-clock-list '(
- ("+7:00" "Pacific")
- ("+5:00" "Central")
- ("+4:00" "Eastern")
- ("-1:00" "London")
- ("-5:30" "India")
- ))
- )
-
- ;;;;;;;;;;;
- ;; HOOKS ;;
- ;;;;;;;;;;;
- (add-hook 'text-mode-hook 'leo/remove-dos-eol) ;; Don't show `^M' at the end of lines
- (add-hook 'prog-mode-hook 'leo/remove-dos-eol) ;; same, but for prog modes
-
-
- ;;;;;;;;;;;;;;;;;
- ;; KEYBINDINGS ;;
- ;;;;;;;;;;;;;;;;;
- (map! :map global-map
- :prefix "C-x"
- "C-l" nil
- (:prefix ("C-l" . "Levi's Leader")
- "a" #'org-agenda
- "e" #'elfeed
- "m" #'emms-browser
- "g" #'magit-status
- "w" #'world-clock
- ))
-
- (map! :map org-mode-map
- :localleader
- "t" nil
- (:prefix ("t" . "tables")
-
- :desc "Insert row seperator below point"
- "-" #'org-table-hline-and-move
-
- :desc "Align Column Separators"
- "a" #'org-table-align
-
- :desc "Blank current field"
- "b" #'org-table-blank-field
-
- :desc "Create or Convert"
- "c" #'org-table-create-or-convert-from-region
-
- (:prefix ("d" . "delete")
- :desc "Column"
- "c" #'org-table-delete-column
- :desc "Row"
- "r" #'org-table-kill-row)
-
- :desc "Edit Field"
- "e" #'org-table-edit-field
-
- :desc "Edit Formula"
- "f" #'org-table-edit-formulas
-
- :desc "Help Show Field Info"
- "h" #'org-table-field-info
-
- (:prefix ("i" . "insert")
- :desc "Insert Column"
- "c" #'org-table-insert-column
- :desc "Insert Row"
- "r" #'org-table-insert-row
- )
-
- :desc "Recalculate This Table"
- "r" #'org-table-recalculate
-
- :desc "Recalculate All Buffer Tables"
- "R" #'org-table-recalculate-buffer-tables
-
- :desc "Sort by"
- "s" #'org-table-sort-lines
-
- (:prefix ("t" . "toggle")
- :desc "Toggle Formulas"
- "f" #'org-table-toggle-formula-debugger
- :desc "Toggle Coordinates"
- "c" #'org-table-toggle-coordinate-overlays
- )
- )
- )
-
- (map! :map comint-mode-map
- "q" '(lambda()
- (interactive)
- (if (s-contains? "sfdx" (buffer-name))
- (progn
- (leo/kill-this-buffer-unless-scratch)
- (+workspace/close-window-or-workspace)
- ))))
-
- (map! :map xwidget-webkit-mode-map
- "C-i" 'xwidget-webkit-insert-string
- "C-m" 'xwidget-webkit-insert-string
- "C-s" 'isearch-forward
- "M-w" 'xwidget-webkit-copy-selection-as-kill
- "C-w" 'xwidget-webkit-copy-selection-as-kill
-
- "o" 'xwidget-webkit-goto-url
- "C-l" 'xwidget-webkit-goto-url
-
- "n" 'xwidget-webkit-scroll-up
- "p" 'xwidget-webkit-scroll-down
-
- "C-y" 'yank
- )
-
- (defun leo/search-lifeomic-repos()
- "Search for LifeOmic Repo"
- (interactive)
- (setq query (read-string (format "Search for repository (in %s): " "LifeOmic")))
- (funcall +lookup-open-url-fn (format "https://github.com/search?q=user:LifeOmic+%s" (url-encode-url query)))
- )
-
- (use-package! vs-restclient
- :bind (:map vs-restclient-mode-map
- ("C-c C-c" . 'vs-restclient-http-send-current-stay-in-window)))
-
- (use-package! vs-restclient-jq
- :after vs-restclient
- :config
- (vs-restclient-register-result-func
- "jq-set-var" #'vs-restclient-jq-json-var-function
- "Set a vs-restclient variable with the value jq expression,
- takes var & jq expression as args.
- eg. -> jq-set-var :my-token .token")
- (define-key vs-restclient-response-mode-map (kbd "C-c C-j") #'vs-restclient-jq-interactive-result)
- )
-
- (map! :map global-map
- "M-t" #'treemacs-select-window
- "M-q" #'leo/kill-this-buffer-unless-scratch
- "s-w" #'leo/kill-this-buffer-unless-scratch
- "M-RET" #'eshell
-
- :desc "Format Document or Region"
- "C-<tab>" #'leo/tidy
- :desc "Comment or Uncomment Line or Region"
- "C-;" #'leo/comment-or-uncomment-region-or-line
- :desc "Open Private Doom Config"
- "C-c C-e" #'leo/edit-config
- "C-c d" #'leo/duplicate-thing
- "C-c g" #'magit-status
- "s-g" #'magit-status
- "M-n" #'leo/jump-to-next-symbol
- "M-p" #'leo/jump-to-prev-symbol
- "M-u" #'upcase-dwim
- "M-c" #'capitalize-dwim
- "M-l" #'downcase-dwim
-
- :desc "Search LifeOmic Repos"
- "C-c s g" #'leo/search-lifeomic-repos
-
- ;; Perspective.el
- "C-c C-n" #'persp-next
- "C-c C-p" #'persp-prev
- "C-c C-r" #'persp-rename
- "C-c C-l" #'persp-switch
- "C-c C-s" #'persp-switch
- "C-c b" #'+ivy/switch-workspace-buffer
- "s-b" #'+ivy/switch-workspace-buffer
-
- ;; "C-c b" #'counsel-switch-buffer
- "C-s" #'swiper
-
- "C-}" #'mc/mark-next-like-this
- "C-)" #'mc/unmark-next-like-this
- "C-{" #'mc/mark-previous-like-this
- "C-(" #'mc/unmark-previous-like-this
-
- "C-M-}" #'mc/mark-next-like-this-word
- "C-M-)" #'mc/unmark-next-like-this
- "C-M-{" #'mc/mark-previous-like-this-word
- "C-M-(" #'mc/unmark-previous-like-this
-
- "C-@" #'er/expand-region
- "C-#" #'er/contract-region
-
- )
|