Update
This commit is contained in:
@@ -7,64 +7,11 @@
|
|||||||
;; To disable collection of benchmark data after init is done.
|
;; To disable collection of benchmark data after init is done.
|
||||||
(add-hook 'elpaca-after-init-hook 'benchmark-init/deactivate))
|
(add-hook 'elpaca-after-init-hook 'benchmark-init/deactivate))
|
||||||
|
|
||||||
(defconst my-local-dir (concat user-emacs-directory ".local/"))
|
(when (memq window-system '(mac ns x))
|
||||||
|
(use-package exec-path-from-shell
|
||||||
|
:init
|
||||||
|
(exec-path-from-shell-initialize)))
|
||||||
|
|
||||||
(defconst my-env-file (concat my-local-dir "env"))
|
|
||||||
|
|
||||||
(defun my/generate-envvars-file ()
|
|
||||||
"Generate environment variables file at ~/.emacs.d/.local/env."
|
|
||||||
(interactive)
|
|
||||||
;; Ensure the directory exists
|
|
||||||
(unless (file-exists-p my-local-dir)
|
|
||||||
(make-directory my-local-dir t))
|
|
||||||
|
|
||||||
;; Run printenv and redirect output to the env file
|
|
||||||
(with-temp-buffer
|
|
||||||
(call-process "printenv" nil t nil)
|
|
||||||
(write-region (point-min) (point-max) my-env-file nil 'silent))
|
|
||||||
|
|
||||||
(message "Environment variables saved to %s" my-env-file))
|
|
||||||
|
|
||||||
(defun my/load-envvars-file (file &optional noerror)
|
|
||||||
"Read and set envvars from FILE.
|
|
||||||
If NOERROR is non-nil, don't throw an error if the file doesn't exist or is
|
|
||||||
unreadable. Returns the names of envvars that were changed."
|
|
||||||
(if (not (file-readable-p file))
|
|
||||||
(unless noerror
|
|
||||||
(signal 'file-error (list "Couldn't read envvar file" file)))
|
|
||||||
(let (envvars environment)
|
|
||||||
(with-temp-buffer
|
|
||||||
(save-excursion
|
|
||||||
(insert "\n")
|
|
||||||
(insert-file-contents file))
|
|
||||||
(while (re-search-forward "\n *\\([^#= \n]*\\)=" nil t)
|
|
||||||
(push (match-string 1) envvars)
|
|
||||||
(push (buffer-substring
|
|
||||||
(match-beginning 1)
|
|
||||||
(1- (or (save-excursion
|
|
||||||
(when (re-search-forward "^\\([^= ]+\\)=" nil t)
|
|
||||||
(line-beginning-position)))
|
|
||||||
(point-max))))
|
|
||||||
environment)))
|
|
||||||
(when environment
|
|
||||||
(setq process-environment
|
|
||||||
(append (nreverse environment) process-environment)
|
|
||||||
exec-path
|
|
||||||
(if (member "PATH" envvars)
|
|
||||||
(append (split-string (getenv "PATH") path-separator t)
|
|
||||||
(list exec-directory))
|
|
||||||
exec-path)
|
|
||||||
shell-file-name
|
|
||||||
(if (member "SHELL" envvars)
|
|
||||||
(or (getenv "SHELL") shell-file-name)
|
|
||||||
shell-file-name))
|
|
||||||
envvars))))
|
|
||||||
|
|
||||||
(when (and (or (display-graphic-p)
|
|
||||||
(daemonp))
|
|
||||||
(file-exists-p my-env-file))
|
|
||||||
(my/load-envvars-file my-env-file))
|
|
||||||
|
|
||||||
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
|
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
|
||||||
(add-hook 'elpaca-after-init-hook (lambda () (load custom-file 'no-error 'no-message)))
|
(add-hook 'elpaca-after-init-hook (lambda () (load custom-file 'no-error 'no-message)))
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
;; M-g bindings in `goto-map'
|
;; M-g bindings in `goto-map'
|
||||||
("M-g e" . consult-compile-error)
|
("M-g e" . consult-compile-error)
|
||||||
("M-g r" . consult-grep-match)
|
("M-g r" . consult-grep-match)
|
||||||
("M-s f" . consult-flycheck) ;; Alternative: consult-flycheck
|
("M-g f" . consult-flycheck) ;; Alternative: consult-flycheck
|
||||||
("M-g g" . consult-goto-line) ;; orig. goto-line
|
("M-g g" . consult-goto-line) ;; orig. goto-line
|
||||||
("M-g M-g" . consult-goto-line) ;; orig. goto-line
|
("M-g M-g" . consult-goto-line) ;; orig. goto-line
|
||||||
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
|
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
|
||||||
@@ -145,26 +145,25 @@
|
|||||||
("M-g i" . consult-imenu)
|
("M-g i" . consult-imenu)
|
||||||
("M-g I" . consult-imenu-multi)
|
("M-g I" . consult-imenu-multi)
|
||||||
|
|
||||||
;; M-s bindings in `search-map'
|
;; M-g bindings in `search-map'
|
||||||
("s-f" . consult-line)
|
("s-f" . consult-line)
|
||||||
("M-s d" . consult-find) ;; Alternative: consult-fd
|
("M-g d" . consult-find) ;; Alternative: consult-fd
|
||||||
("M-s c" . consult-locate)
|
("M-g c" . consult-locate)
|
||||||
("M-s g" . consult-grep)
|
("M-g G" . consult-git-grep)
|
||||||
("M-s G" . consult-git-grep)
|
("M-g r" . consult-ripgrep)
|
||||||
("M-s r" . consult-ripgrep)
|
("M-g l" . consult-line)
|
||||||
("M-s l" . consult-line)
|
("M-g L" . consult-line-multi)
|
||||||
("M-s L" . consult-line-multi)
|
("M-g k" . consult-keep-lines)
|
||||||
("M-s k" . consult-keep-lines)
|
("M-g u" . consult-focus-lines)
|
||||||
("M-s u" . consult-focus-lines)
|
|
||||||
("C-x C-r" . consult-recent-file)
|
("C-x C-r" . consult-recent-file)
|
||||||
("C-x C-b" . consult-buffer)
|
("C-x C-b" . consult-buffer)
|
||||||
|
|
||||||
("M-s e" . consult-isearch-history)
|
("M-g e" . consult-isearch-history)
|
||||||
:map isearch-mode-map
|
:map isearch-mode-map
|
||||||
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
|
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
|
||||||
("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
|
("M-g e" . consult-isearch-history) ;; orig. isearch-edit-string
|
||||||
("M-s l" . consult-line) ;; needed by consult-line to detect isearch
|
("M-g l" . consult-line) ;; needed by consult-line to detect isearch
|
||||||
("M-s L" . consult-line-multi))
|
("M-g L" . consult-line-multi))
|
||||||
:hook (completion-list-mode . consult-preview-at-point-mode)
|
:hook (completion-list-mode . consult-preview-at-point-mode)
|
||||||
:init
|
:init
|
||||||
(setq register-preview-delay 0.5
|
(setq register-preview-delay 0.5
|
||||||
|
|||||||
@@ -6,8 +6,10 @@
|
|||||||
;; :config
|
;; :config
|
||||||
;; (require 'smartparens-config))
|
;; (require 'smartparens-config))
|
||||||
|
|
||||||
(setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit)
|
(use-package smartparens
|
||||||
(electric-pair-mode t)
|
:hook (elpaca-after-init . smartparens-global-mode)
|
||||||
|
;; :hook (elpaca-after-init . smartparens-global-strict-mode)
|
||||||
|
:init (sp-use-paredit-bindings))
|
||||||
|
|
||||||
;; Hungry deletion
|
;; Hungry deletion
|
||||||
(use-package hungry-delete
|
(use-package hungry-delete
|
||||||
|
|||||||
Reference in New Issue
Block a user