From b17f98a06acf21b69e2c9b8fc693372ef1db75d6 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Wed, 13 Apr 2022 00:55:46 +0200 Subject: [PATCH] Port configuration from programming module --- config.el | 38 +++++++++++++++++++++++++++++++++++++- packages.el | 3 +++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/config.el b/config.el index cbb661d..33f67dc 100644 --- a/config.el +++ b/config.el @@ -65,6 +65,9 @@ :inherit avy-lead-face) `(avy-lead-face-2 :foreground ,avy-lead-face-2-fg :inherit avy-lead-face)))) +(after! symbol-overlay + (custom-theme-set-faces! nil + '(symbol-overlay-default-face :inherit hl-line))) ;; This determines the style of line numbers in effect. If set to `nil', line ;; numbers are disabled. For relative line numbers, set this to `relative'. @@ -233,10 +236,20 @@ :desc "VTerm" "t" #'+vterm/other-window :desc "VTerm (same window)" "T" #'+vterm/here))) +;; Tab key should indent and absolutely nothing more. +(after! yasnippet + (map! (:map yas-minor-mode-map + "" nil + "TAB" nil + "" #'yas-expand))) + ;; ----------------------------------------------------------------------------- ;; Configuration for additional packages on top of doom and its modules. ;; ----------------------------------------------------------------------------- +;; Nicer box comments. +(use-package! box-comments + :bind (("C-x C-'" . +x-box-comment/box-comment))) ;; A nicer interface for ripgrep. Note that since doom required rg we don't ;; consider the case if it's not installed. @@ -253,12 +266,26 @@ "Open the result in other window without changing to it." (interactive) (save-selected-window (deadgrep-visit-result-other-window))) - "" #'deadgrep-visit-result-other-window))) + "RET" #'deadgrep-visit-result-other-window))) ;; Duplicate things. (use-package! duplicate-thing :bind (("M-C" . duplicate-thing))) +;; Navigate betweeon occurences of the same symbol. +(use-package! symbol-overlay + :bind (("M-RET" . symbol-overlay-put) + ("M-n" . symbol-overlay-switch-forward) + ("M-p" . symbol-overlay-switch-backward) + ("" . symbol-overlay-remove-all)) + :hook (prog-mode . symbol-overlay-mode) + :config + ;; Since we're reusing colours from orderless which only has four faces. + (setq symbol-overlay-faces '(orderless-match-face-0 + orderless-match-face-1 + orderless-match-face-2 + orderless-match-face-3))) + ;; It's the 21st century, a file explorer should be pretty. (use-package! treemacs-icons-dired :after dired @@ -274,6 +301,13 @@ (use-package! x-lib :defer t) +;; Load `yank-indent' without deferring. +(use-package! yank-indent + :config + (advice-add 'yank :after #'+x-yank-indent-a) + (advice-add 'yank-pop :after #'+x-yank-indent-a) + (advice-add 'consult-yank-pop :after #'+x-yank-indent-a)) + ;; ----------------------------------------------------------------------------- ;; Global configuration. ;; ----------------------------------------------------------------------------- @@ -309,6 +343,8 @@ (defalias #'end-of-visual-line #'end-of-line) (defalias #'beginning-of-visual-line #'beginning-of-line) +;; Enable the fill column indicator. +(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode) ;; ----------------------------------------------------------------------------- ;; Global keybindings. diff --git a/packages.el b/packages.el index 79a0d57..a1ab19a 100644 --- a/packages.el +++ b/packages.el @@ -12,10 +12,13 @@ :recipe (:local-repo "repos/x-lib")) (package! deadgrep) (package! duplicate-thing) +(package! symbol-overlay) (package! treemacs-icons-dired) (package! whole-line-or-region) (package! x-lib :recipe (:local-repo "repos/x-lib")) +(package! yank-indent + :recipe (:local-repo "repos/x-lib")) ;; To install a package directly from a remote git repo, you must specify a ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: