diff --git a/init.el b/init.el index 84da45c..fe8d060 100644 --- a/init.el +++ b/init.el @@ -91,10 +91,9 @@ ("C-." . enlarge-window-horizontally) ("C-c M-c" . uncomment-region))) -;; example configuration for Consult +;; Example configuration for Consult (use-package consult - :ensure t - ;; Replace bindings. Lazily loaded due by `use-package'. + ;; Replace bindings. Lazily loaded by `use-package'. :bind (;; C-c bindings in `mode-specific-map' ("C-c M-x" . consult-mode-command) ("C-c h" . consult-history) @@ -118,6 +117,7 @@ ("M-y" . consult-yank-pop) ;; orig. yank-pop ;; M-g bindings in `goto-map' ("M-g e" . consult-compile-error) + ("M-g r" . consult-grep-match) ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck ("M-g g" . consult-goto-line) ;; orig. goto-line ("M-g M-g" . consult-goto-line) ;; orig. goto-line @@ -148,22 +148,15 @@ ("M-s" . consult-history) ;; orig. next-matching-history-element ("M-r" . consult-history)) ;; orig. previous-matching-history-element - ;; Enable automatic preview at point in the *Completions* buffer. This is - ;; relevant when you use the default completion UI. - :hook (completion-list-mode . consult-preview-at-point-mode) - ;; The :init configuration is always executed (Not lazy) :init - ;; Optionally configure the register formatting. This improves the register - ;; preview for `consult-register', `consult-register-load', - ;; `consult-register-store' and the Emacs built-ins. - (setq register-preview-delay 0.5 - register-preview-function #'consult-register-format) - - ;; Optionally tweak the register preview window. - ;; This adds thin lines, sorting and hides the mode line of the window. + ;; Tweak the register preview for `consult-register-load', + ;; `consult-register-store' and the built-in commands. This improves the + ;; register formatting, adds thin separator lines, register sorting and hides + ;; the window mode line. (advice-add #'register-preview :override #'consult-register-window) + (setq register-preview-delay 0.5) ;; Use Consult to select xref locations with preview (setq xref-show-xrefs-function #'consult-xref @@ -182,10 +175,10 @@ ;; :preview-key on a per-command basis using the `consult-customize' macro. (consult-customize consult-theme :preview-key '(:debounce 0.2 any) - consult-ripgrep consult-git-grep consult-grep + consult-ripgrep consult-git-grep consult-grep consult-man consult-bookmark consult-recent-file consult-xref - consult--source-bookmark consult--source-file-register - consult--source-recent-file consult--source-project-recent-file + consult-source-bookmark consult-source-file-register + consult-source-recent-file consult-source-project-recent-file ;; :preview-key "M-." :preview-key '(:debounce 0.4 any)) @@ -195,21 +188,7 @@ ;; Optionally make narrowing help available in the minibuffer. ;; You may want to use `embark-prefix-help-command' or which-key instead. - ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help) - - ;; By default `consult-project-function' uses `project-root' from project.el. - ;; Optionally configure a different project root function. - ;;;; 1. project.el (the default) - ;; (setq consult-project-function #'consult--default-project--function) - ;;;; 2. vc.el (vc-root-dir) - ;; (setq consult-project-function (lambda (_) (vc-root-dir))) - ;;;; 3. locate-dominating-file - ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git"))) - ;;;; 4. projectile.el (projectile-project-root) - ;; (autoload 'projectile-project-root "projectile") - ;; (setq consult-project-function (lambda (_) (projectile-project-root))) - ;;;; 5. No project support - ;; (setq consult-project-function nil) + ;; (keymap-set consult-narrow-map (concat consult-narrow-key " ?") #'consult-narrow-help) ) (use-package orderless @@ -288,10 +267,7 @@ :bind(("C-c g" . magit-dispatch) ("C-c f". magit-file-dispatch))) -(use-package d-mode - :ensure t) - -(use-package sdlang-mode +(use-package gruvbox-theme :ensure t) (use-package glsl-mode @@ -303,9 +279,6 @@ (when (executable-find "glslangValidator") (add-to-list 'company-backends 'company-glsl))) -(use-package company-dcd - :ensure t) - (use-package company :ensure t :init (global-company-mode) @@ -321,10 +294,6 @@ :ensure t :init (global-flycheck-mode)) -(use-package flycheck-dmd-dub - :ensure t - :hook (d-mode . flycheck-dmd-dub-set-variables)) - ;; (use-package flycheck-eglot ;; :ensure t ;; :after (flycheck eglot)) @@ -352,10 +321,9 @@ :bind(("C-S-c C-S-c" . mc/edit-lines) ("C-S-c >" . mc/mark-next-like-this) ("C-S-c <" . mc/mark-previous-like-this))) -(use-package json-mode - :custom (js-indent-line 4)) (setq default-tab-width 4) +(setq load-theme 'gruvbox-dark) ;; Cause problem because emacs doesn't allow load non-builtin theme without "trusted" by user. brrr (custom-set-variables ;; custom-set-variables was added by Custom. @@ -364,16 +332,17 @@ ;; If there is more than one, they won't work right. '(c-basic-offset 4) '(custom-buffer-indent 4) - '(custom-enabled-themes '(gruvbox-dark-medium)) '(custom-safe-themes - '("046a2b81d13afddae309930ef85d458c4f5d278a69448e5a5261a5c78598e012" "d445c7b530713eac282ecdeea07a8fa59692c83045bf84dd112dd738c7bcad1d" "ba323a013c25b355eb9a0550541573d535831c557674c8d59b9ac6aa720c21d3" "871b064b53235facde040f6bdfa28d03d9f4b966d8ce28fb1725313731a2bcc8" "7b8f5bbdc7c316ee62f271acf6bcd0e0b8a272fdffe908f8c920b0ba34871d98" default)) + '("2ff9ac386eac4dffd77a33e93b0c8236bb376c5a5df62e36d4bfa821d56e4e20" + default)) '(display-line-numbers t) '(global-flycheck-mode t) '(indent-tabs-mode nil) '(inhibit-startup-screen t) '(menu-bar-mode nil) '(package-selected-packages - '(sdlang-mode company-dcd flycheck-dmd-dub magit company-glsl glsl-mode multiple-cursors markdown-mode d-mode flycheck tree-sitter-langs tree-sitter company consult orderless vertico gruvbox-theme)) + '(company company-glsl consult flycheck glsl-mode gruvbox-theme magit + markdown-mode multiple-cursors orderless vertico)) '(recentf-mode t) '(tab-bar-mode t) '(tab-stop-list nil)