(use-package evil
:init
(setq evil-want-integration t
evil-want-keybinding nil
evil-want-C-u-scroll t
evil-want-C-i-jump nil)
:config
(evil-mode 1)
(evil-global-set-key 'motion "j" 'evil-next-visual-line)
(evil-global-set-key 'motion "k" 'evil-previous-visual-line)
(evil-set-initial-state 'message-buffer-mode 'normal)
(evil-set-initial-state 'dashboard-mode 'normal)
(evil-set-undo-system 'undo-redo))
(use-package evil-collection
:after evil
:ensure t
:config
(evil-collection-init))
(use-package which-key
:defer 0
:diminish which-key-mode
:config
(which-key-mode)
(setq which-key-idle-delay 1))
(use-package lsp-mode
:init
(setq lsp-keymap-prefix "C-c l")
:config
(setq lsp-headerline-breadcrumb-enable nil
lsp-enable-file-watchers nil)
(lsp-enable-which-key-integration t))
(use-package lsp-ui
:hook (lsp-mode . lsp-ui-mode)
:custom
(lsp-ui-doc-position 'bottom))
(setq lsp-ui-doc-frame-mode t
lsp-lens-enable t
lsp-ui-sideline-show-hover nil
lsp-ui-sideline-show-symbol nil
lsp-ui-sideline-show-code-actions nil
lsp-ui-sideline-show-diagnostics t)
(use-package lsp-treemacs
:after lsp)
(use-package lsp-ivy
:after lsp)
(use-package python-mode
:ensure t
:hook (python-mode . lsp-deferred)
:config
(setq python-indent-levels 4))
(use-package pyvenv
:after python-mode
:config
(pyenv-mode 1))
(use-package lsp-pyright
:ensure t
:hook
(python-mode . (lambda () (require 'lsp-pyright) (lsp))))
; TYPESCRIPT
(use-package typescript-mode
:hook (typescript-mode . lsp-deferred)
:config
(setq typescript-indent-level 4))
(use-package ivy
:diminish
:bind (("C-s" . swiper)
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-n" . ivy-next-line)
("C-p" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-p" . ivy-previous-line)
("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map
("C-p" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1))
(use-package ivy-rich
:after ivy
:init
(ivy-rich-mode 1))
(use-package counsel
:bind (("C-M-b" . 'counsel-switch-buffer))
:custom
(counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
:config
(counsel-mode 1))
(use-package ivy-prescient
:after counsel
:custom
(ivy-prescient-enable-filtering nil)
:config
(ivy-prescient-mode 1))
(use-package company
:ensure t
:hook (lsp-mode . company-mode)
:bind (:map company-active-map
("<tab>" . company-complete-selection))
(:map lsp-mode-map
("<tab>" . company-indent-or-complete-common))
:custom
(company-minimum-prefix-length 1)
(company-idle-delay 0.0))
(use-package company-box
:hook (company-mode . company-box-mode))
; enable completion in all buffers
(add-hook 'after-init-hook 'global-company-mode)
; except org mode
(setq company-global-modes '(not org-mode))
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(global-set-key (kbd "C-j") 'evil-window-down)
(global-set-key (kbd "C-k") 'evil-window-up)
(global-set-key (kbd "C-l") 'evil-window-right)
(global-set-key (kbd "C-h") 'evil-window-left)
(keymap-global-unset "M-<mouse-1>")
(keymap-global-unset "M-<mouse-2>")
(keymap-global-unset "M-<mouse-3>")
(keymap-global-unset "M-<drag-mouse-1>")
(keymap-global-unset "M-<down-mouse-1>")
(efs/leader-keys
"t" '(:ignore t :which-key "toggles")
"tt" '(counsel-load-theme :which-key "choose-theme")
"b" '(:ignore t :which-key "buffer")
"bb" '(counsel-switch-buffer :which-key "buffer-switch")
"bd" '(kill-buffer-and-window :which-key "buffer-delete")
"bn" '(next-buffer :which-key "switch-to-next-buffer")
"bp" '(previous-buffer :which-key "switch-to-prev-buffer")
"f" '(:ignore t :which-key "file")
"fv" '(eval-buffer :which-key "eval-file")
"fs" '(save-buffer :which-key "save-file")
"ff" '(find-file :which-key "find-file")
"fn" '(dired-jump :which-key "find-project-file")
"fk" '(:ignore t :which-key "bookmark")
"fkm" '(bookmark-set :which-key "bookmark-current-file")
"fks" '(bookmark-save :which-key "bookmark-save")
"fkb" '(bookmark-jump :which-key "bookmark-jump")
"o" '(:ignore t :which-key "org")
"ol" '(org-insert-link :which-key "insert-link")
"oa" '(org-agenda :which-key "org-agenda")
"v" '(:ignore t :which-key "LSP")
"vr" '(lsp-rename :which-key "rename-symbol")
"vs" '(lsp-treemacs-symbols :which-key "show-symbols")
"vl" '(flycheck-list-errors :which-key "show-diagnostics")
"g" '(:ignore t :which-key "Git")
"gt" '(magit :which-key "Git status")
"p" '(:ignore t :which-key "projectile")
"pp" '(projectile-switch-project :which-key "select-project")
"pf" '(projectile-find-file-in-directory :which-key "select-file-in-project"))
(setq gc-cons-threshold (* 2 1000 1000))