mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-16 20:10:58 +01:00
added c-mode config with LSP support, and added flymake to sh-mode
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -2,11 +2,7 @@
|
||||
auto-save-list
|
||||
backups
|
||||
el-get
|
||||
elpa-27.1
|
||||
elpa-28.2
|
||||
elpa-29.1
|
||||
elpa-29.2
|
||||
elpa-29.3
|
||||
elpa-*.*
|
||||
.eln-cache
|
||||
elpa
|
||||
projectile-bookmarks.eld
|
||||
|
||||
1
init.el
1
init.el
@@ -113,6 +113,7 @@
|
||||
(require 'init-shellscript)
|
||||
(require 'init-perl)
|
||||
(require 'init-go)
|
||||
(require 'init-c)
|
||||
(require 'init-lua)
|
||||
(require 'init-sgml)
|
||||
(require 'init-webmode)
|
||||
|
||||
20
lisp/init-c.el
Normal file
20
lisp/init-c.el
Normal file
@@ -0,0 +1,20 @@
|
||||
;; *** C
|
||||
|
||||
(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))
|
||||
|
||||
(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
|
||||
@@ -7,13 +7,15 @@
|
||||
|
||||
:custom
|
||||
(flymake-no-changes-timeout nil)
|
||||
(flymake-shellcheck-allow-external-files t)
|
||||
|
||||
:init
|
||||
(defun tvd-flymake-install-hooks()
|
||||
(add-hook 'before-save-hook #'flymake-start))
|
||||
(defalias 'check-flymake 'consult-flymake)
|
||||
|
||||
:bind
|
||||
("!" . consult-flymake)
|
||||
;;; ("!" . consult-flymake)
|
||||
|
||||
:config
|
||||
(add-hook 'shell-script-mode-hook #'tvd-flymake-install-hooks))
|
||||
|
||||
Reference in New Issue
Block a user