changes here and there

This commit is contained in:
2025-11-19 09:22:40 +01:00
parent 6a9a4068a0
commit bd42d183bc
9 changed files with 71 additions and 22 deletions

View File

@@ -1,20 +1,32 @@
;; *** C
(use-package c-mode
:ensure nil ;; installed in site-lisp
:defer nil
;; doesn't work in emacs 30 anymore
(when nil (use-package c-mode
:ensure nil ;; installed in site-lisp
:defer nil
:init
(when (fboundp 'lsp-deferred)
(defun lsp-c-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
:init
(when (fboundp 'lsp-deferred)
(defun lsp-c-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
(add-hook 'c-mode-hook #'lsp-deferred)
(add-hook 'c-mode-hook #'lsp-c-install-save-hooks)
(add-hook 'c-mode-hook #'lsp-deferred)
(add-hook 'c-mode-hook #'lsp-c-install-save-hooks)
;; c-mode sets TAB to 'c-indent-line-or-region by default which collides with corfu.
(add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "<tab>") #'indent-for-tab-command)))))
;; c-mode sets TAB to 'c-indent-line-or-region by default which collides with corfu.
(add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "<tab>") #'indent-for-tab-command))))))
(when (fboundp 'lsp-deferred)
(defun lsp-c-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
(add-hook 'c-mode-hook #'lsp-deferred)
(add-hook 'c-mode-hook #'lsp-c-install-save-hooks)
;; c-mode sets TAB to 'c-indent-line-or-region by default which collides with corfu.
(add-hook 'c-mode-hook (lambda () (define-key c-mode-map (kbd "<tab>") #'indent-for-tab-command))))
(provide 'init-c)
;;; init-c.el ends here