Advertisement
DatSudo

init.el

Oct 31st, 2023
1,901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 5.00 KB | None | 0 0
  1. (use-package evil
  2.   :init
  3.   (setq evil-want-integration t
  4.    evil-want-keybinding nil
  5.    evil-want-C-u-scroll t
  6.    evil-want-C-i-jump nil)
  7.   :config
  8.   (evil-mode 1)
  9.   (evil-global-set-key 'motion "j" 'evil-next-visual-line)
  10.   (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
  11.   (evil-set-initial-state 'message-buffer-mode 'normal)
  12.   (evil-set-initial-state 'dashboard-mode 'normal)
  13.   (evil-set-undo-system 'undo-redo))
  14.  
  15. (use-package evil-collection
  16.   :after evil
  17.   :ensure t
  18.   :config
  19.   (evil-collection-init))
  20.  
  21. (use-package which-key
  22.   :defer 0
  23.   :diminish which-key-mode
  24.   :config
  25.   (which-key-mode)
  26.   (setq which-key-idle-delay 1))
  27.  
  28. (use-package lsp-mode
  29.   :init
  30.   (setq lsp-keymap-prefix "C-c l")
  31.   :config
  32.   (setq lsp-headerline-breadcrumb-enable nil
  33.         lsp-enable-file-watchers nil)
  34.   (lsp-enable-which-key-integration t))
  35.  
  36. (use-package lsp-ui
  37.   :hook (lsp-mode . lsp-ui-mode)
  38.   :custom
  39.   (lsp-ui-doc-position 'bottom))
  40.  
  41. (setq lsp-ui-doc-frame-mode t
  42.       lsp-lens-enable t
  43.       lsp-ui-sideline-show-hover nil
  44.       lsp-ui-sideline-show-symbol nil
  45.       lsp-ui-sideline-show-code-actions nil
  46.       lsp-ui-sideline-show-diagnostics t)
  47.  
  48. (use-package lsp-treemacs
  49.   :after lsp)
  50.  
  51. (use-package lsp-ivy
  52.   :after lsp)
  53.  
  54. (use-package python-mode
  55.   :ensure t
  56.   :hook (python-mode . lsp-deferred)
  57.   :config
  58.   (setq python-indent-levels 4))
  59.  
  60. (use-package pyvenv
  61.   :after python-mode
  62.   :config
  63.   (pyenv-mode 1))
  64.  
  65. (use-package lsp-pyright
  66.   :ensure t
  67.   :hook
  68.   (python-mode . (lambda () (require 'lsp-pyright) (lsp))))
  69.  
  70. ; TYPESCRIPT
  71. (use-package typescript-mode
  72.   :hook (typescript-mode . lsp-deferred)
  73.   :config
  74.   (setq typescript-indent-level 4))
  75.  
  76.  
  77.  
  78. (use-package ivy
  79.   :diminish
  80.   :bind (("C-s" . swiper)
  81.          :map ivy-minibuffer-map
  82.          ("TAB" . ivy-alt-done)
  83.          ("C-n" . ivy-next-line)
  84.          ("C-p" . ivy-previous-line)
  85.          :map ivy-switch-buffer-map
  86.          ("C-p" . ivy-previous-line)
  87.          ("C-d" . ivy-switch-buffer-kill)
  88.          :map ivy-reverse-i-search-map
  89.          ("C-p" . ivy-previous-line)
  90.          ("C-d" . ivy-reverse-i-search-kill))
  91.   :config
  92.   (ivy-mode 1))
  93.  
  94. (use-package ivy-rich
  95.   :after ivy
  96.   :init
  97.   (ivy-rich-mode 1))
  98.  
  99. (use-package counsel
  100.   :bind (("C-M-b" . 'counsel-switch-buffer))
  101.   :custom
  102.   (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
  103.   :config
  104.   (counsel-mode 1))
  105.  
  106. (use-package ivy-prescient
  107.   :after counsel
  108.   :custom
  109.   (ivy-prescient-enable-filtering nil)
  110.   :config
  111.   (ivy-prescient-mode 1))
  112.  
  113. (use-package company
  114.   :ensure t
  115.   :hook (lsp-mode . company-mode)
  116.   :bind (:map company-active-map
  117.          ("<tab>" . company-complete-selection))
  118.         (:map lsp-mode-map
  119.          ("<tab>" . company-indent-or-complete-common))
  120.   :custom
  121.   (company-minimum-prefix-length 1)
  122.   (company-idle-delay 0.0))
  123.  
  124. (use-package company-box
  125.   :hook (company-mode . company-box-mode))
  126.  
  127. ; enable completion in all buffers
  128. (add-hook 'after-init-hook 'global-company-mode)
  129. ; except org mode
  130. (setq company-global-modes '(not org-mode))
  131.  
  132.  
  133.  
  134. (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
  135.  
  136. (global-set-key (kbd "C-j") 'evil-window-down)
  137. (global-set-key (kbd "C-k") 'evil-window-up)
  138. (global-set-key (kbd "C-l") 'evil-window-right)
  139. (global-set-key (kbd "C-h") 'evil-window-left)
  140.  
  141. (keymap-global-unset "M-<mouse-1>")
  142. (keymap-global-unset "M-<mouse-2>")
  143. (keymap-global-unset "M-<mouse-3>")
  144. (keymap-global-unset "M-<drag-mouse-1>")
  145. (keymap-global-unset "M-<down-mouse-1>")
  146.  
  147. (efs/leader-keys
  148.   "t" '(:ignore t :which-key "toggles")
  149.   "tt" '(counsel-load-theme :which-key "choose-theme")
  150.  
  151.   "b" '(:ignore t :which-key "buffer")
  152.   "bb" '(counsel-switch-buffer :which-key "buffer-switch")
  153.   "bd" '(kill-buffer-and-window :which-key "buffer-delete")
  154.   "bn" '(next-buffer :which-key "switch-to-next-buffer")
  155.   "bp" '(previous-buffer :which-key "switch-to-prev-buffer")
  156.  
  157.   "f" '(:ignore t :which-key "file")
  158.   "fv" '(eval-buffer :which-key "eval-file")
  159.   "fs" '(save-buffer :which-key "save-file")
  160.   "ff" '(find-file :which-key "find-file")
  161.   "fn" '(dired-jump :which-key "find-project-file")
  162.  
  163.   "fk" '(:ignore t :which-key "bookmark")
  164.   "fkm" '(bookmark-set :which-key "bookmark-current-file")
  165.   "fks" '(bookmark-save :which-key "bookmark-save")
  166.   "fkb" '(bookmark-jump :which-key "bookmark-jump")
  167.  
  168.  
  169.   "o" '(:ignore t :which-key "org")
  170.   "ol" '(org-insert-link :which-key "insert-link")
  171.   "oa" '(org-agenda :which-key "org-agenda")
  172.  
  173.  
  174.   "v" '(:ignore t :which-key "LSP")
  175.   "vr" '(lsp-rename :which-key "rename-symbol")
  176.   "vs" '(lsp-treemacs-symbols :which-key "show-symbols")
  177.   "vl" '(flycheck-list-errors :which-key "show-diagnostics")
  178.  
  179.   "g" '(:ignore t :which-key "Git")
  180.   "gt" '(magit :which-key "Git status")
  181.  
  182.   "p" '(:ignore t :which-key "projectile")
  183.   "pp" '(projectile-switch-project :which-key "select-project")
  184.   "pf" '(projectile-find-file-in-directory :which-key "select-file-in-project"))
  185.  
  186.  
  187.  
  188. (setq gc-cons-threshold (* 2 1000 1000))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement