Fix issues / formatting / keybinds

Fix broken C-u
Fix LSP keys
Fix projectile settings hotkeys not being availible outside of prog mode
This commit is contained in:
outfoxxed 2022-12-01 21:04:32 -08:00
parent 569c361c59
commit ff200f4561
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

59
init.el
View file

@ -37,6 +37,9 @@
;; Tabs
(setq custom-tab-width 2)
;; Highlight matching parens faster
(setq show-paren-delay 0)
(defun disable-tabs ()
(indent-tabs-mode -1))
(defun enable-tabs ()
@ -93,6 +96,7 @@
(use-package projectile
:config
(define-key prog-mode-map (kbd "C-c p") 'projectile-command-map)
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
(projectile-mode +1))
;; File tree (+ related integrations)
@ -129,12 +133,14 @@
;; 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)
(setq evil-undo-system 'undo-redo)
(setq evil-want-C-u-scroll t
evil-mode-beyond-eol t
evil-mode-fine-undo t
evil-default-state 'emacs
evil-undo-system 'undo-redo)
:config
(define-key evil-normal-state-map (kbd "C-u") 'evil-scroll-up)
(define-key evil-visual-state-map (kbd "C-u") 'evil-scroll-up)
(evil-set-initial-state 'prog-mode 'normal)
(evil-mode +1))
@ -176,7 +182,7 @@
:init
(setq evil-goggles-duration 0.15)
:config
(evil-goggles-mode))
(evil-goggles-mode +1))
;; Explanations for keybindings
(use-package which-key
@ -189,13 +195,13 @@
;; 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)
(setq company-minimum-prefix-length 1
company-idle-delay 0
company-selection-wrap-around t
company-tooltip-align-annotations t
company-tooltip-flip-when-above t
company-tooltip-margin 0
company-show-quick-access 'right)
:config
(setq company-transformers '(delete-consecutive-dups
company-sort-prefer-same-case-prefix
@ -215,24 +221,29 @@
;; 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-headerline-breadcrumb-enable nil
lsp-signature-auto-activate nil
lsp-signature-doc-lines 0)
: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
:init
(setq lsp-ui-doc-show-with-cursor t)
(setq lsp-ui-doc-position 'top)
(setq lsp-ui-doc-delay 0.5)
(setq lsp-ui-doc-show-with-cursor t
lsp-ui-doc-position 'top
lsp-ui-doc-delay 0.5)
:config
(define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)
(define-key evil-normal-state-map (kbd "SPC d") #'lsp-ui-peek-find-definitions)
(define-key evil-normal-state-map (kbd "SPC r") #'lsp-ui-peek-find-references)
(define-key evil-normal-state-map (kbd "SPC l d") #'lsp-ui-peek-find-definitions)
(define-key evil-normal-state-map (kbd "SPC l u") #'lsp-ui-peek-find-references)
(define-key evil-normal-state-map (kbd "SPC l r") #'lsp-rename)
(define-key evil-normal-state-map (kbd "SPC l a") #'lsp-execute-code-action)
(define-key evil-normal-state-map (kbd "SPC l = =") #'lsp-format-buffer)
(define-key evil-normal-state-map (kbd "SPC l = r") #'lsp-format-region)
(define-key evil-normal-state-map (kbd "SPC l s q") #'lsp-workspace-shutdown)
(define-key evil-normal-state-map (kbd "SPC l s r") #'lsp-workspace-restart)
;; Controls inside references popup
(define-key lsp-ui-peek-mode-map (kbd "j") #'lsp-ui-peek--select-next)
(define-key lsp-ui-peek-mode-map (kbd "k") #'lsp-ui-peek--select-prev)
@ -240,5 +251,5 @@
(define-key lsp-ui-peek-mode-map (kbd "K") #'lsp-ui-peek--select-prev-file)
(define-key lsp-ui-peek-mode-map (kbd "o") #'lsp-ui-peek--goto-xref))
(use-package lsp-treemacs)
(setq gc-cons-threshold (* 1024 1024 100))
(setq read-process-output-max (* 1024 1024))
(setq gc-cons-threshold (* 1024 1024 100)
read-process-output-max (* 1024 1024))