Add D lang support
This commit is contained in:
parent
0ac51f25a2
commit
0160797694
1 changed files with 15 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
;;; This file contains various Emacs modes that I use.
|
;;; This file contains various Emacs modes that I use.
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(require 'lsp-mode)
|
(require 'lsp-mode)
|
||||||
|
(require 'flycheck)
|
||||||
;; Language modes + configurations
|
;; Language modes + configurations
|
||||||
(require 'eglot)
|
(require 'eglot)
|
||||||
(use-package typescript-mode
|
(use-package typescript-mode
|
||||||
|
@ -42,20 +43,32 @@
|
||||||
;; No config modes
|
;; No config modes
|
||||||
(use-package json-mode)
|
(use-package json-mode)
|
||||||
(use-package yaml-mode)
|
(use-package yaml-mode)
|
||||||
|
(use-package d-mode)
|
||||||
|
|
||||||
;; eglot mode hooks
|
;; eglot mode hooks
|
||||||
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd"))
|
(add-to-list 'eglot-server-programs
|
||||||
|
`(c-mode . ("clangd" "--include" "/usr/include/")))
|
||||||
|
(add-to-list 'eglot-server-programs
|
||||||
|
`(c++-mode . ("clangd" "--include" "/usr/include/")))
|
||||||
(add-hook 'c-mode-hook 'eglot-ensure)
|
(add-hook 'c-mode-hook 'eglot-ensure)
|
||||||
(add-hook 'c++-mode-hook 'eglot-ensure)
|
(add-hook 'c++-mode-hook 'eglot-ensure)
|
||||||
|
(add-hook 'd-mode-hook 'eglot-ensure)
|
||||||
(add-hook 'typescript-mode 'eglot-ensure)
|
(add-hook 'typescript-mode 'eglot-ensure)
|
||||||
(add-hook 'go-mode 'eglot-ensure)
|
(add-hook 'go-mode 'eglot-ensure)
|
||||||
(add-hook 'clojure-mode 'eglot-ensure)
|
(add-hook 'clojure-mode 'eglot-ensure)
|
||||||
|
|
||||||
|
|
||||||
;; Built-in mode configs
|
;; Built-in mode configs
|
||||||
; Ruby
|
;; Ruby
|
||||||
(add-to-list 'auto-mode-alist
|
(add-to-list 'auto-mode-alist
|
||||||
'("\\.\\(?:cap\\|gemspec\\|irbrc\\|gemrc\\|rake\\|rb\\|ru\\|thor\\)\\'" . ruby-mode))
|
'("\\.\\(?:cap\\|gemspec\\|irbrc\\|gemrc\\|rake\\|rb\\|ru\\|thor\\)\\'" . ruby-mode))
|
||||||
(add-to-list 'auto-mode-alist
|
(add-to-list 'auto-mode-alist
|
||||||
'("\\(?:Brewfile\\|Capfile\\|Gemfile\\|[rR]akefile\\)\\'" . ruby-mode))
|
'("\\(?:Brewfile\\|Capfile\\|Gemfile\\|[rR]akefile\\)\\'" . ruby-mode))
|
||||||
|
;; C/C++
|
||||||
|
(add-hook 'c++-mode-hook
|
||||||
|
(lambda () (setq flycheck-clang-include-path
|
||||||
|
(list (expand-file-name "/usr/include/")))))
|
||||||
|
(add-hook 'c-mode-hook
|
||||||
|
(lambda () (setq flycheck-clang-include-path
|
||||||
|
(list (expand-file-name "/usr/include/")))))
|
||||||
;;; modes.el ends here
|
;;; modes.el ends here
|
||||||
|
|
Loading…
Reference in a new issue