|
|
|
;; Default mode definitions.
|
|
|
|
|
|
|
|
;; Flycheck is enabled globally.
|
|
|
|
(use-package flycheck
|
|
|
|
:ensure t
|
|
|
|
:hook ((after-init . global-flycheck-mode)))
|
|
|
|
|
|
|
|
(use-package projectile
|
|
|
|
:ensure t
|
|
|
|
:bind-keymap
|
|
|
|
("C-c p" . projectile-command-map))
|
|
|
|
|
|
|
|
(use-package lsp-mode
|
|
|
|
:ensure t
|
|
|
|
:hook ((python-mode . lsp-deferred)
|
|
|
|
(ruby-mode . lsp-deferred)
|
|
|
|
(c-mode . lsp-deferred)
|
|
|
|
(c++-mode . lsp-deferred)))
|
|
|
|
|
|
|
|
(use-package lsp-ui
|
|
|
|
:ensure t
|
|
|
|
:after lsp
|
|
|
|
:hook ((lsp-mode . lsp-ui-mode))
|
|
|
|
:config
|
|
|
|
(setq lsp-ui-doc-enable t)
|
|
|
|
(setq lsp-ui-doc-show-with-cursor t)
|
|
|
|
(setq lsp-ui-doc-show-with-mouse t))
|
|
|
|
|
|
|
|
;; Way better syntax highlighting for many languages
|
|
|
|
;; Emacs 29 supports this natively.
|
|
|
|
(if (version<= emacs-version "29")
|
|
|
|
(progn
|
|
|
|
(use-package tree-sitter
|
|
|
|
:ensure t
|
|
|
|
:init
|
|
|
|
(global-tree-sitter-mode)
|
|
|
|
:hook ((tree-sitter-after-on . tree-sitter-hl-mode)))
|
|
|
|
(use-package tree-sitter-langs
|
|
|
|
:ensure t))
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Company is enabled globally.
|
|
|
|
(use-package company
|
|
|
|
:ensure t
|
|
|
|
:hook ((after-init . global-company-mode))
|
|
|
|
:config ;; backend setting must be done only after load.
|
|
|
|
(push 'company-files company-backends)
|
|
|
|
(push 'company-keywords company-backends)
|
|
|
|
(push 'company-capf company-backends))
|
|
|
|
|
|
|
|
(with-eval-after-load 'magit-mode
|
|
|
|
(add-hook 'after-save-hook 'magit-after-save-refresh-status t))
|