commit 3389e10dd043c32205c7b142b768b0a22d4f0352 Author: Andre Henriques Date: Fri Mar 24 21:06:41 2023 +0000 Started working on config for emacs diff --git a/OnePiece.gif b/OnePiece.gif new file mode 100644 index 0000000..87f2dcf Binary files /dev/null and b/OnePiece.gif differ diff --git a/init.el b/init.el new file mode 100644 index 0000000..8665f13 --- /dev/null +++ b/init.el @@ -0,0 +1,34 @@ + +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) + +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(require 'use-package) + +; always follow symlinks +; (setq vc-follow-symlinks t) + +; (org-babel-tangle-file "~/.emacs.d/settings.org") + +(org-babel-do-load-languages 'org-babel-load-languages '((emacs-list . nil))) + +(org-babel-load-file "~/.emacs.d/settings.org") + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(custom-safe-themes + '("bfc0b9c3de0382e452a878a1fb4726e1302bf9da20e69d6ec1cd1d5d82f61e3d" default)) + '(package-selected-packages '(evil-mode))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/settings.org b/settings.org new file mode 100644 index 0000000..71a2aca --- /dev/null +++ b/settings.org @@ -0,0 +1,142 @@ +* Looks +** Font +#+begin_src emacs-lisp + (set-frame-font "FiraCode 16" nil t) + (set-fontset-font t '(#x1f000 . #x1faff) (font-spec :family "Myne Noto Color Emoji")) +#+end_src +** Themes +#+begin_src emacs-lisp + (use-package afternoon-theme + :ensure t + :config + (load-theme 'afternoon t) + ) + (use-package modus-themes + :ensure t + :config + ;;(load-theme 'modus-operandi t) + ) +#+end_src +** UI +*** Split vertical defaul +#+begin_src emacs-lisp + (setq split-width-threshold nil) +#+end_src +*** Lines Numbers +#+begin_src emacs-lisp + (setq display-line-numbers 'relative) + (global-display-line-numbers-mode) +#+end_src +*** Dashboard +Set up some config functions + +Configure layout +#+begin_src emacs-lisp + (defun setup-dashboard-looks () + "Config ideas https://github.com/emacs-dashboard/emacs-dashboard" + (evil-define-key 'normal 'dashboard-mode-map (kbd "r") 'dashboard-section-1) + (evil-define-key 'normal 'dashboard-mode-map (kbd "J") 'dashboard-next-section) + (evil-define-key 'normal 'dashboard-mode-map (kbd "K") 'dashboard-previous-section) + (setq dashboard-startup-banner "~/.emacs.d/OnePiece.gif") + (setq dashboard-banner-logo-title "Lets get coddiinnngggg") + (setq dashboard-show-shortcuts t) + (setq dashboard-items '((recents . 5) + (projects . 5))) + (setq dashboard-item-names '(("Recent Files:" . "💫 Recent Files, probably not decent:") + ("Projects:" . "Projects 🆓, probably also not decent:"))) + ;; Curently broken ☣️ + (setq dashboard-center-content nil) + ;;(setq dashboard-set-heading-icons t) + ;;(setq dashboard-set-file-icons t) + (setq dashboard-footer-messages '("Sleepyyyyy 🥱" + "Uhhhh I am lost" + "🆓 Just go watch anime 🆓" + "Compiler Error ☣️ Upssss!" + "❤️ Its Coddiinnnng timee")) + ) +#+end_src + +Evil dashboard setup +#+begin_src emacs-lisp + (defun dashboard-load-function () + (interactive) + (dashboard-next-section 1)) + + (defun evil-dashboard-setup () + (setup-dashboard-looks) + (add-hook 'dashboard-mode-hook 'dashboard-load-function)) +#+end_src + +#+begin_src emacs-lisp + (use-package dashboard + :ensure t + :after (evil) + :config + (evil-dashboard-setup) + (dashboard-setup-startup-hook)) +#+end_src + +* Settings + +* Evil +** Base Functions +#+begin_src emacs-lisp + (defun my-evil-quit (old-fun &rest args) + (if (eq major-mode 'org-src-mode) + (org-edit-src-exit) + (apply old-fun args))) + + (defun my-evil-save (old-fun &rest args) + (if (eq major-mode 'org-src-mode) + (org-edit-src-save) + (apply old-fun args))) + + (advice-add #'evil-save :around #'my-evil-save) + (advice-add #'evil-quit :around #'my-evil-quit) +#+end_src +** Base +#+begin_src emacs-lisp + (use-package evil + :ensure + :after (evil-leader) + :config + (evil-mode 1)) +#+end_src +** Leader +#+begin_src emacs-lisp + (use-package evil-leader + :ensure t + :config + (global-evil-leader-mode) + ; Set leader + (evil-leader/set-leader "") + (evil-leader/set-key + "f" 'find-file + "g" 'magit + "cf" (lambda ()(interactive) (find-file (expand-file-name "~/.emacs.d/settings.org")))) + (evil-leader/set-key-for-mode 'org-mode "is" 'org-insert-structure-template) + (evil-leader/set-key-for-mode 'org-mode "e" 'org-edit-src-code) + ) +#+end_src +** Org Mode +#+begin_src emacs-lisp + (use-package evil-org + :ensure t + :after (org evil) + :hook (org-mode . evil-org-mode)) +#+end_src + +* Projects +** Projectile +#+begin_src emacs-lisp + (use-package projectile + :ensure t + :config + (projectile-mode +1) + (define-key projectile-mode-map (kbd "C-p") 'projectile-command-map)) +#+end_src +** Magit +#+begin_src emacs-lisp + (use-package magit + :ensure t) +#+end_src