Port configuration from programming module

This commit is contained in:
Wojciech Kozlowski 2022-04-13 00:55:46 +02:00
parent 28f6ca7dcd
commit b17f98a06a
2 changed files with 40 additions and 1 deletions

View File

@ -65,6 +65,9 @@
:inherit avy-lead-face) :inherit avy-lead-face)
`(avy-lead-face-2 :foreground ,avy-lead-face-2-fg `(avy-lead-face-2 :foreground ,avy-lead-face-2-fg
:inherit avy-lead-face)))) :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 ;; 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'. ;; numbers are disabled. For relative line numbers, set this to `relative'.
@ -233,10 +236,20 @@
:desc "VTerm" "t" #'+vterm/other-window :desc "VTerm" "t" #'+vterm/other-window
:desc "VTerm (same window)" "T" #'+vterm/here))) :desc "VTerm (same window)" "T" #'+vterm/here)))
;; Tab key should indent and absolutely nothing more.
(after! yasnippet
(map! (:map yas-minor-mode-map
"<tab>" nil
"TAB" nil
"<C-return>" #'yas-expand)))
;; ----------------------------------------------------------------------------- ;; -----------------------------------------------------------------------------
;; Configuration for additional packages on top of doom and its modules. ;; 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 ;; A nicer interface for ripgrep. Note that since doom required rg we don't
;; consider the case if it's not installed. ;; consider the case if it's not installed.
@ -253,12 +266,26 @@
"Open the result in other window without changing to it." "Open the result in other window without changing to it."
(interactive) (interactive)
(save-selected-window (deadgrep-visit-result-other-window))) (save-selected-window (deadgrep-visit-result-other-window)))
"<RET>" #'deadgrep-visit-result-other-window))) "RET" #'deadgrep-visit-result-other-window)))
;; Duplicate things. ;; Duplicate things.
(use-package! duplicate-thing (use-package! duplicate-thing
:bind (("M-C" . 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)
("<C-M-return>" . 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. ;; It's the 21st century, a file explorer should be pretty.
(use-package! treemacs-icons-dired (use-package! treemacs-icons-dired
:after dired :after dired
@ -274,6 +301,13 @@
(use-package! x-lib (use-package! x-lib
:defer t) :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. ;; Global configuration.
;; ----------------------------------------------------------------------------- ;; -----------------------------------------------------------------------------
@ -309,6 +343,8 @@
(defalias #'end-of-visual-line #'end-of-line) (defalias #'end-of-visual-line #'end-of-line)
(defalias #'beginning-of-visual-line #'beginning-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. ;; Global keybindings.

View File

@ -12,10 +12,13 @@
:recipe (:local-repo "repos/x-lib")) :recipe (:local-repo "repos/x-lib"))
(package! deadgrep) (package! deadgrep)
(package! duplicate-thing) (package! duplicate-thing)
(package! symbol-overlay)
(package! treemacs-icons-dired) (package! treemacs-icons-dired)
(package! whole-line-or-region) (package! whole-line-or-region)
(package! x-lib (package! x-lib
:recipe (:local-repo "repos/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 ;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here: ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: