Compare commits

..

15 Commits

Author SHA1 Message Date
fa0f619a43 Add consult-org-roam 2024-04-03 08:29:18 -06:00
ba6c7cb66f Add more consult keybindings 2024-04-03 08:11:10 -06:00
0124fa4071 Ensure that identifier-at-point is the first target found by embark 2024-04-02 15:05:18 -06:00
30c22902b3 Use rubocop for apheleia in ruby buffers and limit keybinding to prog-mode 2024-04-02 15:04:54 -06:00
b57a368179 Use all available flymake backends in addition to eglot 2024-04-02 15:04:30 -06:00
cf2bae52ef Add flymake config 2024-04-02 15:04:08 -06:00
20a3d96799 Make light and dark themes customizable 2024-04-02 15:03:52 -06:00
3ad9aaffef Enable copilot when writing commit messages and suppress copilot warnings 2024-04-01 14:34:22 -06:00
d578fcfaa7 Add keybinding to wrap in backticks 2024-04-01 14:31:55 -06:00
4bae080f9f Add protonvpn 2024-04-01 08:01:01 -06:00
3c27867e14 Add tf format to terraform run-command recipe 2024-04-01 08:00:33 -06:00
3fd69b75c5 Add keybinding to accept one line of copilot completion 2024-03-27 14:51:49 -04:00
0c44cc4b31 Highlight indentation in ruby-mode 2024-03-26 14:21:54 -04:00
f0d987dfe2 Unbind C-<tab> in the global map 2024-03-26 14:21:37 -04:00
9a7a320f8a Enable eglot and copilot in yaml-mode (and copilot in json mode too) 2024-03-26 14:21:11 -04:00
8 changed files with 80 additions and 15 deletions

View File

@ -62,6 +62,9 @@
;; Embark adds context actions to completion candidates (and other things!) ;; Embark adds context actions to completion candidates (and other things!)
(use-package embark (use-package embark
:config :config
;; Make sure identifier at point is the first target
(setq embark-target-finders (remove 'embark-target-identifier-at-point embark-target-finders))
(add-to-list 'embark-target-finders 'embark-target-identifier-at-point)
(defun embark-which-key-indicator () (defun embark-which-key-indicator ()
"An embark indicator that displays keymaps using which-key. "An embark indicator that displays keymaps using which-key.
The which-key help message will show the type and value of the The which-key help message will show the type and value of the
@ -157,10 +160,22 @@ targets."
([remap projectile-grep] #'consult-grep) ([remap projectile-grep] #'consult-grep)
("C-c p" #'consult-yank-from-kill-ring)) ("C-c p" #'consult-yank-from-kill-ring))
(use-package consult-flycheck (use-package consult-eglot
:after flycheck :after (consult eglot)
:general :general
(flycheck-command-map "!" #'consult-flycheck)) (eglot-prefix-map "s" #'consult-eglot-symbols))
(use-package consult-org-roam
:after (consult org-roam)
:config
(consult-org-roam-mode 1)
:custom
(consult-org-roam-grep-func #'consult-ripgrep)
(consult-org-roam-buffer-after-buffers t)
:general
(org-roam-commands-map "b" #'consult-org-roam-backlinks
"B" #'consult-org-roam-backlinks-recursive
"l" #'consult-org-roam-forward-links))
(use-package embark-consult (use-package embark-consult
:general :general

View File

@ -23,6 +23,9 @@
(defun sp-wrap-angle-bracket () (defun sp-wrap-angle-bracket ()
(interactive) (interactive)
(sp-wrap-with-pair "<")) (sp-wrap-with-pair "<"))
(defun sp-wrap-backtick ()
(interactive)
(sp-wrap-with-pair "`"))
(defun sp-after-equals-p (_id action _context) (defun sp-after-equals-p (_id action _context)
(when (memq action '(insert navigate)) (when (memq action '(insert navigate))
(sp--looking-back-p "=>" 2))) (sp--looking-back-p "=>" 2)))
@ -70,7 +73,8 @@
"g{" #'sp-wrap-curly "g{" #'sp-wrap-curly
"g\"" #'sp-wrap-double-quote "g\"" #'sp-wrap-double-quote
"g'" #'sp-wrap-single-quote "g'" #'sp-wrap-single-quote
"g<" #'sp-wrap-angle-bracket)) "g<" #'sp-wrap-angle-bracket
"g`" #'sp-wrap-backtick))
(use-package evil-smartparens (use-package evil-smartparens
:after (evil smartparens) :after (evil smartparens)

View File

@ -44,13 +44,32 @@
:custom :custom
(xref-prompt-for-identifier nil)) (xref-prompt-for-identifier nil))
;; Inline syntax checking
(use-package flymake
:straight (:type built-in)
:config
(defvar flymake-map (make-sparse-keymap)
"Keymap for flymake commands.")
(general-def flymake-map
"n" #'flymake-goto-next-error
"p" #'flymake-goto-prev-error
"b" #'flymake-show-diagnostics-buffer
"l" #'consult-flymake
"a" #'flymake-show-project-diagnostics)
(leader-def-key "e" flymake-map)
:hook (prog-mode . flymake-mode))
;; LSP client
(use-package eglot (use-package eglot
:commands (eglot) :commands (eglot)
:config :config
(add-to-list 'eglot-stay-out-of 'flymake)
(defun my-eglot-managed-hook () (defun my-eglot-managed-hook ()
(if (eglot-managed-p) (if (eglot-managed-p)
(setq-local corfu-preview-current nil) (setq-local corfu-preview-current nil)
(kill-local-variable 'corfu-preview-current))) (kill-local-variable 'corfu-preview-current))
(add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t))
(add-hook 'eglot-managed-mode-hook #'my-eglot-managed-hook) (add-hook 'eglot-managed-mode-hook #'my-eglot-managed-hook)
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
'(js-web-mode . ("typescript-language-server" "--stdio"))) '(js-web-mode . ("typescript-language-server" "--stdio")))
@ -183,9 +202,9 @@
"Prefix keymap for eglot commands.") "Prefix keymap for eglot commands.")
(general-def eglot-prefix-map (general-def eglot-prefix-map
"a" #'eglot-code-actions "a" #'eglot-code-actions
"r" #'eglot-reconnect "R" #'eglot-reconnect
"s" #'eglot-shutdown "S" #'eglot-shutdown
"R" #'eglot-rename "r" #'eglot-rename
"f" #'eglot-format-buffer "f" #'eglot-format-buffer
"i" #'eglot-code-action-organize-imports "i" #'eglot-code-action-organize-imports
"h" #'eldoc "h" #'eldoc
@ -208,6 +227,7 @@
(ruby-ts-mode . eglot-ensure) (ruby-ts-mode . eglot-ensure)
(sh-mode . eglot-ensure) (sh-mode . eglot-ensure)
(bash-ts-mode . eglot-ensure) (bash-ts-mode . eglot-ensure)
(yaml-mode . eglot-ensure)
:custom :custom
(eglot-confirm-server-initiated-edits nil) (eglot-confirm-server-initiated-edits nil)
(eglot-connect-timeout nil)) (eglot-connect-timeout nil))
@ -227,19 +247,28 @@
;; Code formatting library ;; Code formatting library
(use-package apheleia (use-package apheleia
:straight (apheleia :host github :repo "raxod502/apheleia") :straight (apheleia :host github :repo "raxod502/apheleia")
:config
(add-to-list 'apheleia-mode-alist '(ruby-mode . (rubocop)))
:general :general
("C-c f" #'apheleia-format-buffer)) (prog-mode-map "C-c f" #'apheleia-format-buffer))
;; AI assistance ;; AI assistance
(use-package copilot (use-package copilot
:straight (:host github :repo "copilot-emacs/copilot.el" :files ("dist" "*.el")) :straight (:host github :repo "copilot-emacs/copilot.el" :files ("dist" "*.el"))
:hook (prog-mode . copilot-mode) :hook ((prog-mode . copilot-mode)
(yaml-mode . copilot-mode)
(json-mode . copilot-mode)
(forge-post-mode . copilot-mode)
(git-commit-mode . copilot-mode))
:config
(add-to-list 'warning-suppress-types '(copilot))
:general :general
(prog-mode-map "C-c <tab>" #'copilot-complete) (prog-mode-map "C-c <tab>" #'copilot-complete)
(copilot-completion-map "C-n" #'copilot-next-completion (copilot-completion-map "C-n" #'copilot-next-completion
"C-p" #'copilot-previous-completion "C-p" #'copilot-previous-completion
"C-<tab>" #'copilot-accept-completion "C-<tab>" #'copilot-accept-completion
"C-M-<tab>" #'copilot-accept-completion-by-word "C-M-<tab>" #'copilot-accept-completion-by-word
"C-S-<tab>" #'copilot-accept-completion-by-line
"C-g" #'copilot-clear-overlay)) "C-g" #'copilot-clear-overlay))
;; Debugger interface ;; Debugger interface

View File

@ -1,7 +1,16 @@
;; -*- lexical-binding: t; -*- ;; -*- lexical-binding: t; -*-
(defvar my-light-theme 'doom-solarized-light) (defcustom my-light-theme 'doom-solarized-light
(defvar my-dark-theme 'doom-solarized-dark) "My light theme."
:type 'symbol
:group 'personal
:options (custom-available-themes))
(defcustom my-dark-theme 'doom-solarized-dark
"My dark theme."
:type 'symbol
:group 'personal
:options (custom-available-themes))
(defun mac-appearance () (plist-get (mac-application-state) :appearance)) (defun mac-appearance () (plist-get (mac-application-state) :appearance))
@ -25,4 +34,7 @@
(add-hook 'after-init-hook #'theme-timer-hook) (add-hook 'after-init-hook #'theme-timer-hook)
(unbind-key "C-<tab>" global-map)
(unbind-key "C-S-<tab>" global-map)
(provide 'init-mac) (provide 'init-mac)

View File

@ -164,7 +164,7 @@
(setq org-roam-v2-ack t) (setq org-roam-v2-ack t)
(defvar org-roam-commands-map (make-sparse-keymap)) (defvar org-roam-commands-map (make-sparse-keymap))
(general-def org-roam-commands-map (general-def org-roam-commands-map
"l" #'org-roam-buffer-toggle "r" #'org-roam-buffer-toggle
"f" #'org-roam-node-find "f" #'org-roam-node-find
"i" #'org-roam-node-insert "i" #'org-roam-node-insert
"I" #'org-roam-node-insert-immediate) "I" #'org-roam-node-insert-immediate)

View File

@ -1,6 +1,7 @@
;; -*- lexical-binding: t; -*- ;; -*- lexical-binding: t; -*-
(use-package ruby-mode (use-package ruby-mode
:straight (:type built-in)) :straight (:type built-in)
:hook (ruby-mode . highlight-indent-guides-mode))
(use-package rbenv (use-package rbenv
:hook (after-init . global-rbenv-mode)) :hook (after-init . global-rbenv-mode))

View File

@ -22,7 +22,9 @@
(list :command-name "apply" (list :command-name "apply"
:command-line "terraform apply") :command-line "terraform apply")
(list :command-name "destroy" (list :command-name "destroy"
:command-line "terraform destroy")))) :command-line "terraform destroy")
(list :command-name "format"
:command-line "terraform fmt -recursive"))))
(defun run-command-recipe-local () (defun run-command-recipe-local ()
(when run-command-local-commands (when run-command-local-commands

View File

@ -52,6 +52,7 @@ brew "terraform-ls"
brew "texinfo" brew "texinfo"
brew "typescript-language-server" brew "typescript-language-server"
brew "vscode-langservers-extracted" brew "vscode-langservers-extracted"
brew "yaml-language-server"
brew "youtube-dl" brew "youtube-dl"
cask "alfred" cask "alfred"
cask "bartender" cask "bartender"
@ -67,6 +68,7 @@ cask "intellij-idea"
cask "iterm2" cask "iterm2"
cask "notion" cask "notion"
cask "notion-calendar" cask "notion-calendar"
cask "protonvpn"
cask "railwaycat/emacsmacport/emacs-mac" cask "railwaycat/emacsmacport/emacs-mac"
cask "rectangle" cask "rectangle"
cask "slack" cask "slack"