2021-02-21 02:59:11 +00:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
2021-02-20 19:57:40 +00:00
|
|
|
;; IDE features
|
|
|
|
|
|
|
|
;; Company-mode provides inline autocompletion
|
|
|
|
(use-package company
|
2021-02-20 23:23:42 +00:00
|
|
|
:hook (after-init . global-company-mode)
|
|
|
|
:config
|
2021-02-21 16:37:47 +00:00
|
|
|
(setq tab-always-indent 'complete)
|
2021-02-20 23:23:42 +00:00
|
|
|
(evil-collection-company-setup))
|
2021-02-20 19:57:40 +00:00
|
|
|
|
|
|
|
;; Flycheck gives you error squigglies
|
|
|
|
(use-package flycheck
|
|
|
|
:hook (after-init . global-flycheck-mode)
|
|
|
|
:custom
|
|
|
|
(flycheck-disabled-checkers '(emacs-lisp-checkdoc emacs-lisp)))
|
|
|
|
|
|
|
|
;; Quick file overview for supported modes
|
|
|
|
(use-package imenu
|
|
|
|
:straight (:type built-in)
|
|
|
|
:general
|
|
|
|
(leader-map "m" #'imenu))
|
|
|
|
|
|
|
|
;; Find definition/references
|
|
|
|
(use-package xref
|
|
|
|
:straight (:type built-in)
|
2021-02-20 22:49:36 +00:00
|
|
|
:config
|
|
|
|
(evil-collection-xref-setup)
|
2021-02-20 19:57:40 +00:00
|
|
|
:general
|
|
|
|
(normal "M-." #'xref-find-definitions)
|
|
|
|
(normal "M-," #'xref-pop-marker-stack)
|
2021-02-20 22:49:36 +00:00
|
|
|
(normal "M-r" #'xref-find-references)
|
|
|
|
:custom
|
|
|
|
(xref-prompt-for-identifier nil))
|
|
|
|
|
|
|
|
;; Full-on IDE functionality via LSP mode
|
|
|
|
(use-package lsp-mode
|
|
|
|
:hook
|
|
|
|
(python-mode . lsp-deferred)
|
|
|
|
(rust-mode . lsp-deferred)
|
|
|
|
(go-mode . lsp-deferred)
|
|
|
|
(sh-mode . lsp-deferred)
|
2021-02-21 16:37:59 +00:00
|
|
|
:init
|
|
|
|
(which-key-add-keymap-based-replacements global-map
|
|
|
|
"C-c l" '("lsp"))
|
2021-02-20 22:49:36 +00:00
|
|
|
:config
|
|
|
|
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)
|
|
|
|
:custom
|
|
|
|
(lsp-keymap-prefix "C-c l")
|
|
|
|
(lsp-headerline-breadcrumb-enable nil)
|
2021-02-21 16:42:42 +00:00
|
|
|
(lsp-file-watch-threshold 100000))
|
2021-02-20 22:49:36 +00:00
|
|
|
|
|
|
|
(use-package lsp-ui
|
|
|
|
:after lsp)
|
2021-02-20 19:57:40 +00:00
|
|
|
|
2021-02-20 23:23:42 +00:00
|
|
|
;; Some compilation-mode conveniences
|
|
|
|
(use-package compile
|
|
|
|
:straight (:type built-in)
|
|
|
|
:commands compile
|
|
|
|
:config
|
|
|
|
(evil-collection-compile-setup))
|
2021-02-20 23:24:06 +00:00
|
|
|
|
|
|
|
;; Code formatting library
|
|
|
|
(use-package apheleia
|
|
|
|
:straight (apheleia :host github :repo "raxod502/apheleia")
|
|
|
|
:general
|
|
|
|
("C-c f" #'apheleia-format-buffer))
|
|
|
|
|
2021-02-20 19:57:40 +00:00
|
|
|
(provide 'init-ide)
|