Added lots, links for everything, add snippets plugin, run formatter

This commit is contained in:
James Dixon 2025-05-15 01:28:55 -04:00
parent c958e2c406
commit f84d424908

View File

@ -149,7 +149,7 @@
(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode) (add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
;;; Custom Tab Settings ;;; Custom Tab Settings
; START TABS CONFIG from https://dougie.io/emacs/indentation/ ;; https://dougie.io/emacs/indentation/
;; Create a variable for our preferred tab width ;; Create a variable for our preferred tab width
(setq custom-tab-width 2) (setq custom-tab-width 2)
(setq default-tab-width 4) (setq default-tab-width 4)
@ -208,11 +208,15 @@
(shell-command (concat "start " (expand-file-name default-directory))) (shell-command (concat "start " (expand-file-name default-directory)))
(error "No `default-directory' to open"))) (error "No `default-directory' to open")))
(defun insert-current-time ()
"Insert the current time H:M:S."
(insert (format-time-string "%H:%M:%S")))
(defun insert-current-iso-date () (defun insert-current-iso-date ()
"Insert the current ISO 8601 date." "Insert the current ISO 8601 date."
(insert (format-time-string "%Y-%m-%d"))) (insert (format-time-string "%Y-%m-%d")))
(defun insert-current-iso-date-seconds() (defun insert-current-iso-date-time()
"Insert the current ISO 8601 date (with time res of seconds)." "Insert the current ISO 8601 date (with time res of seconds)."
(insert (format-time-string "%Y-%m-%d %H:%M:%S"))) (insert (format-time-string "%Y-%m-%d %H:%M:%S")))
@ -228,8 +232,17 @@
(if mark-active (list (region-beginning) (region-end)) (if mark-active (list (region-beginning) (region-end))
(list (save-excursion (backward-word 1) (point)) (point))))) (list (save-excursion (backward-word 1) (point)) (point)))))
;;; Basic way to do pulse for evil yank text (like goggles.el package)
;;; https://blog.meain.io/2020/emacs-highlight-yanked/
(defun hl-yank-advice (yank-fn beg end &rest args)
"Give advice to YANK-FN BEG END ARGS for temp highlighting of region."
(pulse-momentary-highlight-region beg end)
(apply yank-fn beg end args))
(advice-add 'evil-yank :around 'hl-yank-advice)
;;; * "Sensible Defaults" ends here * ;;; * "Sensible Defaults" ends here *
;;; ** Start Package Manager (straight.el) ** ;;; ** Start Package Manager (straight.el) **
;; https://github.com/radian-software/straight.el
;; bootstrap straight.el package manager ;; bootstrap straight.el package manager
(defvar bootstrap-version) (defvar bootstrap-version)
(let ((bootstrap-file (let ((bootstrap-file
@ -255,7 +268,9 @@
(when (memq window-system '(mac ns x)) (when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize)) (exec-path-from-shell-initialize))
;;; EVIL Config (evil-mode) ;;; EVIL Config :: Vi/Vim Emulation++ (evil-mode)
;;; Evil Package
;; https://github.com/emacs-evil/evil
(use-package evil (use-package evil
:straight t :straight t
:init :init
@ -268,15 +283,21 @@
(setq evil-disable-insert-state-bindings t) (setq evil-disable-insert-state-bindings t)
(setq evil-insert-state-cursor '(box "violet") (setq evil-insert-state-cursor '(box "violet")
evil-normal-state-cursor '(box "yellow") evil-normal-state-cursor '(box "yellow")
evil-visual-state-cursor '(box "#1aa5db")) evil-visual-state-cursor '(hollow "#1aa5db"))
(setq evil-want-keybinding nil) (setq evil-want-keybinding nil)
(setq evil-want-integration t) (setq evil-want-integration t)
:config :config
(evil-mode 1)) (evil-mode 1))
;;; Undo Nicities
;; https://github.com/emacsmirror/undo-fu
(use-package undo-fu (use-package undo-fu
:straight t) :straight t)
;;; TODO: Look into https://codeberg.org/ideasman42/emacs-undo-fu-session
;;; Make Evil work in more modes than by default
;; https://github.com/emacs-evil/evil-collection
(use-package evil-collection (use-package evil-collection
:straight t :straight t
:after evil :after evil
@ -284,22 +305,34 @@
:init :init
(evil-collection-init)) (evil-collection-init))
;;; Bindings and functionality to comment out code and other text objects
;; https://github.com/linktohack/evil-commentary
(use-package evil-commentary (use-package evil-commentary
:straight t :straight t
:after evil :after evil
:init :init
(evil-commentary-mode)) (evil-commentary-mode))
;;; Bindings to surround text objects.
;; https://github.com/emacs-evil/evil-surround
(use-package evil-surround (use-package evil-surround
:straight t :straight t
:after evil :after evil
:config :config
(global-evil-surround-mode 1)) (global-evil-surround-mode 1))
;;; Vim like increment and decrement of numbers
;; https://github.com/cofi/evil-numbers
(use-package evil-numbers (use-package evil-numbers
:straight t :straight t
:after evil) :after evil)
(evil-define-key '(normal visual) 'global (kbd "C-a +") 'evil-numbers/inc-at-pt)
(evil-define-key '(normal visual) 'global (kbd "C-a -") 'evil-numbers/dec-at-pt)
(evil-define-key '(normal visual) 'global (kbd "C-a C-+") 'evil-numbers/inc-at-pt-incremental)
(evil-define-key '(normal visual) 'global (kbd "C-a C--") 'evil-numbers/dec-at-pt-incremental)
;;; Org mode Evil bindings
;; https://github.com/Somelauw/evil-org-mode
(use-package evil-org (use-package evil-org
:straight t :straight t
:hook (org-mode . evil-org-mode) :hook (org-mode . evil-org-mode)
@ -308,29 +341,13 @@
(require 'evil-org-agenda) (require 'evil-org-agenda)
(evil-org-agenda-set-keys)) (evil-org-agenda-set-keys))
;;; Markdown mode Evil bindings
;; https://github.com/Somelauw/evil-markdown
(use-package evil-markdown (use-package evil-markdown
:straight `(el-patch :type git :host github :repo "Somelauw/evil-markdown") :straight `(el-patch :type git :host github :repo "Somelauw/evil-markdown")
:after evil) :after evil)
;; Custom Evil Keybinds
;;; Evil customizations ;;; Evil keybinds
;;; Basic way to do pulse for evil yank text (like goggles.el package)
;;; https://blog.meain.io/2020/emacs-highlight-yanked/
(defun hl-yank-advice (yank-fn beg end &rest args)
"Give advice to YANK-FN BEG END ARGS for temp highlighting of region."
(pulse-momentary-highlight-region beg end)
(apply yank-fn beg end args))
(advice-add 'evil-yank :around 'hl-yank-advice)
;;; evil-numbers keybinds
(evil-define-key '(normal visual) 'global (kbd "C-a +") 'evil-numbers/inc-at-pt)
(evil-define-key '(normal visual) 'global (kbd "C-a -") 'evil-numbers/dec-at-pt)
(evil-define-key '(normal visual) 'global (kbd "C-a C-+") 'evil-numbers/inc-at-pt-incremental)
(evil-define-key '(normal visual) 'global (kbd "C-a C--") 'evil-numbers/dec-at-pt-incremental)
;;; general keybinds
(evil-set-leader nil (kbd "SPC")) (evil-set-leader nil (kbd "SPC"))
(evil-define-key 'normal 'global (kbd "<leader> :") 'execute-extended-command) (evil-define-key 'normal 'global (kbd "<leader> :") 'execute-extended-command)
(evil-define-key 'normal 'global (kbd "<leader> e") 'eval-last-sexp) (evil-define-key 'normal 'global (kbd "<leader> e") 'eval-last-sexp)
@ -343,13 +360,14 @@
(evil-define-key 'normal 'global (kbd "<leader> k") 'kill-buffer) (evil-define-key 'normal 'global (kbd "<leader> k") 'kill-buffer)
(evil-define-key 'normal 'global (kbd "<leader> f") 'ffap) (evil-define-key 'normal 'global (kbd "<leader> f") 'ffap)
(evil-define-key 'normal 'global (kbd "<leader> F") 'find-file) (evil-define-key 'normal 'global (kbd "<leader> F") 'find-file)
(evil-define-key 'normal 'global (kbd "<leader> d") 'dired) (evil-define-key 'normal 'global (kbd "<leader> d") 'evil-delete-buffer)
(evil-define-key 'normal 'global (kbd "<leader> K") 'dired-jump) (evil-define-key 'normal 'global (kbd "<leader> K") 'dired-jump)
(evil-define-key 'normal 'global (kbd "<leader> o") 'occur) (evil-define-key 'normal 'global (kbd "<leader> o") 'occur)
(evil-define-key 'normal 'global (kbd "<leader> B") 'bookmark-jump) (evil-define-key 'normal 'global (kbd "<leader> B") 'bookmark-jump)
(evil-define-key 'normal 'global (kbd "<leader> g") 'magit-status) (evil-define-key 'normal 'global (kbd "<leader> g") 'magit-status)
(evil-define-key 'normal 'global (kbd "<leader> r") 'replace-regexp) (evil-define-key 'normal 'global (kbd "<leader> r") 'replace-regexp)
(evil-define-key 'normal 'global (kbd "<leader> R") 'recentf) (evil-define-key 'normal 'global (kbd "<leader> R") 'recentf)
(evil-define-key 'normal 'global (kbd "<leader> P") 'yank-from-kill-ring)
(evil-define-key 'normal 'global (kbd "<leader> x") ctl-x-map) (evil-define-key 'normal 'global (kbd "<leader> x") ctl-x-map)
(evil-define-key 'normal 'global (kbd "<leader> O") 'ext-file-browser-in-workdir) (evil-define-key 'normal 'global (kbd "<leader> O") 'ext-file-browser-in-workdir)
(evil-define-key 'normal 'global (kbd "<leader> T") 'ext-terminal-in-workdir) (evil-define-key 'normal 'global (kbd "<leader> T") 'ext-terminal-in-workdir)
@ -357,19 +375,37 @@
(evil-define-key 'normal 'global (kbd "C-c i") (lambda () (interactive) (find-file user-init-file))) (evil-define-key 'normal 'global (kbd "C-c i") (lambda () (interactive) (find-file user-init-file)))
;; end evil ;; end evil
;; Easy find init file ;;; Easy find init file
(set-register ?i (cons 'file user-init-file)) (set-register ?i (cons 'file user-init-file))
;;; Writing Org / Markdown / HTML (org-mode, markdown-mode) ;;; Vanilla+ Packages (dired, magit, org-mode)
;; Dired (directory editor)
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html
(use-package dired
:straight nil
:commands (dired dired-jump)
:config
(setq dired-dwim-target t))
;; Magit (git interface)
;; https://magit.vc/
(use-package magit
:straight t)
;; Org mode
;; https://orgmode.org/
(use-package org (use-package org
:straight nil) :straight nil)
'(org-export-backends '(ascii html icalendar latex man md odt org))
;; TODO: setup org more
(global-set-key (kbd "C-c a") #'org-agenda) (global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c c") #'org-capture) (global-set-key (kbd "C-c c") #'org-capture)
'(org-export-backends '(ascii html icalendar latex man md odt org)) (evil-define-key 'normal org-mode-map
(kbd "SPC TAB") 'org-todo
">" 'org-shiftmetaright
"<" 'org-shiftmetaleft)
;; better markdown ;;; Markdown support for emacs
;; https://github.com/jrblevin/markdown-mode
(use-package markdown-mode (use-package markdown-mode
:straight t :straight t
:mode ("README\\.md\\'" . gfm-mode) :mode ("README\\.md\\'" . gfm-mode)
@ -379,13 +415,14 @@
("C-c C-e" . markdown-do))) ("C-c C-e" . markdown-do)))
;;; Themes and Colors (doom-themes, hl-todo, rainbow-mode, rainbow-delimiters) ;;; Themes and Colors (doom-themes, hl-todo, rainbow-mode, rainbow-delimiters)
;; https://github.com/doomemacs/themes
(use-package doom-themes (use-package doom-themes
:straight t :straight t
:config :config
(load-theme 'doom-ir-black t)) (load-theme 'doom-ir-black t))
; TODO: look into todo integrations ;; Highlights TODOs and other configured keywords in buffer
; https://github.com/tarsius/hl-todo?tab=readme-ov-file#integrations ;; https://github.com/tarsius/hl-todo
(use-package hl-todo (use-package hl-todo
:straight t :straight t
:hook (prog-mode . hl-todo-mode) :hook (prog-mode . hl-todo-mode)
@ -398,26 +435,36 @@
("REVIEW" font-lock-keyword-face bold) ("REVIEW" font-lock-keyword-face bold)
("NOTE" success bold) ("NOTE" success bold)
("DEPRECATED" font-lock-doc-face bold)))) ("DEPRECATED" font-lock-doc-face bold))))
; TODO: look into todo integrations
;; Makes yank/delete actions highlighted/pulsed
;; https://github.com/minad/goggles
(use-package goggles (use-package goggles
:straight t :straight t
:hook ((prog-mode text-mode) . goggles-mode) :hook ((prog-mode text-mode) . goggles-mode)
:config :config
(setq-default goggles-pulse t)) (setq-default goggles-pulse t))
;; Colorize color names in buffers
;; https://github.com/emacsmirror/rainbow-mode
(use-package rainbow-mode (use-package rainbow-mode
:straight t) :straight t)
;; Rainbow Delimiters - who doesn't love colors
;; https://github.com/Fanael/rainbow-delimiters
(use-package rainbow-delimiters (use-package rainbow-delimiters
:straight t :straight t
:init (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) :init (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
;; Git Gutter -- sidebar / fringe indicators of changes
;; https://github.com/emacsorphanage/git-gutter
(use-package git-gutter (use-package git-gutter
:hook (prog-mode . git-gutter-mode) :hook (prog-mode . git-gutter-mode)
:straight t :straight t
:config :config
(setq git-gutter:update-interval 0.2)) (setq git-gutter:update-interval 0.2))
;; https://github.com/emacsorphanage/git-gutter-fringe
(use-package git-gutter-fringe (use-package git-gutter-fringe
:straight t :straight t
:config :config
@ -425,22 +472,16 @@
(define-fringe-bitmap 'git-gutter-fr:modified [224] nil nil '(center repeated)) (define-fringe-bitmap 'git-gutter-fr:modified [224] nil nil '(center repeated))
(define-fringe-bitmap 'git-gutter-fr:deleted [128 192 224 240] nil nil 'bottom)) (define-fringe-bitmap 'git-gutter-fr:deleted [128 192 224 240] nil nil 'bottom))
;;; Vanilla+ Plugins (dired, magit) ;;; Mini-buffer improvements (vertico, orderless, marginalia)
(use-package dired
:straight nil
:commands (dired dired-jump)
:bind (("C-x C-j" . dired-jump)))
(setq dired-dwim-target t)
(use-package magit ;; Vertical Completion UI
:straight t) ;; https://github.com/minad/vertico
;;; Mini-buffer improvements (vertico, orderless, marginalia, embark, consult)
(use-package vertico (use-package vertico
:straight t :straight t
:init :init (vertico-mode))
(vertico-mode))
;; Ordering regex for completion
;; https://github.com/oantolin/orderless
(use-package orderless (use-package orderless
:straight t :straight t
:custom :custom
@ -448,6 +489,8 @@
(completion-category-defaults nil) (completion-category-defaults nil)
(completion-category-overrides '((file (styles partial-completion))))) (completion-category-overrides '((file (styles partial-completion)))))
;; Show docstrings and other useful info in minibuffer
;; https://github.com/minad/marginalia
(use-package marginalia (use-package marginalia
:straight t :straight t
:defer t :defer t
@ -455,12 +498,15 @@
:hook (after-init . marginalia-mode)) :hook (after-init . marginalia-mode))
;;; Better discoverability for key mappings (which-key) ;;; Better discoverability for key mappings (which-key)
;; https://github.com/justbur/emacs-which-key
;; builtin to emacs > 30.1
(use-package which-key (use-package which-key
:straight t :straight nil
:defer t :defer t
:init (which-key-mode)) :init (which-key-mode))
;;; Better help menus (helpful) ;;; Better help menus (helpful)
;; https://github.com/Wilfred/helpful
(use-package helpful (use-package helpful
:straight t :straight t
:bind :bind
@ -470,7 +516,8 @@
("C-h k" . helpful-key) ; Describe a key binding ("C-h k" . helpful-key) ; Describe a key binding
("C-h x" . helpful-command))) ; Describe a command ("C-h x" . helpful-command))) ; Describe a command
;;; Matching brackets with (electric-pair-mode) and (smartparens) ;;; Matching brackets and parens with (electric-pair-mode) and (smartparens)
;; https://github.com/Fuco1/smartparens
(use-package smartparens (use-package smartparens
:straight smartparens :straight smartparens
:hook (prog-mode text-mode markdown-mode) :hook (prog-mode text-mode markdown-mode)
@ -478,12 +525,16 @@
(require 'smartparens-config)) (require 'smartparens-config))
(electric-pair-mode 1) (electric-pair-mode 1)
;; Syntax checking
;; https://www.flycheck.org/en/latest/languages.html
;; https://github.com/flycheck/flycheck
(use-package flycheck (use-package flycheck
:straight t :straight t
:init (global-flycheck-mode)) :init (add-hook 'after-init-hook #'global-flycheck-mode))
;;; Completions in buffer (corfu and cape) ;;; Completions in buffer (corfu and cape)
;; Corfu Completion Framework ;; Corfu Completion At Point Framework (similar to company)
;; https://github.com/minad/corfu
(use-package corfu (use-package corfu
:straight t :straight t
:defer t :defer t
@ -492,49 +543,85 @@
(shell-mode . corfu-mode) (shell-mode . corfu-mode)
(eshell-mode . corfu-mode)) (eshell-mode . corfu-mode))
:custom :custom
(corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
(corfu-auto t)
(corfu-preview-current nil) ;; Disable current candidate preview
(corfu-preselect 'prompt) ;; Preselect the prompt
(corfu-auto-prefix 1) (corfu-auto-prefix 1)
(corfu-auto-delay 0.0) (corfu-auto-delay 0.2)
;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary
;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match
;; (corfu-on-exact-match nil) ;; Configure handling of exact matches
;; Hide commands in M-x which do not apply to the current mode. ;; Hide commands in M-x which do not apply to the current mode.
(read-extended-command-predicate #'command-completion-default-include-p) (read-extended-command-predicate #'command-completion-default-include-p)
;; Disable Ispell completion function. As an alternative try `cape-dict'. ;; Disable Ispell completion function. As an alternative try `cape-dict'.
(text-mode-ispell-word-completion nil) (text-mode-ispell-word-completion nil)
(tab-always-indent 'complete) (tab-always-indent 'complete)
;; Enable Corfu :init
:config (global-corfu-mode)
(global-corfu-mode)) (corfu-history-mode)
(corfu-popupinfo-mode))
;; Cape Competion ;; Cape Completion At Point Extensions
;; https://github.com/minad/cape
(use-package cape (use-package cape
:straight t :straight t
:defer t :defer t
:commands (cape-dabbrev cape-file cape-elisp-block) :commands (cape-dabbrev cape-file cape-elisp-block)
:bind ("C-c p" . cape-prefix-map) :bind ("C-c p" . cape-prefix-map)
:init :init
;; Add to the global default value of `completion-at-point-functions' which is (add-hook 'completion-at-point-functions #'cape-abbrev)
;; used by `completion-at-point'.
(add-hook 'completion-at-point-functions #'cape-dabbrev) (add-hook 'completion-at-point-functions #'cape-dabbrev)
(add-hook 'completion-at-point-functions #'cape-file) (add-hook 'completion-at-point-functions #'cape-file)
(add-hook 'completion-at-point-functions #'cape-elisp-block)) (add-hook 'completion-at-point-functions #'cape-elisp-block)
(add-hook 'completion-at-point-functions #'cape-emoji)
(add-hook 'completion-at-point-functions #'cape-dict))
;; Mode for working with emojis
;; https://github.com/iqbalansari/emacs-emojify
(use-package emojify
:straight t
:hook (after-init . global-emojify-mode))
;; Abbrevs and Snippets ;; Abbrevs and Snippets
;;; Abbrevs ;;; General English Abbrevs
(define-abbrev global-abbrev-table "bg" "background") (define-abbrev global-abbrev-table "bg" "background")
(define-abbrev global-abbrev-table "ty" "thank you") (define-abbrev global-abbrev-table "ty" "thank you")
(define-abbrev global-abbrev-table "yw" "you are welcome") (define-abbrev global-abbrev-table "yw" "you are welcome")
(define-abbrev global-abbrev-table "u" "you") (define-abbrev global-abbrev-table "u" "you")
;; URLs
(define-abbrev global-abbrev-table "mygh" "https://github.com/lemonase") (define-abbrev global-abbrev-table "mygh" "https://github.com/lemonase")
;; Timestamps
(define-abbrev global-abbrev-table "dt" "" 'insert-current-iso-date) (define-abbrev global-abbrev-table "dt" "" 'insert-current-iso-date)
(define-abbrev global-abbrev-table "dts" "" 'insert-current-iso-date-seconds) (define-abbrev global-abbrev-table "dts" "" 'insert-current-iso-date-time)
(define-abbrev global-abbrev-table "td" "" 'insert-current-iso-date) (define-abbrev global-abbrev-table "td" "" 'insert-current-iso-date)
(define-abbrev global-abbrev-table "tds" "" 'insert-current-iso-date-seconds) (define-abbrev global-abbrev-table "tds" "" 'insert-current-iso-date-time)
;;; Treesitter (treesit) ;; Snippets
;; https://github.com/joaotavora/yasnippet
(use-package yasnippet
:straight t
:init (yas-global-mode 1))
;; Snippet Files / Contents
;; https://github.com/AndreaCrotti/yasnippet-snippets
;; https://github.com/AndreaCrotti/yasnippet-snippets/tree/master/snippets/emacs-lisp-mode
(use-package yasnippet-snippets
:straight t)
;; Emmet: for writing HTML tags much easier and quicker
;; https://github.com/smihica/emmet-mode
(use-package emmet-mode
:straight t
:init)
;;; Treesitter (treesit) Syntax Tree and More
;; https://emacs-tree-sitter.github.io/getting-started/
(use-package treesit (use-package treesit
:commands (treesit-install-language-grammar) :commands (treesit-install-language-grammar)
:init :init (setq treesit-language-source-alist
(setq treesit-language-source-alist
'((bash . ("https://github.com/tree-sitter/tree-sitter-bash")) '((bash . ("https://github.com/tree-sitter/tree-sitter-bash"))
(c . ("https://github.com/tree-sitter/tree-sitter-c")) (c . ("https://github.com/tree-sitter/tree-sitter-c"))
(cpp . ("https://github.com/tree-sitter/tree-sitter-cpp")) (cpp . ("https://github.com/tree-sitter/tree-sitter-cpp"))
@ -567,12 +654,14 @@
(message "`%s' parser was installed." lang) (message "`%s' parser was installed." lang)
(sit-for 0.75))))) (sit-for 0.75)))))
;; NOTE: may not need to keep the huge list above with the `treesit-auto' package.
;; Tree Sitter auto config ;; Tree Sitter auto config
;; https://github.com/renzmann/treesit-auto
(use-package treesit-auto (use-package treesit-auto
:straight t :straight t
:config :config
(global-treesit-auto-mode)) (global-treesit-auto-mode))
(setq treesit-auto-install 'prompt) (setq treesit-auto-install 'prompt)
(setq treesit-auto-langs '(python rust go gomod)) (setq treesit-auto-langs '(python rust go gomod))
@ -587,15 +676,15 @@
:commands lsp) :commands lsp)
;; Language mode configurations ;; Language mode configurations
;; TODO: Try out eglot
(use-package lsp-mode (use-package lsp-mode
:hook ((go-ts-mode . lsp-deferred) :hook ((go-ts-mode . lsp-deferred)
(python-ts-mode . lsp-deferred)) (python-ts-mode . lsp-deferred))
:commands (lsp lsp-deferred)) :commands (lsp lsp-deferred))
;;; emmet: make writing HTML tags much easier ;;; Manual tool based code formatting / linting
(use-package emmet-mode (use-package format-all
:straight t :straight t)
:init)
;;; Lua ;;; Lua
(use-package lua-mode (use-package lua-mode
@ -616,6 +705,7 @@
(use-package load-env-vars (use-package load-env-vars
:straight t) :straight t)
(defvar my-env-file "~/.local/.env" "Local environment file.") (defvar my-env-file "~/.local/.env" "Local environment file.")
(let ((my-env-file "~/.local/.env")) (let ((my-env-file "~/.local/.env"))
(if (file-exists-p my-env-file) (if (file-exists-p my-env-file)
@ -625,6 +715,16 @@
:config :config
(editorconfig-mode 1)) (editorconfig-mode 1))
;; LLM support (must configure with api keys)
(use-package gptel
:straight t)
;; (setq gemini-api-key (funcall (lambda (prompt) (read-passwd prompt)) "Enter Gemini API key: "))
;; (gptel-make-gemini "Gemini" :key (getenv "GEMINI_API_KEY") :stream t)
;; (gptel-make-openai "OpenAI" :key (getenv "OPENAI_KEY") :stream t)
(gptel-make-gemini "Gemini" :stream t :key gptel-api-key)
(gptel-make-openai "OpenAI" :stream t :key gptel-api-key)
;;; ** Package Manager (straight.el) ends here ** ;;; ** Package Manager (straight.el) ends here **
;;; Additional Language Modes ;;; Additional Language Modes
;; JavaScript ;; JavaScript
@ -663,16 +763,6 @@
(let ((buffer-file-name (buffer-name))) (let ((buffer-file-name (buffer-name)))
(set-auto-mode))))) (set-auto-mode)))))
;; LLM support (must configure with api keys)
(use-package gptel
:straight t)
;; (setq gemini-api-key (funcall (lambda (prompt) (read-passwd prompt)) "Enter Gemini API key: "))
;; (gptel-make-gemini "Gemini" :key (getenv "GEMINI_API_KEY") :stream t)
;; (gptel-make-openai "OpenAI" :key (getenv "OPENAI_KEY") :stream t)
(gptel-make-gemini "Gemini" :stream t :key gptel-api-key)
(gptel-make-openai "OpenAI" :stream t :key gptel-api-key)
;;; Platform Specifics ;;; Platform Specifics
;; for Win32 ;; for Win32