From bf174a29f429c385acb1e81e822cae8908c8ff3f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 28 Apr 2022 19:29:15 -0700 Subject: further simplifications --- emacs/custom/my-completion.el | 110 +++++++++++++++++------------------------- emacs/custom/my-eshell.el | 50 ++++++++----------- emacs/init.el | 8 +++ 3 files changed, 74 insertions(+), 94 deletions(-) (limited to 'emacs') diff --git a/emacs/custom/my-completion.el b/emacs/custom/my-completion.el index 005dc81..049007a 100644 --- a/emacs/custom/my-completion.el +++ b/emacs/custom/my-completion.el @@ -4,71 +4,51 @@ ;;; Code: -(require 'use-package) - -(use-package vertico - :ensure t - :init - (vertico-mode) - (vertico-multiform-mode 1) - - (setq vertico-multiform-categories - '((consult-grep buffer))) - - (setq vertico-multiform-commands - '((consult-imenu buffer) - (consult-ripgrep buffer) - (consult-org-heading buffer ) - (consult-outline buffer)))) - -(use-package orderless - :ensure t - :custom - (completion-styles '(orderless basic)) - (completion-category-defaults nil) ) - -(use-package marginalia - :ensure t - :init - (marginalia-mode)) - -(use-package consult - :ensure t - :bind (("C-c h" . consult-history) - ("C-c m" . consult-mode-command) - ("C-x b" . consult-buffer) - ("C-x 4 b" . consult-buffer-other-window) - ("C-x r b" . consult-bookmark) - ("C-x p b" . consult-project-buffer) - ("C-c i" . consult-imenu) - ("C-c f" . consult-git-grep) - ("C-c /" . consult-ripgrep) - ("M-y" . consult-yank-pop) - ("M-g e" . consult-compile-error) - ("M-g f" . consult-flymake) - ("M-g M-g" . consult-goto-line) - ("M-g O" . consult-outline) - ("M-g o" . consult-org-heading) - ("M-g m" . consult-mark) - ("M-g k" . consult-global-mark) - ("M-s l" . consult-line) - ("M-s L" . consult-line-multi) - ;; Isearch integration - ("C-s" . consult-isearch-history) - :map isearch-mode-map - ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string - ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string - ("M-s l" . consult-line) ;; needed by consult-line to detect isearch - ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch - )) - -(use-package corfu - :ensure t - :custom - (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' - (corfu-auto t) ;; Enable auto completion - :init - (corfu-global-mode)) +(require 'vertico) +(require 'vertico-multiform) +(require 'marginalia) +(require 'corfu) + +(setq vertico-multiform-categories + '((consult-grep buffer))) + +(setq vertico-multiform-commands + '((consult-imenu buffer) + (consult-ripgrep buffer) + (consult-org-heading buffer ) + (consult-outline buffer))) + +(setq completion-styles '(orderless basic)) +(setq completion-category-defaults nil) + +(setq corfu-cycle t) ;; Enable cycling for `corfu-next/previous' +(setq corfu-auto t) ;; Enable auto completion + +(vertico-mode) +(vertico-multiform-mode 1) +(marginalia-mode) +(corfu-global-mode) + +(global-set-key (kbd "C-c m") 'consult-mode-command) +(global-set-key (kbd "C-x b") 'consult-buffer) +(global-set-key (kbd "C-x 4 b") 'consult-buffer-other-window) +(global-set-key (kbd "C-x r b") 'consult-bookmark) +(global-set-key (kbd "C-x p b") 'consult-project-buffer) +(global-set-key (kbd "C-c i") 'consult-imenu) +(global-set-key (kbd "C-c f") 'consult-git-grep) +(global-set-key (kbd "C-c /") 'consult-ripgrep) +(global-set-key (kbd "C-c r") 'consult-recent-file) +(global-set-key (kbd "M-y") 'consult-yank-pop) +(global-set-key (kbd "M-g e") 'consult-compile-error) +(global-set-key (kbd "M-g f") 'consult-flymake) +(global-set-key (kbd "M-g M-g") 'consult-goto-line) +(global-set-key (kbd "M-g O") 'consult-outline) +(global-set-key (kbd "M-g o") 'consult-org-heading) +(global-set-key (kbd "M-g m") 'consult-mark) +(global-set-key (kbd "M-g k") 'consult-global-mark) +(global-set-key (kbd "M-s l") 'consult-line) +(global-set-key (kbd "M-s L") 'consult-line-multi) (provide 'my-completion) + ;;; my-completion.el ends here diff --git a/emacs/custom/my-eshell.el b/emacs/custom/my-eshell.el index cb2587f..db2d540 100644 --- a/emacs/custom/my-eshell.el +++ b/emacs/custom/my-eshell.el @@ -4,7 +4,6 @@ ;;; Code: -(require 'use-package) (require 'cl-seq) (require 'vc) (require 'eshell) @@ -139,34 +138,27 @@ append to it, while separating multiple outputs with (add-hook 'eshell-pre-command-hook #'my/eshell-current-command-start nil t) (add-hook 'eshell-post-command-hook #'my/eshell-current-command-stop nil t)) -(use-package eshell - :hook ((eshell-mode . my/eshell-mode-setup) - (eshell-mode . my/eshell-current-command-time-track) - (eshell-mode . eshell-smart-initialize) - (eshell-mode . (lambda () - (setq-local corfu-auto nil) - (corfu-mode)))) - :commands (eshell eshell-command) - :bind (("C-c e h" . my/eshell-here) - ("C-c e e" . my/eshell-export) - :map eshell-mode-map - ("C-o" . my/eshell-open-file-at-point)) - :custom - (eshell-scroll-to-bottom-on-input 'all) - (eshell-error-if-no-glob t) - (eshell-hist-ignoredups t) - (eshell-save-history-on-exit t) - (eshell-cd-on-directory t) - (eshell-prefer-lisp-functions nil) - (eshell-where-to-jump 'begin) - (eshell-review-quick-commands nil) - (eshell-smart-space-goes-to-end t) - (tramp-shell-prompt-pattern "^[^$>\n]*[#$%>] *\\(\[[0-9;]*[a-zA-Z] *\\)*") - (eshell-destroy-buffer-when-process-dies t)) - -(use-package eshell-bookmark - :ensure t - :hook (eshell-mode . eshell-bookmark-setup)) +(global-set-key (kbd "C-c e h") 'my/eshell-here) +(define-key eshell-mode-map (kbd "C-c e e") 'my/eshell-export) +(define-key eshell-mode-map (kbd "C-o") 'my/eshell-open-file-at-point) + +(customize-set-variable 'eshell-scroll-to-bottom-on-input 'all) +(customize-set-variable 'eshell-error-if-no-glob t) +(customize-set-variable 'eshell-hist-ignoredups t) +(customize-set-variable 'eshell-save-history-on-exit t) +(customize-set-variable 'eshell-cd-on-directory t) +(customize-set-variable 'eshell-prefer-lisp-functions nil) +(customize-set-variable 'eshell-where-to-jump 'begin) +(customize-set-variable 'eshell-review-quick-commands nil) +(customize-set-variable 'eshell-smart-space-goes-to-end t) +(customize-set-variable 'tramp-shell-prompt-pattern "^[^$>\n]*[#$%>] *\\(customize-set-variable '\[[0-9;]*[a-zA-Z] *\\)*") +(customize-set-variable 'eshell-destroy-buffer-when-process-dies t) + +(add-hook 'eshell-mode-hook 'my/eshell-mode-setup) +(add-hook 'eshell-mode-hook 'my/eshell-current-command-time-track) +(add-hook 'eshell-mode-hook 'eshell-smart-initialize) +(add-hook 'eshell-mode-hook 'eshell-bookmark-setup) (provide 'my-eshell) + ;;; my-eshell.el ends here diff --git a/emacs/init.el b/emacs/init.el index 6e7fa64..7ca037e 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -15,8 +15,13 @@ "https://melpa.org/packages/")) (defvar my/package-list '(chef-mode + consult + corfu dockerfile-mode eglot + elfeed + elfeed-org + eshell-bookmark exec-path-from-shell git-commit git-link @@ -26,15 +31,18 @@ hcl-mode jq-format magit + marginalia markdown-mode nix-mode notmuch + orderless protobuf-mode rg systemd terraform-doc terraform-mode use-package + vertico which-key yaml-mode yasnippet) -- cgit 1.4.1