Compare commits

..

No commits in common. "88bc5b3162581c28c787c7f2c64c8874e3a1db53" and "535bdda429dd4340ca9e06ab5ec9949eeca0e545" have entirely different histories.

165
init.el
View File

@ -2012,6 +2012,7 @@ point to the beginning of buffer first."
:init (setq helm-command-prefix-key "C-c h" :init (setq helm-command-prefix-key "C-c h"
helm-input-idle-delay 0.0 helm-input-idle-delay 0.0
helm-buffers-fuzzy-matching t helm-buffers-fuzzy-matching t
helm-mode-fuzzy-match t
helm-autoresize-min-height 20 helm-autoresize-min-height 20
helm-ff-auto-update-initial-value t helm-ff-auto-update-initial-value t
helm-ff-file-name-history-use-recentf t helm-ff-file-name-history-use-recentf t
@ -2029,11 +2030,9 @@ point to the beginning of buffer first."
helm-kill-ring-threshold 0 ; include all yanks in the kill ring helm-kill-ring-threshold 0 ; include all yanks in the kill ring
) )
:config (progn :config (progn
(eval-when-compile (require 'helm-mode)
(require 'helm-mode) (require 'helm-buffers)
(require 'helm-buffers) (require 'helm-ring)
(require 'helm-ring)
(require 'helm-source))
(if (require 'helm-global-bindings nil :no-error) (if (require 'helm-global-bindings nil :no-error)
(progn (progn
@ -2103,7 +2102,7 @@ point to the beginning of buffer first."
(use-package company (use-package company
:commands (company-mode global-company-mode) :commands (company-mode global-company-mode)
:init (setq company-show-quick-access t)) :init (setq company-show-numbers t))
;; * Navigation ;; * Navigation
@ -2117,14 +2116,16 @@ is too slow (in this case, `db/important-document-path' should
eventuelly be set to nil, however)." eventuelly be set to nil, however)."
(interactive "P") (interactive "P")
(eval-when-compile (eval-when-compile
(require 'helm-bookmark)) (require 'helm-bookmark)
(require 'helm-for-files)) ; for helm-source-recentf
(helm :sources (list (helm :sources (list
(helm-make-source "Frequently Used" 'helm-source-sync (helm-make-source "Frequently Used" 'helm-source-sync
:candidates (mapcar #'(lambda (entry) :candidates (mapcar #'(lambda (entry)
(cons (car entry) (cons (car entry)
(caddr entry))) (caddr entry)))
db/frequently-used-features) db/frequently-used-features)
:action '(("Open" . call-interactively))) :action '(("Open" . call-interactively))
:filtered-candidate-transformer #'helm-adaptive-sort)
;; Taken from `helm-buffers-list' ;; Taken from `helm-buffers-list'
(helm-make-source "Buffers" 'helm-source-buffers) (helm-make-source "Buffers" 'helm-source-buffers)
@ -2336,7 +2337,10 @@ eventuelly be set to nil, however)."
:init (setq helm-emms-use-track-description-function t :init (setq helm-emms-use-track-description-function t
helm-emms-default-sources '(helm-source-emms-streams helm-emms-default-sources '(helm-source-emms-streams
helm-source-emms-dired helm-source-emms-dired
helm-source-emms-files))) helm-source-emms-files))
:config (progn
(require 'emms)
(require 'helm-adaptive)))
(use-package image (use-package image
:init (setq image-use-external-converter t)) :init (setq image-use-external-converter t))
@ -2448,90 +2452,87 @@ eventuelly be set to nil, however)."
eshell-highlight-prompt nil eshell-highlight-prompt nil
eshell-cd-on-directory t eshell-cd-on-directory t
eshell-expand-input-functions '(eshell-expand-history-references)) eshell-expand-input-functions '(eshell-expand-history-references))
:config (progn :config (progn (require 'em-prompt)
(eval-when-compile (require 'em-term)
(require 'em-prompt) (require 'em-cmpl)
(require 'em-term) (require 'em-hist)
(require 'em-cmpl)
(require 'em-hist)
(require 'em-glob))
(setenv "PAGER" "cat") (setenv "PAGER" "cat")
(add-to-list 'eshell-command-completions-alist (add-to-list 'eshell-command-completions-alist
'("gunzip" "gz\\'")) '("gunzip" "gz\\'"))
(add-to-list 'eshell-command-completions-alist (add-to-list 'eshell-command-completions-alist
'("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'")) '("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'"))
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook
'with-editor-export-editor) 'with-editor-export-editor)
(if (<= emacs-major-version 27) (if (<= emacs-major-version 27)
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook
#'(lambda () #'(lambda ()
(bind-key "C-a" #'eshell-bol eshell-mode-map) (bind-key "C-a" #'eshell-bol eshell-mode-map)
(bind-key "M-r" #'eshell-insert-history eshell-mode-map) (bind-key "M-r" #'eshell-insert-history eshell-mode-map)
(bind-key "M-P" #'eshell-previous-prompt eshell-mode-map) (bind-key "M-P" #'eshell-previous-prompt eshell-mode-map)
(bind-key "M-N" #'eshell-next-prompt eshell-mode-map))) (bind-key "M-N" #'eshell-next-prompt eshell-mode-map)))
;; In Emacs 28.1, eshell's mode maps have been refactored to ;; In Emacs 28.1, eshell's mode maps have been refactored to
;; follow standard extensibility. There's thus no need ;; follow standard extensibility. There's thus no need
;; anymore to use the special hook construction. ;; anymore to use the special hook construction.
(progn (progn
(bind-key "C-a" #'eshell-bol eshell-mode-map) (bind-key "C-a" #'eshell-bol eshell-mode-map)
(bind-key "M-r" #'eshell-insert-history eshell-hist-mode-map) (bind-key "M-r" #'eshell-insert-history eshell-hist-mode-map)
(bind-key "M-P" #'eshell-previous-prompt eshell-mode-map) (bind-key "M-P" #'eshell-previous-prompt eshell-mode-map)
(bind-key "M-N" #'eshell-next-prompt eshell-mode-map))) (bind-key "M-N" #'eshell-next-prompt eshell-mode-map)))
;; Ignoring case when completing file names seems to have a ;; Ignoring case when completing file names seems to have a
;; bug: when a ~ is encountered, it is implicitly expaned by ;; bug: when a ~ is encountered, it is implicitly expaned by
;; `pcomplete-insert-entry, overwriting the prompt as a side ;; `pcomplete-insert-entry, overwriting the prompt as a side
;; effect. Keeping the case as it is does not seem to have ;; effect. Keeping the case as it is does not seem to have
;; this issue. This problem occurs by default only on Windows ;; this issue. This problem occurs by default only on Windows
;; systems (in all flavors), because this is the only time ;; systems (in all flavors), because this is the only time
;; `pcomplete-ignore-case is non-nil by default. ;; `pcomplete-ignore-case is non-nil by default.
(when on-windows (when on-windows
(add-to-list 'eshell-mode-hook (add-to-list 'eshell-mode-hook
#'(lambda () #'(lambda ()
(setq pcomplete-ignore-case nil)))) (setq pcomplete-ignore-case nil))))
;; Sometimes, when completing path names and immediately ;; Sometimes, when completing path names and immediately
;; hitting RET, `completion-in-region-mode' still seems to be ;; hitting RET, `completion-in-region-mode' still seems to be
;; active; this often happens when calling cd. Then, ;; active; this often happens when calling cd. Then,
;; `post-command-hook' still contains ;; `post-command-hook' still contains
;; `completion-in-region--postch', which calls some `pcomplete' ;; `completion-in-region--postch', which calls some `pcomplete'
;; function to determine whether completion mode should exit. ;; function to determine whether completion mode should exit.
;; However, after RET (i.e., `eshell-send-input'), we only have ;; However, after RET (i.e., `eshell-send-input'), we only have
;; an empty prompt, and `pcomplete' just computes all possible ;; an empty prompt, and `pcomplete' just computes all possible
;; functions for completion (doesn't show it, though). This ;; functions for completion (doesn't show it, though). This
;; introduces a noticeable amount of delay, which is annoying. ;; introduces a noticeable amount of delay, which is annoying.
;; Expliticly disabling `completion-in-region-mode' before ;; Expliticly disabling `completion-in-region-mode' before
;; sending input seems to alleviate the problem. ;; sending input seems to alleviate the problem.
(advice-add 'eshell-send-input (advice-add 'eshell-send-input
:before #'(lambda (&rest _) :before #'(lambda (&rest _)
"Disable completion-in-region-mode before sending input." "Disable completion-in-region-mode before sending input."
(when completion-in-region-mode (when completion-in-region-mode
(completion-in-region-mode -1)))) (completion-in-region-mode -1))))
;; After completing partial inputs, pcomplete wants to add an ;; After completing partial inputs, pcomplete wants to add an
;; extra character stored in `pcomplete-termination-string', ;; extra character stored in `pcomplete-termination-string',
;; which is a space by default. When completing paths, this ;; which is a space by default. When completing paths, this
;; leads to spaces being inserted after every directory within ;; leads to spaces being inserted after every directory within
;; the path, which is annoying. We thus set the value of this ;; the path, which is annoying. We thus set the value of this
;; variable locally to an empty string, thus silencing this ;; variable locally to an empty string, thus silencing this
;; bug. A better way to handle this would be to correctly ;; bug. A better way to handle this would be to correctly
;; determine whether the completion is not done yet, by passing ;; determine whether the completion is not done yet, by passing
;; `exact' instead of `finished' to the handlers stored in ;; `exact' instead of `finished' to the handlers stored in
;; `completion-extra-properties'. ;; `completion-extra-properties'.
(defun db/set-empty-pcomplete-termination-string () (defun db/set-empty-pcomplete-termination-string ()
"Locally set `pcomplete-termination-string' to the empty string." "Locally set `pcomplete-termination-string' to the empty string."
(setq-local pcomplete-termination-string "")) (setq-local pcomplete-termination-string ""))
(add-hook 'eshell-mode-hook (add-hook 'eshell-mode-hook
#'db/set-empty-pcomplete-termination-string) #'db/set-empty-pcomplete-termination-string)
(require 'db-eshell))) (require 'db-eshell)))
(use-package with-editor (use-package with-editor
:commands (with-editor-export-editor)) :commands (with-editor-export-editor))