From 632bb10313926109e3ce4c54427ae0cf0260fccc Mon Sep 17 00:00:00 2001 From: Baitinq Date: Thu, 22 Feb 2024 23:34:30 +0100 Subject: Dotfiles: Emacs: Start rewriting config --- dotfiles/.emacs.new | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 dotfiles/.emacs.new diff --git a/dotfiles/.emacs.new b/dotfiles/.emacs.new new file mode 100644 index 0000000..5dedbff --- /dev/null +++ b/dotfiles/.emacs.new @@ -0,0 +1,128 @@ +;; bootstrap straight start +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 6)) + (unless (file-exists-p bootstrap-file) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp))) + (load bootstrap-file nil 'nomessage)) + +(use-package straight + :custom + (straight-use-package-by-default t)) +;; bootstrap straight end + +(use-package evil + :ensure t + :init + (setq evil-want-integration t) ;; This is optional since it's already set to t by default. + (setq evil-want-keybinding nil) + :config + (evil-mode 1)) + +(use-package evil-collection + :after evil + :ensure t + :config + (evil-collection-init)) + +(use-package doom-themes + :ensure t ) +(setq doom-themes-enable-bold t + doom-themes-enable-italic t) +(load-theme 'doom-one t) + +(defun my/setup-font-faces () +(when (display-graphic-p) + (set-face-attribute 'default nil + :font "Inconsolata LGC Nerd Font 11" + :weight 'medium) + ) +) + +(defun my/on-init () + (my/setup-font-faces) +) + +(add-hook 'after-init-hook 'my/on-init) +(add-hook 'server-after-make-frame-hook 'my/on-init) + +(setq default-line-spacing 0.10) + +(setq make-backup-files nil) +(setq create-lockfiles nil) +(setq warning-minimum-level :error) +(setq inhibit-startup-screen t) + +;; Disable toolbar, menubar and scrollbar +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) + +(use-package doom-modeline + :ensure t + :init (doom-modeline-mode 1)) + +;; One line scrolling +(setq scroll-step 1) +(setq scroll-conservatively 10000) + +(global-display-line-numbers-mode) + +(global-visual-line-mode t) + +(use-package dashboard + :ensure t + :init + (setq dashboard-banner-logo-title "Welcome to Emacs Dashboard") + (setq dashboard-center-content nil) + (setq dashboard-items '((recents . 5) + (bookmarks . 5) + (projects . 5) + (agenda . 5) + (registers . 5))) + (setq dashboard-set-navigator t) + :config + (dashboard-setup-startup-hook)) + +(setq dashboard-footer-messages '("I showed you my source code, plz respond.")) + +(use-package direnv + :ensure t + :config + (direnv-mode)) + +;; TODO: use corfu? +(use-package company + :ensure t + :after eglot ; this line alone does not help to start company + :hook (eglot-managed-mode . company-mode) ; starts company when eglot is started +) + +(use-package company-box + :ensure t + :hook (company-mode . company-box-mode)) + +(use-package copilot + :straight (:host github :repo "copilot-emacs/copilot.el" :files ("dist" "*.el")) + :ensure t + :config + (add-hook 'prog-mode-hook 'copilot-mode) + (define-key copilot-completion-map (kbd "") 'copilot-accept-completion) + (define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)) + +(use-package rustic + :ensure t + :config + (setq rustic-format-on-save t) + (setq rustic-lsp-client 'eglot)) + +(use-package go-mode + :ensure t + :init + (add-hook 'go-mode-hook 'eglot-ensure)) \ No newline at end of file -- cgit 1.4.1