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:
parent
569c361c59
commit
ff200f4561
59
init.el
59
init.el
|
@ -37,6 +37,9 @@
|
||||||
;; Tabs
|
;; Tabs
|
||||||
(setq custom-tab-width 2)
|
(setq custom-tab-width 2)
|
||||||
|
|
||||||
|
;; Highlight matching parens faster
|
||||||
|
(setq show-paren-delay 0)
|
||||||
|
|
||||||
(defun disable-tabs ()
|
(defun disable-tabs ()
|
||||||
(indent-tabs-mode -1))
|
(indent-tabs-mode -1))
|
||||||
(defun enable-tabs ()
|
(defun enable-tabs ()
|
||||||
|
@ -93,6 +96,7 @@
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:config
|
:config
|
||||||
(define-key prog-mode-map (kbd "C-c p") 'projectile-command-map)
|
(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))
|
(projectile-mode +1))
|
||||||
|
|
||||||
;; File tree (+ related integrations)
|
;; File tree (+ related integrations)
|
||||||
|
@ -129,12 +133,14 @@
|
||||||
;; Evil (Vim Emulation)
|
;; Evil (Vim Emulation)
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:init
|
:init
|
||||||
(setq evil-want-C-u-scroll t)
|
(setq evil-want-C-u-scroll t
|
||||||
(setq evil-mode-beyond-eol t)
|
evil-mode-beyond-eol t
|
||||||
(setq evil-mode-fine-undo t)
|
evil-mode-fine-undo t
|
||||||
(setq evil-default-state 'emacs)
|
evil-default-state 'emacs
|
||||||
(setq evil-undo-system 'undo-redo)
|
evil-undo-system 'undo-redo)
|
||||||
:config
|
: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-set-initial-state 'prog-mode 'normal)
|
||||||
(evil-mode +1))
|
(evil-mode +1))
|
||||||
|
|
||||||
|
@ -176,7 +182,7 @@
|
||||||
:init
|
:init
|
||||||
(setq evil-goggles-duration 0.15)
|
(setq evil-goggles-duration 0.15)
|
||||||
:config
|
:config
|
||||||
(evil-goggles-mode))
|
(evil-goggles-mode +1))
|
||||||
|
|
||||||
;; Explanations for keybindings
|
;; Explanations for keybindings
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
|
@ -189,13 +195,13 @@
|
||||||
;; Completions
|
;; Completions
|
||||||
(use-package company
|
(use-package company
|
||||||
:init
|
:init
|
||||||
(setq company-minimum-prefix-length 1)
|
(setq company-minimum-prefix-length 1
|
||||||
(setq company-idle-delay 0)
|
company-idle-delay 0
|
||||||
(setq company-selection-wrap-around t)
|
company-selection-wrap-around t
|
||||||
(setq company-tooltip-align-annotations t)
|
company-tooltip-align-annotations t
|
||||||
(setq company-tooltip-flip-when-above t)
|
company-tooltip-flip-when-above t
|
||||||
(setq company-tooltip-margin 0)
|
company-tooltip-margin 0
|
||||||
(setq company-show-quick-access 'right)
|
company-show-quick-access 'right)
|
||||||
:config
|
:config
|
||||||
(setq company-transformers '(delete-consecutive-dups
|
(setq company-transformers '(delete-consecutive-dups
|
||||||
company-sort-prefer-same-case-prefix
|
company-sort-prefer-same-case-prefix
|
||||||
|
@ -215,24 +221,29 @@
|
||||||
;; Lsp
|
;; Lsp
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode
|
||||||
:init
|
:init
|
||||||
(setq lsp-headerline-breadcrumb-enable nil)
|
(setq lsp-headerline-breadcrumb-enable nil
|
||||||
(setq lsp-signature-auto-activate nil)
|
lsp-signature-auto-activate nil
|
||||||
(setq lsp-signature-doc-lines 0)
|
lsp-signature-doc-lines 0)
|
||||||
:config
|
: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 'lsp-mode-hook #'lsp-enable-which-key-integration)
|
||||||
(add-hook 'evil-insert-state-entry-hook #'lsp-signature-activate)
|
(add-hook 'evil-insert-state-entry-hook #'lsp-signature-activate)
|
||||||
(add-hook 'evil-insert-state-exit-hook #'lsp-signature-stop))
|
(add-hook 'evil-insert-state-exit-hook #'lsp-signature-stop))
|
||||||
(use-package lsp-ui
|
(use-package lsp-ui
|
||||||
:init
|
:init
|
||||||
(setq lsp-ui-doc-show-with-cursor t)
|
(setq lsp-ui-doc-show-with-cursor t
|
||||||
(setq lsp-ui-doc-position 'top)
|
lsp-ui-doc-position 'top
|
||||||
(setq lsp-ui-doc-delay 0.5)
|
lsp-ui-doc-delay 0.5)
|
||||||
:config
|
: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-definitions] #'lsp-ui-peek-find-definitions)
|
||||||
(define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)
|
(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 l 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 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
|
;; 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 "j") #'lsp-ui-peek--select-next)
|
||||||
(define-key lsp-ui-peek-mode-map (kbd "k") #'lsp-ui-peek--select-prev)
|
(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 "K") #'lsp-ui-peek--select-prev-file)
|
||||||
(define-key lsp-ui-peek-mode-map (kbd "o") #'lsp-ui-peek--goto-xref))
|
(define-key lsp-ui-peek-mode-map (kbd "o") #'lsp-ui-peek--goto-xref))
|
||||||
(use-package lsp-treemacs)
|
(use-package lsp-treemacs)
|
||||||
(setq gc-cons-threshold (* 1024 1024 100))
|
(setq gc-cons-threshold (* 1024 1024 100)
|
||||||
(setq read-process-output-max (* 1024 1024))
|
read-process-output-max (* 1024 1024))
|
||||||
|
|
Loading…
Reference in a new issue