Compare commits
2 Commits
2825456109
...
783069fa5c
| Author | SHA1 | Date | |
|---|---|---|---|
| 783069fa5c | |||
| a8da7548af |
78
init.el
78
init.el
@ -2368,18 +2368,19 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
|
|
||||||
;; * Completion
|
;; * Completion
|
||||||
|
|
||||||
(setq suggest-key-bindings t
|
(setopt suggest-key-bindings t
|
||||||
extended-command-suggest-shorter t
|
extended-command-suggest-shorter t
|
||||||
completions-detailed t
|
completions-detailed t
|
||||||
completion-cycle-threshold nil
|
completion-cycle-threshold nil
|
||||||
completion-styles '(basic orderless)
|
completion-styles '(basic orderless)
|
||||||
completion-category-defaults nil
|
completion-category-defaults nil
|
||||||
;; Via https://protesilaos.com/emacs/dotemacs, with additional changes
|
;; Via https://protesilaos.com/emacs/dotemacs, with additional changes
|
||||||
completion-category-overrides '((file (styles . (basic partial-completion orderless)))
|
completion-category-overrides '((file (styles . (basic partial-completion orderless)))
|
||||||
(buffer (styles . (orderless)))
|
(buffer (styles . (orderless)))
|
||||||
(bookmark (styles . (orderless)))
|
(bookmark (styles . (orderless)))
|
||||||
(imenu (styles . (basic substring orderless)))
|
(imenu (styles . (basic substring orderless)))
|
||||||
(kill-ring (styles . (emacs22 orderless)))))
|
(kill-ring (styles . (emacs22 orderless))))
|
||||||
|
completion-in-region-function #'consult-completion-in-region)
|
||||||
|
|
||||||
(use-package helm
|
(use-package helm
|
||||||
:ensure t
|
:ensure t
|
||||||
@ -2716,7 +2717,6 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
:commands (db/run-or-hide-eshell
|
:commands (db/run-or-hide-eshell
|
||||||
eshell-clear-buffer
|
eshell-clear-buffer
|
||||||
eshell/default-prompt-function
|
eshell/default-prompt-function
|
||||||
eshell-insert-history
|
|
||||||
pcomplete/git))
|
pcomplete/git))
|
||||||
|
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
@ -2740,7 +2740,7 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
("M-P" . eshell-previous-prompt)
|
("M-P" . eshell-previous-prompt)
|
||||||
("M-N" . eshell-next-prompt)
|
("M-N" . eshell-next-prompt)
|
||||||
:map eshell-hist-mode-map
|
:map eshell-hist-mode-map
|
||||||
("M-r" . eshell-insert-history))
|
("M-r" . consult-history))
|
||||||
|
|
||||||
:config (progn
|
:config (progn
|
||||||
|
|
||||||
@ -3050,9 +3050,10 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
|
|
||||||
;; Top-Level Keybindings
|
;; Top-Level Keybindings
|
||||||
|
|
||||||
|
(bind-key "<Scroll_Lock>" 'scroll-lock-mode)
|
||||||
(bind-key "<XF86Back>" #'winner-undo)
|
(bind-key "<XF86Back>" #'winner-undo)
|
||||||
(bind-key "<XF86Forward>" #'winner-redo)
|
(bind-key "<XF86Forward>" #'winner-redo)
|
||||||
(bind-key "<Scroll_Lock>" 'scroll-lock-mode)
|
(bind-key "<f10>" #'magit-status)
|
||||||
(bind-key "<f1>" #'db/run-or-hide-eshell)
|
(bind-key "<f1>" #'db/run-or-hide-eshell)
|
||||||
(bind-key "<f2>" #'db/frequently-used-features-prefix)
|
(bind-key "<f2>" #'db/frequently-used-features-prefix)
|
||||||
(bind-key "<f5>" #'project-find-regexp)
|
(bind-key "<f5>" #'project-find-regexp)
|
||||||
@ -3060,7 +3061,6 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
(bind-key "<f7>" #'dictcc)
|
(bind-key "<f7>" #'dictcc)
|
||||||
(bind-key "<f8>" #'hydra-org-linking/body)
|
(bind-key "<f8>" #'hydra-org-linking/body)
|
||||||
(bind-key "<f9>" #'magit-dispatch)
|
(bind-key "<f9>" #'magit-dispatch)
|
||||||
(bind-key "<f10>" #'magit-status)
|
|
||||||
(bind-key "C-," #'mc/skip-to-previous-like-this)
|
(bind-key "C-," #'mc/skip-to-previous-like-this)
|
||||||
(bind-key "C-." #'mc/skip-to-next-like-this)
|
(bind-key "C-." #'mc/skip-to-next-like-this)
|
||||||
(bind-key "C-;" #'iedit-mode)
|
(bind-key "C-;" #'iedit-mode)
|
||||||
@ -3080,27 +3080,29 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
(bind-key "C-c j" #'avy-goto-char-timer)
|
(bind-key "C-c j" #'avy-goto-char-timer)
|
||||||
(bind-key "C-c l" #'org-store-link)
|
(bind-key "C-c l" #'org-store-link)
|
||||||
(bind-key "C-c m" #'music-control/body)
|
(bind-key "C-c m" #'music-control/body)
|
||||||
|
(bind-key "C-c n c" #'org-roam-capture)
|
||||||
(bind-key "C-c n f" #'org-roam-node-find)
|
(bind-key "C-c n f" #'org-roam-node-find)
|
||||||
(bind-key "C-c n i" #'org-roam-node-insert)
|
(bind-key "C-c n i" #'org-roam-node-insert)
|
||||||
(bind-key "C-c n c" #'org-roam-capture)
|
|
||||||
(bind-key "C-c o" #'hydra-org-custom/body)
|
(bind-key "C-c o" #'hydra-org-custom/body)
|
||||||
(bind-key "C-c r" #'recentf)
|
(bind-key "C-c r" #'recentf)
|
||||||
(bind-key "C-c t" #'hydra-toggle/body)
|
(bind-key "C-c t" #'hydra-toggle/body)
|
||||||
(bind-key "C-h f" #'helpful-callable)
|
|
||||||
(bind-key "C-h o" #'helpful-symbol)
|
|
||||||
(bind-key "C-h v" #'helpful-variable)
|
|
||||||
(bind-key "C-h k" #'helpful-key)
|
|
||||||
(bind-key "C-h x" #'helpful-command)
|
|
||||||
(bind-key "C-h C-f" #'find-function)
|
(bind-key "C-h C-f" #'find-function)
|
||||||
(bind-key "C-h C-k" #'find-function-on-key)
|
(bind-key "C-h C-k" #'find-function-on-key)
|
||||||
(bind-key "C-h C-v" #'find-variable)
|
(bind-key "C-h C-v" #'find-variable)
|
||||||
|
(bind-key "C-h f" #'helpful-callable)
|
||||||
|
(bind-key "C-h k" #'helpful-key)
|
||||||
|
(bind-key "C-h o" #'helpful-symbol)
|
||||||
|
(bind-key "C-h v" #'helpful-variable)
|
||||||
|
(bind-key "C-h x" #'helpful-command)
|
||||||
(bind-key "C-x 4 C-j" #'dired-jump-other-window)
|
(bind-key "C-x 4 C-j" #'dired-jump-other-window)
|
||||||
(bind-key "C-x C-b" #'ibuffer)
|
(bind-key "C-x C-b" #'ibuffer)
|
||||||
(bind-key "C-x C-d" #'dired)
|
(bind-key "C-x C-d" #'dired)
|
||||||
(bind-key "C-x C-j" #'dired-jump)
|
(bind-key "C-x C-j" #'dired-jump)
|
||||||
(bind-key "C-x C-r" #'revert-buffer)
|
(bind-key "C-x C-r" #'revert-buffer)
|
||||||
(bind-key "C-x SPC" #'hydra-rectangle/body)
|
(bind-key "C-x SPC" #'hydra-rectangle/body)
|
||||||
|
(bind-key "C-x b" #'consult-buffer)
|
||||||
(bind-key "C-x g" #'db/shortcuts)
|
(bind-key "C-x g" #'db/shortcuts)
|
||||||
|
(bind-key "C-x o" #'ace-window)
|
||||||
(bind-key "C-x r E" #'db/bookmark-add-external)
|
(bind-key "C-x r E" #'db/bookmark-add-external)
|
||||||
(bind-key "C-x r M" #'db/bookmark-add-url)
|
(bind-key "C-x r M" #'db/bookmark-add-url)
|
||||||
(bind-key "C-x r v" #'list-registers)
|
(bind-key "C-x r v" #'list-registers)
|
||||||
@ -3109,41 +3111,31 @@ Note that this workaround is incomplete, as explained in this comment."
|
|||||||
(bind-key "M-:" #'pp-eval-expression)
|
(bind-key "M-:" #'pp-eval-expression)
|
||||||
(bind-key "M-=" #'count-words)
|
(bind-key "M-=" #'count-words)
|
||||||
(bind-key "M-Z" #'zap-to-char)
|
(bind-key "M-Z" #'zap-to-char)
|
||||||
|
(bind-key "M-g M-g" #'avy-goto-line)
|
||||||
|
(bind-key "M-g g" #'avy-goto-line)
|
||||||
|
(bind-key "M-g i" #'consult-imenu)
|
||||||
(bind-key "M-j" #'(lambda () (interactive) (join-line -1)))
|
(bind-key "M-j" #'(lambda () (interactive) (join-line -1)))
|
||||||
(bind-key "M-z" #'zap-up-to-char)
|
(bind-key "M-z" #'zap-up-to-char)
|
||||||
|
|
||||||
|
(bind-key "M-r" #'consult-history minibuffer-mode-map)
|
||||||
|
(bind-key "C-r" #'consult-history minibuffer-mode-map)
|
||||||
|
|
||||||
(bind-key [remap fill-paragraph] #'endless/fill-or-unfill)
|
(bind-key [remap fill-paragraph] #'endless/fill-or-unfill)
|
||||||
(bind-key [remap keyboard-quit] #'keyboard-quit-context+)
|
(bind-key [remap keyboard-quit] #'keyboard-quit-context+)
|
||||||
|
(bind-key [remap kill-whole-line] #'crux-kill-whole-line)
|
||||||
|
(bind-key [remap open-line] #'crux-smart-open-line-above)
|
||||||
|
|
||||||
(unbind-key "<insert>" global-map)
|
(unbind-key "<insert>" global-map)
|
||||||
(unbind-key "<kp-insert>" global-map)
|
(unbind-key "<kp-insert>" global-map)
|
||||||
(unbind-key "C-x C-c" global-map)
|
(unbind-key "C-x C-c" global-map) ; Quit emacs by calling `save-buffers-kill-emacs' directly
|
||||||
(unbind-key "M-o" global-map)
|
(unbind-key "M-o" global-map)
|
||||||
|
|
||||||
;; Overwrite certain keybindings only if packages are avilable
|
|
||||||
|
|
||||||
(when (package-installed-p 'helm)
|
(when (package-installed-p 'helm)
|
||||||
;; Explicitly require helm, because autoloading is difficult with helm's
|
;; Explicitly require helm, because autoloading is difficult with helm's
|
||||||
;; separate `helm-command-prefix-key' mechanism.
|
;; separate `helm-command-prefix-key' mechanism.
|
||||||
(require 'helm)
|
(require 'helm)
|
||||||
(bind-key helm-command-prefix-key #'helm-command-prefix))
|
(bind-key helm-command-prefix-key #'helm-command-prefix))
|
||||||
|
|
||||||
(when (package-installed-p 'crux)
|
|
||||||
(bind-key [remap kill-whole-line] #'crux-kill-whole-line)
|
|
||||||
(bind-key [remap open-line] #'crux-smart-open-line-above))
|
|
||||||
|
|
||||||
(when (package-installed-p 'ace-window)
|
|
||||||
(bind-key "C-x o" #'ace-window))
|
|
||||||
|
|
||||||
(when (package-installed-p 'avy)
|
|
||||||
(bind-key "M-g M-g" #'avy-goto-line)
|
|
||||||
(bind-key "M-g g" #'avy-goto-line))
|
|
||||||
|
|
||||||
(when (package-installed-p 'consult)
|
|
||||||
(bind-key "M-g i" #'consult-imenu)
|
|
||||||
(bind-key "C-x b" #'consult-buffer)
|
|
||||||
(setq completion-in-region-function #'consult-completion-in-region)
|
|
||||||
(bind-key "M-r" #'consult-history eshell-hist-mode-map)
|
|
||||||
(bind-key "M-r" #'consult-history minibuffer-mode-map)
|
|
||||||
(bind-key "C-r" #'consult-history minibuffer-mode-map))
|
|
||||||
|
|
||||||
;; Environment Variables
|
;; Environment Variables
|
||||||
|
|
||||||
|
|||||||
@ -170,13 +170,6 @@ formatting."
|
|||||||
(if (zerop (user-uid)) "#" "$")
|
(if (zerop (user-uid)) "#" "$")
|
||||||
(propertize " " 'face '(:weight bold)))))
|
(propertize " " 'face '(:weight bold)))))
|
||||||
|
|
||||||
(defun eshell-insert-history ()
|
|
||||||
"Displays the eshell history to select and insert back into your eshell."
|
|
||||||
;; directly taken from Howard Abrams
|
|
||||||
(interactive)
|
|
||||||
(insert (completing-read "Eshell history: "
|
|
||||||
(seq-uniq (ring-elements eshell-history-ring)))))
|
|
||||||
|
|
||||||
|
|
||||||
;; Git Completion
|
;; Git Completion
|
||||||
;; https://tsdh.wordpress.com/2013/05/31/eshell-completion-for-git-bzr-and-hg/
|
;; https://tsdh.wordpress.com/2013/05/31/eshell-completion-for-git-bzr-and-hg/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user