diff --git a/config.el b/config.el index 10f667d..54768ff 100644 --- a/config.el +++ b/config.el @@ -21,20 +21,33 @@ ;; (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" :size 20 :weight 'regular) - doom-variable-pitch-font (font-spec :family "PragmataPro" :size 20) - doom-unicode-font (font-spec :family "PragmataPro" :size 20)) +(setq doom-font (font-spec :family "PragmataPro" :size 20 :weight 'regular) + doom-big-font (font-spec :family "PragmataPro" :size 30 :weight 'regular) + ;; doom-variable-pitch-font (font-spec :family "PragmataPro" :size 20) + doom-variable-pitch-font (font-spec :family "Overpass" :size 20 :weight 'thin) + doom-unicode-font (font-spec :family "PragmataPro" :size 20) + 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) +(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 45) ;; 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-" #'next-buffer + :g "s-" #'previous-buffer) + ;; 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) @@ -82,33 +95,95 @@ ;; 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) -(load! "setup-elfeed.el") -(use-package! setup-elfeed) +;; (load! "setup-elfeed.el") +;; (use-package! setup-elfeed) -(after! company - ;; (set-company-backend! 'prog-mode nil) - (set-company-backend! 'typescript-mode '(:separate 'company-tabnine 'company-capf 'company-yasnippet)) - ;; (setq company-backends '(company-tabnine company-capf)) - ) +;; (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 (use-package company-tabnine - :after company :ensure t :config - ;; Tabnine::config ;; to open the config - ;; Tabnine::config_dir ;; /Users/leviolson/Library/Preferences/TabNine + (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) + (setq company-idle-delay 0.2) ;; Number the candidates (use M-1, M-2 etc to select completions). - (setq company-show-numbers t) - - ;; (setq company-backends '(company-tabnine company-capf)) - ) + (setq company-show-quick-access nil)) (use-package! darkroom :commands darkroom-mode @@ -136,8 +211,6 @@ (defvar org-html-text-markup-alist) (defvar org-capture-templates) :init - (setq org-ellipsis " ▾" - org-hide-emphasis-markers t) (setq org-agenda-files (list (concat org-directory "/todo.org") (concat org-directory "/projects.org") (concat org-directory "/Recipies.org") @@ -163,21 +236,23 @@ (sequence "PLAN(p)" "SPIKE(s)" "ACTIVE(a)" "WAIT(w@/!)" "HOLD(h)" "|" "DONE(d!)" "CANCELLED(c@)") )) :config + (require 'org-protocol) (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 - '(("t" "new task" entry (file+headline (concat org-directory "/todo.org") "Tasks") + '(("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 (concat org-directory "/todo.org") "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") - ("d" "store link w/drawer" entry (file+olp org-default-notes-file "Links" "Unfiled") - "* %?\n%l\n:COPIED_TEXT:\n %i\n:END:\n") )) (setq org-structure-template-alist '(("r" . "src restclient :results raw") @@ -219,9 +294,6 @@ (use-package org-roam :disabled t - :ensure t - :hook - (after-init . org-roam-mode) :custom (org-roam-directory (concat org-directory "/Roam/")) (org-roam-link-title-format "r::%s") @@ -234,7 +306,6 @@ (("C-c n I" . org-roam-insert-immediate)))) (use-package! deft - :after org :bind ("C-c n d" . deft) :config @@ -244,16 +315,6 @@ deft-directory (concat org-directory "/Roam/") deft-recursive-ignore-dir-regexp "\\(?:\\.\\|\\.\\.\\|setup\\)$")) -(use-package! org-journal - :disabled t - :after org - :config - (setq org-journal-date-prefix "#+TITLE: " - org-journal-time-prefix "* " - org-journal-date-format "%a, %Y-%m-%d" - org-journal-file-format "%Y-%m-%d.org" - )) - (use-package! org-pandoc-import :after org :commands (org-pandoc-import-html-as-org org-pandoc-import-html-to-org) @@ -263,7 +324,7 @@ (use-package! lsp-mode :config - (setq +lsp-company-backends '(:separate company-tabnine company-yasnippet company-capf)) + (setq +lsp-company-backends '(:separate company-tabnine company-lsp company-yasnippet company-capf)) (setq lsp-enable-symbol-highlighting nil lsp-headerline-breadcrumb-enable t)) @@ -288,6 +349,49 @@ :custom (dired-omit-files nil)) +(use-package! hydra + :ensure t) + +(use-package! elfeed + :after hydra + :bind (:map elfeed-search-mode-map + ("a" . elfeed-search-clear) + ("e" . elfeed-search-emacs) + ("E" . (lambda () (interactive) (elfeed-search-toggle "+emacs"))) + ("t" . elfeed-search-tesla) + ("T" . (lambda () (interactive) (elfeed-search-toggle "+tesla"))) + ("y" . elfeed-search-video) + ("Y" . (lambda () (interactive) (elfeed-search-toggle "+youtube"))) + ("v" . elfeed-search-browse-url) + ("o" . elfeed-search-show-entry) + ("g" . elfeed-search-fetch) + ("U" . elfeed-search-toggle-unread) + ) + :config + (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-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) + ) + ) + (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"))) @@ -408,6 +512,11 @@ "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 diff --git a/custom.el b/custom.el index e348fed..8ea98d6 100644 --- a/custom.el +++ b/custom.el @@ -4,7 +4,8 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(company-backends '(company-tabnine company-capf)) - '(package-selected-packages '(company-box))) + '(magit-delta-default-dark-theme "Colddark-Cold") + '(package-selected-packages '(info-colors company-box))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. @@ -12,3 +13,4 @@ ;; If there is more than one, they won't work right. ) (put 'upcase-region 'disabled nil) +(put 'narrow-to-region 'disabled nil) diff --git a/init.el b/init.el index e4d45d3..af51f1f 100644 --- a/init.el +++ b/init.el @@ -33,26 +33,26 @@ ;;(emoji ;; +unicode ;; +ascii - ;; +github) ; 🙂 + ;; +github) ;) 🙂 ;;fill-column ; a `fill-column' indicator hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW - ;; hydra + hydra ;;indent-guides ; highlighted indent columns - (ligatures +iosevka) ; ligatures and symbols to make your code pretty again + (ligatures) ; ligatures and symbols to make your code pretty again minimap ; show a map of the code on the side modeline ; snazzy, Atom-inspired modeline, plus API ;;nav-flash ; blink cursor line after big motions ;;neotree ; a project drawer, like NERDTree for vim ophints ; highlight the region an operation acts on - (popup +defaults) ; tame sudden yet inevitable temporary windows + (popup +all +defaults) ; tame sudden yet inevitable temporary windows ;; tabs ; a tab bar for Emacs (treemacs +lsp) ; a project drawer, like neotree but cooler ;;unicode ; extended unicode support for various languages vc-gutter ; vcs diff in the fringe vi-tilde-fringe ; fringe tildes to mark beyond EOB - ;;window-select ; visually switch windows + (window-select +switch-window) ; visually switch windows workspaces ; tab emulation, persistence & separate workspaces - ;;zen ; distraction-free coding or writing + zen ; distraction-free coding or writing :editor ;(evil +everywhere); come to the dark side, we have cookies @@ -72,7 +72,7 @@ (dired +icons) ; making dired pretty [functional] electric ; smarter, keyword-based electric-indent (ibuffer +icons) ; interactive buffer management - undo ; persistent, smarter undo for your inevitable mistakes + (undo +tree) ; persistent, smarter undo for your inevitable mistakes vc ; version-control and Emacs, sitting in a tree :term @@ -88,21 +88,21 @@ :tools ;;ansible - ;; debugger ; FIXME stepping through code, to help you add bugs + debugger ; FIXME stepping through code, to help you add bugs ;;direnv (docker +lsp) ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists - lookup ; navigate your code and its documentation + (lookup +dictionary) ; navigate your code and its documentation (lsp +peek) (magit +forge) ; a git porcelain for Emacs - ;;make ; run make tasks from Emacs + make ; run make tasks from Emacs ;;pass ; password manager for nerds - ;;pdf ; pdf enhancements + pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders - ;;rgb ; creating color strings + rgb ; creating color strings taskrunner ; taskrunner for all your projects terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux @@ -110,7 +110,7 @@ :os (:if IS-MAC macos) ; improve compatibility with macOS - ;;tty ; improve the terminal Emacs experience + tty ; improve the terminal Emacs experience :lang ;;agda ; types of types of types of types... @@ -151,6 +151,7 @@ ;;ocaml ; an objective camel (org +pretty + +dragndrop +roam) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more @@ -180,8 +181,9 @@ :app calendar + everywhere ;;irc ; how neckbeards socialize - ;;(rss +org) ; emacs as an RSS reader + (rss +org) ; emacs as an RSS reader ;;twitter ; twitter client https://twitter.com/vnought :config diff --git a/packages.el b/packages.el index 33ee66b..5f1a837 100644 --- a/packages.el +++ b/packages.el @@ -57,7 +57,7 @@ ;; ENABLE (package! lsp-treemacs) -(package! elfeed) +;; (package! elfeed) (package! darkroom) (package! graphql-mode) @@ -66,5 +66,11 @@ (package! jq-mode) +(package! magit-delta + :recipe (:host github :repo "dandavison/magit-delta")) + +(package! elfeed-goodies + :recipe (:host github :repo "algernon/elfeed-goodies")) + (package! vs-restclient :recipe (:host github :repo "leothelocust/vs-restclient.el")) diff --git a/setup-elfeed.el b/setup-elfeed.el index 30e3e7f..2c6c0f2 100644 --- a/setup-elfeed.el +++ b/setup-elfeed.el @@ -2,12 +2,12 @@ (map! ;; "C-x C-l e" to launch is defined in =config.el= - :map elfeed-search-mode-map - "a" #'(lambda () (interactive) (elfeed-search-set-filter "")) - "e" #'(lambda () (interactive) (elfeed-search-set-filter "+emacs")) - "x" #'(lambda () (interactive) (elfeed-search-set-filter "xkcd")) - "v" #'(lambda () (interactive) (elfeed-search-set-filter "+youtube")) - "=" #'elfeed-search-set-filter) + :map elfeed-search-mode-map + "a" #'(lambda () (interactive) (elfeed-search-set-filter "")) + "e" #'(lambda () (interactive) (elfeed-search-set-filter "+emacs")) + "x" #'(lambda () (interactive) (elfeed-search-set-filter "xkcd")) + "v" #'(lambda () (interactive) (elfeed-search-set-filter "+youtube")) + "=" #'elfeed-search-set-filter) (use-package! elfeed :init @@ -62,4 +62,11 @@ (define-key elfeed-search-mode-map (kbd "d") 'elfeed-youtube-dl) (elfeed-update)) + + +(use-package! elfeed-goodies + :ensure t + :config + (elfeed-goodies/setup)) + (provide 'setup-elfeed)