Fix keybinding conflict and remove dead Corfu code

- Change C-c r to C-c R for crux-rename-buffer-and-file to avoid
  conflict with consult-ripgrep-project-root
- Remove unused corfu and cape from package list, add company instead
- Remove dead Corfu/Cape integration code from init-eglot.el
- Include related indentation and formatting settings cleanup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jens Luedicke
2025-12-12 10:25:51 +01:00
parent 3a22e1e294
commit ba8b24b1d9
3 changed files with 83 additions and 21 deletions

View File

@@ -31,8 +31,7 @@
marginalia ; Rich annotations in minibuffer marginalia ; Rich annotations in minibuffer
embark ; Contextual actions embark ; Contextual actions
embark-consult ; Embark integration with Consult embark-consult ; Embark integration with Consult
corfu ; In-buffer completion popup company ; In-buffer completion (configured in init-completion.el)
cape ; Completion extensions for Corfu
;; Markdown & Notes ;; Markdown & Notes
markdown-mode markdown-toc grip-mode markdown-mode markdown-toc grip-mode
@@ -55,14 +54,14 @@
;; God mode for modal editing ;; God mode for modal editing
god-mode god-mode
;; Quality of life improvements ;; Quality of life improvements
helpful ; Better help buffers helpful ; Better help buffers
undo-tree ; Visual undo history undo-tree ; Visual undo history
smartparens ; Better than electric-pair-mode smartparens ; Better than electric-pair-mode
crux ; Collection of useful functions crux ; Collection of useful functions
ace-window ; Quick window switching ace-window ; Quick window switching
;; Terminal emulator ;; Terminal emulator
eat ; Emacs terminal emulator eat ; Emacs terminal emulator
)) ))
@@ -96,6 +95,75 @@
;;; General Settings ;;; General Settings
(setq-default indent-tabs-mode nil) (setq-default indent-tabs-mode nil)
(setq tab-width 4) (setq tab-width 4)
;; Set standard indentation offset for all modes
(setq-default standard-indent 4)
;; Mode-specific indentation settings (4 spaces)
(setq-default
;; JavaScript
js-indent-level 4
js2-basic-offset 4
js3-indent-level 4
;; TypeScript
typescript-indent-level 4
;; CSS/SCSS
css-indent-offset 4
scss-indent-offset 4
;; HTML/XML
sgml-basic-offset 4
nxml-child-indent 4
;; Shell scripts
sh-basic-offset 4
sh-indentation 4
;; Lisp
lisp-indent-offset 4
;; Other languages
perl-indent-level 4
cperl-indent-level 4
ruby-indent-level 4
rust-indent-offset 4
scala-indent:step 4
coffee-tab-width 4
lua-indent-level 4
go-ts-mode-indent-offset 4
;; C/C++ Allman style
c-basic-offset 4)
;; C/C++ style configuration - Allman/BSD style with braces on new lines
(setq c-default-style '((c-mode . "bsd")
(c++-mode . "bsd")
(java-mode . "java")
(awk-mode . "awk")
(other . "bsd")))
;; Ensure C/C++ modes use Allman style
(with-eval-after-load 'cc-mode
(defun apply-c-allman-style ()
"Ensure Allman style is applied to C/C++ buffers."
(c-set-style "bsd")
(setq c-basic-offset 4
indent-tabs-mode nil))
(add-hook 'c-mode-hook #'apply-c-allman-style)
(add-hook 'c++-mode-hook #'apply-c-allman-style))
;; Web-mode indentation (for HTML/JSX/TSX files)
(with-eval-after-load 'web-mode
(setq web-mode-markup-indent-offset 4
web-mode-css-indent-offset 4
web-mode-code-indent-offset 4
web-mode-attr-indent-offset 4
web-mode-script-padding 4
web-mode-style-padding 4))
(setq inhibit-startup-screen t) (setq inhibit-startup-screen t)
(setq ring-bell-function 'ignore) (setq ring-bell-function 'ignore)
@@ -149,4 +217,4 @@
(message "Desktop restored")))))) (message "Desktop restored"))))))
(provide 'init-core) (provide 'init-core)
;;; init-core.el ends here ;;; init-core.el ends here

View File

@@ -61,10 +61,10 @@
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
'(qml-mode . ("qmlls")))) '(qml-mode . ("qmlls"))))
;; Format on save ;; Format on save - DISABLED to prevent reindenting
(defun eglot-format-buffer-on-save () ;; (defun eglot-format-buffer-on-save ()
"Format buffer with eglot before saving." ;; "Format buffer with eglot before saving."
(add-hook 'before-save-hook #'eglot-format-buffer -10 t)) ;; (add-hook 'before-save-hook #'eglot-format-buffer -10 t))
;; Keybindings ;; Keybindings
(define-key eglot-mode-map (kbd "C-c l r") 'eglot-rename) (define-key eglot-mode-map (kbd "C-c l r") 'eglot-rename)
@@ -102,15 +102,8 @@
tsx-ts-mode-hook)) tsx-ts-mode-hook))
(add-hook mode #'eglot-ensure)) (add-hook mode #'eglot-ensure))
;; Integration with Corfu for completion ;; Integration with Company for completion (Company configured in init-completion.el)
(with-eval-after-load 'corfu ;; Eglot automatically uses completion-at-point-functions which Company respects
(setq completion-category-overrides '((eglot (styles orderless))))
(add-hook 'eglot-managed-mode-hook
(lambda ()
(setq-local completion-at-point-functions
(list (cape-super-capf
#'eglot-completion-at-point
#'cape-file))))))
;; Eldoc configuration for better documentation display ;; Eldoc configuration for better documentation display
(with-eval-after-load 'eldoc (with-eval-after-load 'eldoc

View File

@@ -88,7 +88,7 @@
("C-c e" . crux-eval-and-replace) ("C-c e" . crux-eval-and-replace)
("C-c w" . crux-swap-windows) ("C-c w" . crux-swap-windows)
("C-c D" . crux-delete-file-and-buffer) ("C-c D" . crux-delete-file-and-buffer)
("C-c r" . crux-rename-buffer-and-file) ("C-c R" . crux-rename-buffer-and-file)
("C-c t" . crux-visit-term-buffer) ("C-c t" . crux-visit-term-buffer)
("C-c k" . crux-kill-other-buffers) ("C-c k" . crux-kill-other-buffers)
("C-c TAB" . crux-indent-rigidly-and-copy-to-clipboard) ("C-c TAB" . crux-indent-rigidly-and-copy-to-clipboard)
@@ -110,8 +110,9 @@
([remap kill-whole-line] . crux-kill-whole-line) ([remap kill-whole-line] . crux-kill-whole-line)
([remap kill-line] . crux-smart-kill-line)) ([remap kill-line] . crux-smart-kill-line))
:config :config
;; Use crux cleanup on save for programming modes ;; Use crux cleanup on save for programming modes - DISABLED to prevent reindenting
(add-hook 'before-save-hook 'crux-cleanup-buffer-or-region)) ;; (add-hook 'before-save-hook 'crux-cleanup-buffer-or-region)
)
;;; Ace-window - Quick window switching ;;; Ace-window - Quick window switching
(use-package ace-window (use-package ace-window