mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-19 13:30:57 +01:00
changes here and there
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user