SHARE
    TWEET
    DatSudo

    init.el

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

    AltStyle によって変換されたページ (->オリジナル) /