Make emacs much more usable as an IDE

Fix C-u in evil
Fix 'region theme
Add editorconfig, flycheck, company, and lsp-mode
This commit is contained in:
outfoxxed 2022-11-30 22:57:41 -08:00
parent 4ef985d7e6
commit 2c12aec78d
No known key found for this signature in database
GPG key ID: 5775F651AC84FFE6
2 changed files with 70 additions and 1 deletions

56
init.el
View file

@ -34,7 +34,7 @@
mouse-wheel-follow-mouse +1
scroll-step 1) ;; C-n C-p scroll step
;;;; Tabs
;; Tabs
(setq custom-tab-width 2)
(defun disable-tabs ()
@ -79,6 +79,11 @@
;; Rainbow-Mode (show hex strings in color)
(use-package rainbow-mode)
;; Editorconfig support
(use-package editorconfig
:config
(editorconfig-mode 1))
;; Treesitter
(use-package tree-sitter
:config
@ -94,6 +99,7 @@
;; Evil (Vim Emulation)
(use-package evil
:init
(setq evil-want-C-u-scroll t)
(setq evil-mode-beyond-eol t)
(setq evil-mode-fine-undo t)
(setq evil-default-state 'emacs)
@ -133,3 +139,51 @@
;; Define jumps with ] and [
(funcall define-jumps "c" "class")
(funcall define-jumps "f" "function")))
;; Explanations for keybindings
(use-package which-key
:config
(which-key-mode +1))
;; On the fly syntax checking
(use-package flycheck)
;; Completions
(use-package company
:init
(setq company-minimum-prefix-length 1)
(setq company-idle-delay 0)
(setq company-selection-wrap-around t)
(setq company-tooltip-align-annotations t)
(setq company-tooltip-flip-when-above t)
(setq company-tooltip-margin 0)
(setq company-show-quick-access 'right)
:config
(setq company-transformers '(delete-consecutive-dups
company-sort-prefer-same-case-prefix
company-sort-by-backend-importance
company-sort-by-occurrence))
(define-key company-active-map (kbd "M-`") #'company-complete-selection)
(define-key company-active-map (kbd "M-n") #'company-select-next)
(define-key company-active-map (kbd "M-p") #'company-select-previous)
(define-key company-active-map (kbd "M-j") #'company-select-next)
(define-key company-active-map (kbd "M-k") #'company-select-previous)
(global-company-mode +1))
;; Lsp
(use-package lsp-mode
:init
(setq lsp-headerline-breadcrumb-enable nil)
(setq lsp-signature-auto-activate nil)
(setq lsp-signature-doc-lines 0)
(setq lsp-ui-doc-show-with-cursor t)
(setq lsp-ui-doc-position 'top)
(setq lsp-ui-doc-delay 0.5)
:config
(evil-define-key 'normal lsp-mode-map (kbd "SPC l") lsp-command-map)
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)
(add-hook 'evil-insert-state-entry-hook #'lsp-signature-activate)
(add-hook 'evil-insert-state-exit-hook #'lsp-signature-stop))
(use-package lsp-ui)
(setq gc-cons-threshold (* 1024 1024 100))
(setq read-process-output-max (* 1024 1024))