Emacs_Cfg/init.el
2025-04-01 20:22:31 +02:00

103 lines
2.9 KiB
EmacsLisp

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; THEMES
(use-package doom-themes :ensure t :config (load-theme 'doom-dracula t))
(use-package doom-modeline :ensure t :hook (after-init . doom-modeline-mode))
(use-package all-the-icons :ensure t)
(use-package dashboard
:ensure t
:config
(setq dashboard-banner-logo-title "Sweetmacs !")
(setq dashboard-startup-banner 'logo)
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-set-footer nil)
(dashboard-setup-startup-hook))
;; UI
(use-package company :ensure t :config (global-company-mode))
(use-package flycheck
:ensure t
:config
(add-hook 'after-init-hook #'global-flycheck-mode))
(use-package all-the-icons
:ensure t
:if (display-graphic-p))
;; EVIL
(use-package evil :ensure t :init (setq evil-want-keybinding nil) :config (evil-mode t))
(use-package evil-collection :ensure t :config (evil-collection-init))
(use-package treemacs-evil
:after (treemacs evil)
:ensure t)
;; LSP
(use-package lsp-mode
:ensure t
:config
(lsp-mode t)
(setq lsp-headerline-breadcrumb-enable nil))
(use-package lsp-ui
:ensure t
:after lsp-mode
:config
(setq lsp-ui-doc-enable nil)
(setq lsp-ui-doc-show-with-mouse nil)
(setq lsp-ui-doc-show-with-cursor t)
(setq lsp-ui-doc-position 'bottom)
(setq lsp-ui-doc-alignment 'frame))
(use-package lsp-pyright
:ensure t
:custom (lsp-pyright-langserver-command "pyright") ;; or basedpyright
:hook (python-ts-mode . (lambda ()
(require 'lsp-pyright)
(lsp)))) ; or lsp-deferred
(use-package company-quickhelp
:ensure t
:after company
:hook (company-mode . company-quickhelp-mode)
:config)
(use-package magit :ensure t)
;; MODES
(use-package rustic
:ensure t
:config
(setq rustic-format-on-save nil)
:custom
(rustic-cargo-use-last-stored-arguments t))
(use-package astro-ts-mode :ensure t)
(setq major-mode-remap-alist
'((python-mode . python-ts-mode)))
;; OTHER
(use-package treemacs-projectile
:after (treemacs projectile)
:ensure t)
;; E-GEX configuration
(use-package emacs :init (setq inhibit-startup-message t)
:config
(set-frame-font "jetbrains mono 12" nil t)
(menu-bar-mode 0)
(tool-bar-mode 0)
(set-scroll-bar-mode nil)
(setq backup-directory-alist
`(("." . ,(concat user-emacs-directory "backups"))))
(setq treesit-language-source-alist
'((astro "https://github.com/virchau13/tree-sitter-astro")
(css "https://github.com/tree-sitter/tree-sitter-css")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
(python "https://github.com/tree-sitter/tree-sitter-python")
(rust "https://github.com/tree-sitter/tree-sitter-rust"))))