Slowly replace use-package with with-eval-after-load
This commit is contained in:
parent
c7b0c1c6c2
commit
1fe168ccc6
10 changed files with 360 additions and 377 deletions
294
elpaca.lock
294
elpaca.lock
File diff suppressed because it is too large
Load diff
|
|
@ -9,13 +9,13 @@
|
||||||
;; Avy is a navigation manager.
|
;; Avy is a navigation manager.
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(use-package avy :ensure t)
|
(require 'icejam-keys-mode)
|
||||||
|
|
||||||
|
(use-package avy :ensure t)
|
||||||
(with-eval-after-load 'avy
|
(with-eval-after-load 'avy
|
||||||
(setq avy-timeout-seconds 1)
|
(setq avy-timeout-seconds 1)
|
||||||
;; Jump to text in sight with CMD-j
|
;; Jump to text in sight with CMD-j
|
||||||
(define-key icejam-keys-mode-map [(hyper j)] 'avy-goto-char-timer))
|
(define-key icejam-keys-mode-map [(hyper j)] 'avy-goto-char-timer))
|
||||||
|
|
||||||
|
|
||||||
(provide 'icejam-avy)
|
(provide 'icejam-avy)
|
||||||
;;; icejam-avy.el ends here
|
;;; icejam-avy.el ends here
|
||||||
|
|
|
||||||
|
|
@ -40,16 +40,17 @@
|
||||||
(global-set-key (kbd "RET") 'newline)
|
(global-set-key (kbd "RET") 'newline)
|
||||||
|
|
||||||
;;;;;;;;; Easy copying of data ;;;;;;;;;;;;;;;
|
;;;;;;;;; Easy copying of data ;;;;;;;;;;;;;;;
|
||||||
(use-package easy-kill :ensure t :defer t
|
(use-package easy-kill :ensure t)
|
||||||
:config (global-set-key [remap kill-ring-save] 'easy-kill))
|
(with-eval-after-load 'easy-kill
|
||||||
|
(global-set-key [remap kill-ring-save] 'easy-kill))
|
||||||
|
|
||||||
;; Move buffers around with buffer keys
|
;; Move buffers around with buffer keys
|
||||||
(use-package buffer-move :ensure t :defer t)
|
(use-package buffer-move :ensure t :defer t)
|
||||||
|
|
||||||
|
|
||||||
;; Garbage collection magic hack
|
;; Garbage collection magic hack
|
||||||
(use-package gcmh :ensure t
|
(use-package gcmh :ensure t)
|
||||||
:config (gcmh-mode 1)
|
(with-eval-after-load 'gcmh
|
||||||
|
(gcmh-mode 1)
|
||||||
(setq gcmh-verbose nil
|
(setq gcmh-verbose nil
|
||||||
gcmh-idle-delay 'auto
|
gcmh-idle-delay 'auto
|
||||||
gcmh-auto-idle-delay-factor 10))
|
gcmh-auto-idle-delay-factor 10))
|
||||||
|
|
@ -96,13 +97,17 @@
|
||||||
;; Allow to execute path from shell
|
;; Allow to execute path from shell
|
||||||
(use-package exec-path-from-shell
|
(use-package exec-path-from-shell
|
||||||
:if (memq window-system '(x mac ns))
|
:if (memq window-system '(x mac ns))
|
||||||
:ensure t
|
:ensure t)
|
||||||
:config (add-to-list 'exec-path "/usr/local/bin")
|
|
||||||
|
(with-eval-after-load 'exec-path-from-shell
|
||||||
|
(add-to-list 'exec-path "/usr/local/bin")
|
||||||
(dolist (var '("DEFT_PATH" "LANG" "LC_CTYPE"))
|
(dolist (var '("DEFT_PATH" "LANG" "LC_CTYPE"))
|
||||||
(add-to-list 'exec-path-from-shell-variables var))
|
(add-to-list 'exec-path-from-shell-variables var))
|
||||||
(exec-path-from-shell-initialize))
|
(exec-path-from-shell-initialize))
|
||||||
|
|
||||||
(use-package direnv :ensure t :config (direnv-mode))
|
(use-package direnv :ensure t)
|
||||||
|
(with-eval-after-load 'direnv
|
||||||
|
(direnv-mode t))
|
||||||
|
|
||||||
;; Draw underline lower
|
;; Draw underline lower
|
||||||
(setq x-underline-at-descent-line t)
|
(setq x-underline-at-descent-line t)
|
||||||
|
|
@ -114,28 +119,25 @@
|
||||||
indicate-empty-lines nil)
|
indicate-empty-lines nil)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;; Treemacs
|
;;;;;;;;;;;;;;;;; Treemacs
|
||||||
(use-package treemacs :ensure t :defer t
|
(use-package treemacs :ensure t)
|
||||||
:config (treemacs-follow-mode 1) ;; Follow the current project.
|
(with-eval-after-load 'treemacs
|
||||||
:bind (:map icejam-keys-mode-map
|
(treemacs-follow-mode t)
|
||||||
([(hyper b)] . treemacs))) ;; Show the folder tree
|
(treemacs-project-follow-mode t)
|
||||||
|
(define-key icejam-keys-mode-map [(hyper b)] 'treemacs))
|
||||||
|
|
||||||
(use-package treemacs-all-the-icons :defer t :requires (treemacs) :ensure t
|
(use-package treemacs-all-the-icons :ensure t :requires (treemacs))
|
||||||
:config
|
(with-eval-after-load 'treemacs-all-the-icons
|
||||||
(treemacs-load-theme "all-the-icons")
|
(treemacs-load-theme "all-the-icons"))
|
||||||
(treemacs-project-follow-mode t))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;; Record frequency of different commands. Review them later
|
;;;;;;;;;;;;;;;;; Record frequency of different commands. Review them later
|
||||||
(use-package keyfreq
|
(use-package keyfreq :ensure t)
|
||||||
:defer t
|
(with-eval-after-load 'keyfreq
|
||||||
:ensure t
|
|
||||||
:config
|
|
||||||
(keyfreq-mode t)
|
(keyfreq-mode t)
|
||||||
(keyfreq-autosave-mode t))
|
(keyfreq-autosave-mode t))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;; Show hints about key combinations
|
;;;;;;;;;;;;;;;;; Show hints about key combinations
|
||||||
(use-package which-key
|
(use-package which-key :ensure t)
|
||||||
:ensure t
|
(with-eval-after-load 'which-key
|
||||||
:config
|
|
||||||
(setq which-key-idle-delay 0.5)
|
(setq which-key-idle-delay 0.5)
|
||||||
(which-key-mode t))
|
(which-key-mode t))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,102 +3,89 @@
|
||||||
;;; Company completion framework configuration
|
;;; Company completion framework configuration
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package yasnippet :ensure t
|
(use-package yasnippet :ensure t)
|
||||||
:config
|
(use-package yasnippet-snippets :ensure t :requires (yasnippet))
|
||||||
(yas-global-mode t))
|
(use-package company :ensure t :requires (yasnippet yasnippet-snippets))
|
||||||
|
(use-package company-box :ensure t :requires (company))
|
||||||
|
|
||||||
(use-package yasnippet-snippets
|
(with-eval-after-load 'yasnippet
|
||||||
:ensure t
|
(yas-global-mode t)
|
||||||
:requires (yasnippet)
|
|
||||||
:config
|
|
||||||
(unbind-key "C-c & C-n" yas-minor-mode-map)
|
(unbind-key "C-c & C-n" yas-minor-mode-map)
|
||||||
(unbind-key "C-c & C-s" yas-minor-mode-map)
|
(unbind-key "C-c & C-s" yas-minor-mode-map)
|
||||||
(unbind-key "C-c & C-v" yas-minor-mode-map))
|
(unbind-key "C-c & C-v" yas-minor-mode-map))
|
||||||
|
|
||||||
(use-package company
|
|
||||||
:commands (company-indent-or-complete-common company-yasnippet)
|
|
||||||
:ensure t
|
|
||||||
:config (global-company-mode t)
|
|
||||||
:demand t
|
|
||||||
:requires (yasnippet
|
|
||||||
yasnippet-snippets))
|
|
||||||
|
|
||||||
(use-package company-box
|
|
||||||
:ensure t
|
|
||||||
:defer t
|
|
||||||
:requires (company)
|
|
||||||
:hook (company-mode . company-box-mode))
|
|
||||||
|
|
||||||
;; (global-company-mode t)
|
|
||||||
|
|
||||||
;; Hacks for orderless
|
|
||||||
(with-eval-after-load 'company
|
(with-eval-after-load 'company
|
||||||
(defun just-one-face (fn &rest args)
|
(global-company-mode t)
|
||||||
(let ((orderless-match-faces [completions-common-part]))
|
|
||||||
(apply fn args)))
|
|
||||||
|
|
||||||
(advice-add 'company-capf--candidates :around #'just-one-face)
|
;; Hacks for orderless
|
||||||
|
(defun just-one-face (fn &rest args)
|
||||||
|
(let ((orderless-match-faces [completions-common-part]))
|
||||||
|
(apply fn args)))
|
||||||
|
|
||||||
(defun company-completion-styles (capf-fn &rest args)
|
(advice-add 'company-capf--candidates :around #'just-one-face)
|
||||||
(let ((completion-styles '(partial-completion basic)))
|
|
||||||
(apply capf-fn args)))
|
|
||||||
|
|
||||||
(advice-add 'company-capf :around #'company-completion-styles)
|
(defun company-completion-styles (capf-fn &rest args)
|
||||||
|
(let ((completion-styles '(partial-completion basic)))
|
||||||
|
(apply capf-fn args)))
|
||||||
|
|
||||||
(setq-default
|
(advice-add 'company-capf :around #'company-completion-styles)
|
||||||
company-minimum-prefix-length 3 ;; minimum prefix character number for auto complete.
|
|
||||||
company-idle-delay 0.1
|
|
||||||
company-require-match nil
|
|
||||||
company-echo-delay 0 ;;;; company-show-numbers t
|
|
||||||
company-tooltip-align-annotations t ;; align annotations to the right tooltip border.
|
|
||||||
company-tooltip-flip-when-above t
|
|
||||||
company-tooltip-limit 10 ;; tooltip candidates max limit.
|
|
||||||
company-tooltip-minimum 2 ;; minimum candidates limit.
|
|
||||||
company-tooltip-minimum-width 10 ;; The minimum width of the tooltip's inner area.
|
|
||||||
;; This doesn't include the margins and the scroll bar.
|
|
||||||
company-tooltip-margin 2 ;; width of margin columns to show around the tooltip
|
|
||||||
company-tooltip-offset-display 'lines ;; 'lines - how to show tooltip unshown candidates number.
|
|
||||||
company-show-numbers nil ;; t: show quick-access numbers for the first ten candidates.
|
|
||||||
company-selection-wrap-around t ;; loop over candidates
|
|
||||||
company-dabbrev-other-buffers t ;; Only offer dabbrev from the same major mode
|
|
||||||
company-dabbrev-downcase nil ;; Preserve case of candidates
|
|
||||||
company-format-margin-function nil
|
|
||||||
;; company-async-wait 0.03
|
|
||||||
;; company-async-timeout 2
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Absolute defaults for company mode
|
(setq-default
|
||||||
(setq company-backends
|
company-minimum-prefix-length 3 ;; minimum prefix character number for auto complete.
|
||||||
'((company-files ; files & directory
|
company-idle-delay 0.1
|
||||||
company-keywords ; keywords
|
company-require-match nil
|
||||||
company-capf
|
company-echo-delay 0 ;;;; company-show-numbers t
|
||||||
)
|
company-tooltip-align-annotations t ;; align annotations to the right tooltip border.
|
||||||
(company-dabbrev company-abbrev)
|
company-tooltip-flip-when-above t
|
||||||
))
|
company-tooltip-limit 10 ;; tooltip candidates max limit.
|
||||||
|
company-tooltip-minimum 2 ;; minimum candidates limit.
|
||||||
|
company-tooltip-minimum-width 10 ;; The minimum width of the tooltip's inner area.
|
||||||
|
;; This doesn't include the margins and the scroll bar.
|
||||||
|
company-tooltip-margin 2 ;; width of margin columns to show around the tooltip
|
||||||
|
company-tooltip-offset-display 'lines ;; 'lines - how to show tooltip unshown candidates number.
|
||||||
|
company-show-numbers nil ;; t: show quick-access numbers for the first ten candidates.
|
||||||
|
company-selection-wrap-around t ;; loop over candidates
|
||||||
|
company-dabbrev-other-buffers t ;; Only offer dabbrev from the same major mode
|
||||||
|
company-dabbrev-downcase nil ;; Preserve case of candidates
|
||||||
|
company-format-margin-function nil
|
||||||
|
;; company-async-wait 0.03
|
||||||
|
;; company-async-timeout 2
|
||||||
|
)
|
||||||
|
|
||||||
;; Use standard emacs next and previous bindings for navigating company
|
;; Absolute defaults for company mode
|
||||||
;; suggestions
|
(setq company-backends
|
||||||
(define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort)
|
'((company-files ; files & directory
|
||||||
(define-key company-active-map (kbd "C-n") 'company-select-next-or-abort)
|
company-keywords ; keywords
|
||||||
|
company-capf
|
||||||
|
)
|
||||||
|
(company-dabbrev company-abbrev)
|
||||||
|
))
|
||||||
|
|
||||||
(defun icejam-insert-space-and-complete ()
|
;; Use standard emacs next and previous bindings for navigating company
|
||||||
"Insert space before trying to complete a section."
|
;; suggestions
|
||||||
(interactive)
|
(define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort)
|
||||||
(save-excursion
|
(define-key company-active-map (kbd "C-n") 'company-select-next-or-abort)
|
||||||
(insert " "))
|
|
||||||
(company-indent-or-complete-common))
|
|
||||||
|
|
||||||
;; Only use RETURN for completion in company
|
(defun icejam-insert-space-and-complete ()
|
||||||
(unbind-key "TAB" company-active-map)
|
"Insert space before trying to complete a section."
|
||||||
|
(interactive)
|
||||||
|
(save-excursion
|
||||||
|
(insert " "))
|
||||||
|
(company-indent-or-complete-common))
|
||||||
|
|
||||||
|
;; Only use RETURN for completion in company
|
||||||
|
(unbind-key "TAB" company-active-map)
|
||||||
|
|
||||||
;;; Yasnippet configuration
|
;;; Yasnippet configuration
|
||||||
(define-key prog-mode-map (kbd "C-c y") 'company-yasnippet)
|
(define-key prog-mode-map (kbd "C-c y") 'company-yasnippet)
|
||||||
(define-key prog-mode-map (kbd "<f13>") 'icejam-insert-space-and-complete)
|
(define-key prog-mode-map (kbd "<f13>") 'icejam-insert-space-and-complete)
|
||||||
(define-key prog-mode-map (kbd "TAB") 'company-indent-or-complete-common)
|
(define-key prog-mode-map (kbd "TAB") 'company-indent-or-complete-common)
|
||||||
|
|
||||||
(define-key text-mode-map (kbd "C-c y") 'company-yasnippet)
|
(define-key text-mode-map (kbd "C-c y") 'company-yasnippet)
|
||||||
(define-key text-mode-map (kbd "<f13>") 'icejam-insert-space-and-complete)
|
(define-key text-mode-map (kbd "<f13>") 'icejam-insert-space-and-complete)
|
||||||
(define-key text-mode-map (kbd "TAB") 'company-indent-or-complete-common))
|
(define-key text-mode-map (kbd "TAB") 'company-indent-or-complete-common))
|
||||||
|
|
||||||
|
(with-eval-after-load 'company-box (add-hook 'company-mode-hook #'company-box-mode))
|
||||||
|
|
||||||
(provide 'icejam-company-yasnippet)
|
(provide 'icejam-company-yasnippet)
|
||||||
;;; icejam-company-yasnippet.el ends here
|
;;; icejam-company-yasnippet.el ends here
|
||||||
|
|
|
||||||
|
|
@ -5,55 +5,54 @@
|
||||||
|
|
||||||
(require 'icejam-keys-mode)
|
(require 'icejam-keys-mode)
|
||||||
|
|
||||||
(use-package vertico :ensure t :defer t
|
;; Preparations for using Vertico/Orderless
|
||||||
:init
|
(setq
|
||||||
(vertico-mode)
|
;; Support opening new minibuffers from inside existing minibuffers.
|
||||||
:custom
|
enable-recursive-minibuffers t
|
||||||
(vertico-scroll-margin 0) ;; Different scroll margin
|
;; Hide commands in M-x which do not work in the current mode. Vertico
|
||||||
(vertico-count 15) ;; Show more candidates
|
;; commands are hidden in normal buffers. This setting is useful beyond
|
||||||
(vertico-resize t) ;; Grow and shrink the Vertico minibuffer
|
;; Vertico.
|
||||||
(vertico-cycle t) ;; Enable cycling for `vertico-next/previous')
|
read-extended-command-predicate #'command-completion-default-include-p
|
||||||
)
|
;; Do not allow the cursor in the minibuffer prompt
|
||||||
|
minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt))
|
||||||
|
|
||||||
;; A few more useful configurations...
|
(defun crm-indicator (args)
|
||||||
(use-package emacs
|
(cons (format "[CRM%s] %s"
|
||||||
:custom
|
(replace-regexp-in-string
|
||||||
;; Support opening new minibuffers from inside existing minibuffers.
|
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
||||||
(enable-recursive-minibuffers t)
|
crm-separator)
|
||||||
;; Hide commands in M-x which do not work in the current mode. Vertico
|
(car args))
|
||||||
;; commands are hidden in normal buffers. This setting is useful beyond
|
(cdr args)))
|
||||||
;; Vertico.
|
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
||||||
(read-extended-command-predicate #'command-completion-default-include-p)
|
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||||
:init
|
|
||||||
;; Add prompt indicator to `completing-read-multiple'.
|
|
||||||
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
|
|
||||||
(defun crm-indicator (args)
|
|
||||||
(cons (format "[CRM%s] %s"
|
|
||||||
(replace-regexp-in-string
|
|
||||||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
|
||||||
crm-separator)
|
|
||||||
(car args))
|
|
||||||
(cdr args)))
|
|
||||||
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
|
||||||
|
|
||||||
;; Do not allow the cursor in the minibuffer prompt
|
;; Actual orderless
|
||||||
(setq minibuffer-prompt-properties
|
(use-package vertico :ensure t)
|
||||||
'(read-only t cursor-intangible t face minibuffer-prompt))
|
(use-package orderless :ensure t)
|
||||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))
|
(use-package marginalia :ensure t)
|
||||||
|
(use-package consult :ensure t)
|
||||||
|
(use-package helpful :ensure t)
|
||||||
|
|
||||||
;; Optionally use the `orderless' completion style.
|
(with-eval-after-load 'vertico
|
||||||
(use-package orderless :ensure t :defer t
|
(setq
|
||||||
:custom
|
vertico-scroll-margin 0 ;; Different scroll margin
|
||||||
;; Configure a custom style dispatcher (see the Consult wiki)
|
vertico-count 15 ;; Show more candidates
|
||||||
;; (orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch))
|
vertico-resize t ;; Grow and shrink the Vertico minibuffer
|
||||||
;; (orderless-component-separator #'orderless-escapable-split-on-space)
|
vertico-cycle t ;; Enable cycling for `vertico-next/previous'
|
||||||
(completion-styles '(orderless basic))
|
)
|
||||||
(completion-category-defaults nil)
|
(vertico-mode))
|
||||||
(completion-category-overrides '((file (styles partial-completion)))))
|
|
||||||
|
|
||||||
(use-package marginalia :ensure t :defer t :init (marginalia-mode))
|
(with-eval-after-load 'orderless
|
||||||
(use-package consult :ensure t :defer t)
|
(setq
|
||||||
(use-package helpful :ensure t :defer t)
|
;; Configure a custom style dispatcher (see the Consult wiki)
|
||||||
|
;; (orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch))
|
||||||
|
;; (orderless-component-separator #'orderless-escapable-split-on-space)
|
||||||
|
completion-styles '(orderless basic) ;; Fallback to basic
|
||||||
|
completion-category-defaults nil
|
||||||
|
completion-category-overrides '((file (styles partial-completion)))))
|
||||||
|
|
||||||
|
(with-eval-after-load 'marginalia
|
||||||
|
(marginalia-mode t))
|
||||||
|
|
||||||
(with-eval-after-load 'consult
|
(with-eval-after-load 'consult
|
||||||
(define-key icejam-keys-mode-map (kbd "C-c a") 'consult-ripgrep)
|
(define-key icejam-keys-mode-map (kbd "C-c a") 'consult-ripgrep)
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,13 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(use-package copilot
|
(use-package copilot
|
||||||
:ensure (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))
|
:ensure (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")))
|
||||||
:bind (:map copilot-completion-map
|
|
||||||
("<tab>" . copilot-accept-completion)
|
|
||||||
("TAB" . copilot-accept-completion)))
|
|
||||||
|
|
||||||
;; Do not enable copilot by default because it sorta sucks?
|
(with-eval-after-load 'copilot
|
||||||
;; (add-hook 'prog-mode-hook 'copilot-mode)
|
;; Do not enable copilot by default because it sorta sucks?
|
||||||
;; (define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
|
;; (add-hook 'prog-mode-hook 'copilot-mode)
|
||||||
;; (define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
|
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
|
||||||
|
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion))
|
||||||
|
|
||||||
;; Enable Anthropic Claude LLM support for chat (it also sucks)
|
;; Enable Anthropic Claude LLM support for chat (it also sucks)
|
||||||
(defcustom anthropic-api-key "api-key" "The value of your Anthropic API key."
|
(defcustom anthropic-api-key "api-key" "The value of your Anthropic API key."
|
||||||
|
|
@ -26,23 +24,26 @@
|
||||||
:group 'icejam
|
:group 'icejam
|
||||||
:initialize 'custom-initialize-set)
|
:initialize 'custom-initialize-set)
|
||||||
|
|
||||||
(use-package gptel :ensure t
|
(use-package gptel :ensure t)
|
||||||
:config
|
(with-eval-after-load 'gptel
|
||||||
(setq
|
(setq
|
||||||
gptel-model "claude-3-5-sonnet-20240620"
|
gptel-model "claude-3-5-sonnet-20241022"
|
||||||
gptel-backend (gptel-make-anthropic "Claude"
|
gptel-backend (gptel-make-anthropic "Claude"
|
||||||
:stream t
|
:stream t :key (lambda () anthropic-api-key))))
|
||||||
:key (lambda () anthropic-api-key))))
|
|
||||||
|
|
||||||
|
|
||||||
;; Pretend to be 'AI editor'.
|
;; Pretend to be 'AI editor'.
|
||||||
(use-package elysium :ensure t
|
(use-package elysium :ensure t)
|
||||||
:custom
|
(with-eval-after-load 'elysium
|
||||||
(elysium-window-size 0.33) ; The elysium buffer will be 1/3 your screen
|
(setq
|
||||||
(elysium-window-style 'vertical)) ; Can be customized to horizontal
|
;; The elysium buffer will be 1/3 your screen
|
||||||
|
elysium-window-size 0.33
|
||||||
|
;; Elysium buffer will be vertical
|
||||||
|
elysium-window-style 'vertical))
|
||||||
|
|
||||||
;; Merging with SMerge
|
;; Merging with SMerge
|
||||||
(use-package smerge-mode :ensure nil :hook (prog-mode . smerge-mode))
|
(use-package smerge-mode :ensure nil)
|
||||||
|
(with-eval-after-load 'smerge-mode
|
||||||
|
(add-hook 'prog-mode-hook #'smerge-mode))
|
||||||
|
|
||||||
(provide 'icejam-copilot)
|
(provide 'icejam-copilot)
|
||||||
;;; icejam-copilot.el ends here
|
;;; icejam-copilot.el ends here
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
;; Use flycheck globally to check syntax and compile languages
|
;; Use flycheck globally to check syntax and compile languages
|
||||||
(use-package flycheck :ensure t)
|
(use-package flycheck :ensure t)
|
||||||
|
|
||||||
(with-eval-after-load 'flycheck
|
(with-eval-after-load 'flycheck
|
||||||
(global-flycheck-mode t)
|
(global-flycheck-mode t)
|
||||||
(setq flycheck-emacs-lisp-load-path 'inherit)
|
(setq flycheck-emacs-lisp-load-path 'inherit)
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,23 @@
|
||||||
;;; Highlight misspelled words
|
;;; Highlight misspelled words
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(use-package ispell
|
(use-package ispell :ensure nil)
|
||||||
:ensure nil
|
|
||||||
:config (setq ispell-program-name "aspell")
|
|
||||||
(setq ispell-extra-args
|
|
||||||
'("--run-together" "--run-together-limit=5" "--run-together-min=2"))
|
|
||||||
:hook ((prog-mode text-mode markdown-mode) . flyspell-mode))
|
|
||||||
|
|
||||||
(add-hook 'flyspell-mode-hook (lambda ()
|
|
||||||
(unbind-key "C-," flyspell-mode-map)
|
|
||||||
(unbind-key "C-." flyspell-mode-map)
|
|
||||||
(unbind-key "C-;" flyspell-mode-map)
|
|
||||||
(unbind-key "C-c $" flyspell-mode-map)
|
|
||||||
(unbind-key "C-M-i" flyspell-mode-map)))
|
|
||||||
|
|
||||||
(use-package flyspell-correct :ensure t :after flyspell :defer t)
|
(use-package flyspell-correct :ensure t :after flyspell :defer t)
|
||||||
(use-package flyspell-correct-ivy :ensure t :after flyspell-correct :defer t)
|
(use-package flyspell-correct-ivy :ensure t :after flyspell-correct :defer t)
|
||||||
|
|
||||||
|
(with-eval-after-load 'ispell
|
||||||
|
(setq
|
||||||
|
ispell-program-name "aspell"
|
||||||
|
ispell-extra-args '("--run-together" "--run-together-limit=5" "--run-together-min=2"))
|
||||||
|
(add-hook 'prog-mode-hook #'flyspell-mode)
|
||||||
|
(add-hook 'text-mode-hook #'flyspell-mode)
|
||||||
|
(add-hook 'markdown-mode-hook #'flyspell-mode)
|
||||||
|
(add-hook 'flyspell-mode-hook (lambda ()
|
||||||
|
(unbind-key "C-," flyspell-mode-map)
|
||||||
|
(unbind-key "C-." flyspell-mode-map)
|
||||||
|
(unbind-key "C-;" flyspell-mode-map)
|
||||||
|
(unbind-key "C-c $" flyspell-mode-map)
|
||||||
|
(unbind-key "C-M-i" flyspell-mode-map))))
|
||||||
|
|
||||||
(provide 'icejam-ispell)
|
(provide 'icejam-ispell)
|
||||||
;;; icejam-ispell.el ends here
|
;;; icejam-ispell.el ends here
|
||||||
|
|
|
||||||
|
|
@ -12,51 +12,46 @@
|
||||||
(global-eldoc-mode t)
|
(global-eldoc-mode t)
|
||||||
|
|
||||||
;; Revert tag tables without asking
|
;; Revert tag tables without asking
|
||||||
(require 'etags)
|
(use-package etags :ensure nil)
|
||||||
(setq tags-revert-without-query t)
|
(with-eval-after-load 'etags
|
||||||
|
(setq tags-revert-without-query t))
|
||||||
|
|
||||||
;;; Show trailing whitespace and remove whitespace on save
|
;;; Show trailing whitespace and remove whitespace on save
|
||||||
(use-package whitespace
|
(use-package whitespace :ensure nil)
|
||||||
:commands whitespace-mode
|
|
||||||
:ensure nil
|
(with-eval-after-load 'whitespace
|
||||||
:defer t
|
(setq
|
||||||
:hook (((prog-mode text-mode conf-mode) . whitespace-mode)
|
;; Change whitespace style
|
||||||
(before-save . whitespace-cleanup))
|
whitespace-style #'(face trailing empty)
|
||||||
:config
|
;; Insert newline on save
|
||||||
(setq whitespace-style #'(face trailing empty)
|
require-final-newline 't)
|
||||||
;;; Insert newline on save
|
|
||||||
require-final-newline 't))
|
(add-hook 'prog-mode-hook #'whitespace-mode)
|
||||||
|
(add-hook 'text-mode-hook #'whitespace-mode)
|
||||||
|
(add-hook 'conf-mode-hook #'whitespace-mode)
|
||||||
|
(add-hook 'before-save-hook #'whitespace-cleanup))
|
||||||
|
|
||||||
(setq-default indent-tabs-mode nil)
|
(setq-default indent-tabs-mode nil)
|
||||||
|
|
||||||
;; Use colorful, matching parens
|
;; Use colorful, matching parens
|
||||||
(use-package rainbow-delimiters
|
(use-package rainbow-delimiters :ensure t)
|
||||||
:commands rainbow-delimiters-mode
|
(with-eval-after-load 'rainbow-delimiters
|
||||||
:ensure t
|
|
||||||
:defer t
|
|
||||||
:hook (((prog-mode text-mode) . rainbow-delimiters-mode))
|
|
||||||
:init
|
|
||||||
;;; Match parenthasis (left-right)
|
|
||||||
|
|
||||||
(electric-pair-mode t)
|
(electric-pair-mode t)
|
||||||
(show-paren-mode t))
|
(show-paren-mode t)
|
||||||
|
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
|
||||||
|
(add-hook 'text-mode-hook #'rainbow-delimiters-mode))
|
||||||
|
|
||||||
;;; Show hex (#aaa) colors as colors
|
;;; Show hex (#aaa) colors as colors
|
||||||
(use-package rainbow-mode
|
(use-package rainbow-mode :ensure t)
|
||||||
:commands rainbow-mode
|
(with-eval-after-load 'rainbow-mode
|
||||||
:ensure t
|
(add-hook 'prog-mode-hook #'rainbow-mode)
|
||||||
:hook ((prog-mode text-mode) . rainbow-mode))
|
(add-hook 'text-mode-hook #'rainbow-mode))
|
||||||
|
|
||||||
;; Dash integration
|
;; Dash integration
|
||||||
(use-package dash-at-point
|
(use-package dash-at-point :ensure t)
|
||||||
:commands dash-at-point
|
(with-eval-after-load 'dash-at-point
|
||||||
:ensure t
|
(add-to-list 'dash-at-point-mode-alist '(enh-ruby-mode . "ruby,rubygems,rails"))
|
||||||
:defer t
|
(add-to-list 'dash-at-point-mode-alist '(elixir-ts-mode . "elixir,hex")))
|
||||||
:config
|
|
||||||
(add-to-list 'dash-at-point-mode-alist
|
|
||||||
'(enh-ruby-mode . "ruby,rubygems,rails"))
|
|
||||||
(add-to-list 'dash-at-point-mode-alist
|
|
||||||
'(elixir-ts-mode . "elixir,hex")))
|
|
||||||
|
|
||||||
;; By default, use 2 spaces for indentation
|
;; By default, use 2 spaces for indentation
|
||||||
(setq tab-width 2)
|
(setq tab-width 2)
|
||||||
|
|
@ -69,19 +64,17 @@
|
||||||
(setq-local tab-width step)
|
(setq-local tab-width step)
|
||||||
(setq-local tab-stop-list (number-sequence step 200 step)))
|
(setq-local tab-stop-list (number-sequence step 200 step)))
|
||||||
|
|
||||||
(use-package column-enforce-mode
|
(use-package column-enforce-mode :ensure t)
|
||||||
:ensure t
|
(with-eval-after-load 'column-enforce-mode
|
||||||
:defer t
|
(global-column-enforce-mode t))
|
||||||
:config (global-column-enforce-mode t))
|
|
||||||
|
|
||||||
;; PCRE to emacs regex translations
|
;; PCRE to emacs regex translations
|
||||||
(use-package pcre2el :ensure t)
|
(use-package pcre2el :ensure t)
|
||||||
|
|
||||||
;; Visual regexp
|
;; Visual regexp
|
||||||
(use-package visual-regexp-steroids
|
(use-package visual-regexp-steroids :ensure t :requires (pcre2el))
|
||||||
:ensure t
|
(with-eval-after-load 'visual-regexp-steroids
|
||||||
:requires (pcre2el)
|
(setq vr/engine 'pcre2el))
|
||||||
:config (setq vr/engine 'pcre2el))
|
|
||||||
|
|
||||||
(provide 'icejam-prog-mode)
|
(provide 'icejam-prog-mode)
|
||||||
;;; icejam-prog-mode.el ends here
|
;;; icejam-prog-mode.el ends here
|
||||||
|
|
|
||||||
|
|
@ -11,20 +11,21 @@
|
||||||
|
|
||||||
(defun icejam-tree-sitter-symlink-grammar-objects ()
|
(defun icejam-tree-sitter-symlink-grammar-objects ()
|
||||||
"Tree-sitter-langs-build releases grammars as LANG.so, but treesit needs libtree-sitter-LANG.so."
|
"Tree-sitter-langs-build releases grammars as LANG.so, but treesit needs libtree-sitter-LANG.so."
|
||||||
|
(interactive)
|
||||||
(dolist (file (directory-files (tree-sitter-langs--bin-dir) 'full
|
(dolist (file (directory-files (tree-sitter-langs--bin-dir) 'full
|
||||||
(concat "\\" (car tree-sitter-load-suffixes) "$")))
|
(concat "\\" (car tree-sitter-load-suffixes) "$")))
|
||||||
;; make symlink (or copy) libtree-sitter-c.so -> c.so
|
;; make symlink (or copy) libtree-sitter-c.so -> c.so
|
||||||
(let ((target (concat (file-name-as-directory (file-name-directory file))
|
(let ((target (concat (file-name-as-directory (file-name-directory file))
|
||||||
"libtree-sitter-"
|
"libtree-sitter-"
|
||||||
(file-name-nondirectory file))))
|
(file-name-nondirectory file))))
|
||||||
(if (memq system-type '(ms-dos windows-nt cygwin))
|
(if (memq system-type '(ms-dos windows-nt cygwin))
|
||||||
(copy-file file target)
|
(copy-file file target)
|
||||||
(make-symbolic-link file target)))))
|
(make-symbolic-link file target)))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;; Tree sitter ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;; Tree sitter ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(use-package tree-sitter-langs :ensure t
|
(use-package tree-sitter-langs :ensure t)
|
||||||
:config
|
(with-eval-after-load 'tree-sitter-langs
|
||||||
(add-to-list 'treesit-extra-load-path (tree-sitter-langs--bin-dir)))
|
(add-to-list 'treesit-extra-load-path (tree-sitter-langs--bin-dir)))
|
||||||
|
|
||||||
;; (use-package tree-sitter-indent :ensure t)
|
;; (use-package tree-sitter-indent :ensure t)
|
||||||
(add-hook 'tree-sitter-after-on-hook 'tree-sitter-hl-mode)
|
(add-hook 'tree-sitter-after-on-hook 'tree-sitter-hl-mode)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue