diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 91c7e74b..c6cb11e3 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -70,1970 +70,7 @@ M-x org-bable-tangle #+end_src * Fonts #+begin_src emacs-lisp - (set-face-attribute `default nil :font "JetBrains Mono" :height 125) -#+end_src -* Package setup -#+begin_src emacs-lisp -(require `package) - -(setq package-archives `(("mepla" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) - -(package-initialize) -(unless package-archive-contents - (package-refresh-contents)) - -;; Init package for non-linux -(unless (package-installed-p `use-package) - (package-install `use-package)) - -(require 'use-package) -(setq use-package-always-ensure t) -#+end_src -* Packages -** Command Log Mode -#+begin_src emacs-lisp - (use-package command-log-mode) -#+end_src -** Command Autocompletion Packages -#+begin_src emacs-lisp -;; better search -(use-package swiper) -;; better commands -(use-package counsel) -;; autocompletion on commands (?) -(use-package ivy - :diminish - :bind (("C-s" . swiper) - :map ivy-minibuffer-map - ("TAB" . ivy-alt-done) - ("C-l" . ivy-alt-done) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) - :map ivy-switch-buffer-map - ("C-k" . ivy-previous-line) - ("C-l" . ivy-done) - ("C-d" . ivy-switch-buffer-kill) - :map ivy-reverse-i-search-map - ("C-k" . ivy-previous-line) - ("C-d" . ivy-reverse-i-search-kill)) - :demand - :config - (ivy-mode 1)) -;; better ivy autocompletion -(use-package ivy-rich - :init - (ivy-rich-mode 1)) - -;; counsel M+X -(use-package counsel - :bind (("M-x" . counsel-M-x) - ("C-x b" . counsel-ibuffer) - ("C-x C-f" . counsel-find-file) - :map minibuffer-local-map - ("C-r" . 'counsel-minibuffer-history)) - :config - (setq ivy-inital-inputs-alist nil)) -#+end_src -** Custom Themes -#+begin_src emacs-lisp - (use-package doom-themes - :ensure t - :config - ;; Global settings (defaults) - (setq doom-themes-enable-bold t ; if nil, bold is universally disabled - doom-themes-enable-italic t) ; if nil, italics is universally disabled - ;; load the theme - (load-theme 'doom-dark+ t) - - ;; Enable flashing mode-line on errors - (doom-themes-visual-bell-config)) - ;; Enable custom neotree theme (all-the-icons must be installed!) - ;;(doom-themes-neotree-config) - ;; or for treemacs users - ;;(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme - ;;(doom-themes-treemacs-config) - ;; Corrects (and improves) org-mode's native fontification. - ;;(doom-themes-org-config)) -#+end_src -** Nerd-Fonts (All of the Icons doesnt work for me) -#+begin_src emacs-lisp -(use-package nerd-icons - :custom - ;; "Symbols Nerd Font Mono" is the default and is recommended - ;; but you can use any other Nerd Font if you want - (nerd-icons-font-family "JetBrainsMono NF") - ) -#+end_src -** Rainbow Delimiters -**** TODO find something like this for other languages -#+begin_src emacs-lisp -(use-package rainbow-delimiters - :hook (prog-mode . rainbow-delimiters-mode)) -#+end_src -** Keybinding autocompletion -#+begin_src emacs-lisp -(use-package which-key - :init (which-key-mode) - :diminish which-key-mode - :config - (setq which-key-idle-delay 1)) -#+end_src -** Custom Modeline -#+begin_src emacs-lisp -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :custom ((doom-modeline-height 30))) -#+end_src -** Better help menu -#+begin_src emacs-lisp -(use-package helpful - :ensure t - :custom - (counsel-describe-function-function #'helpful-callable) - (counsel-describe-variable-function #'helpful-variable) - :bind - ([remap describe-function ] . counsel-describe-function) - ([remap describe-command] . helpful-command) - ([remap describe-variable] . counsel-describe-variable) - ([remap describe-key] . helpful-key)) -#+end_src -** General Leader Key -#+begin_src emacs-lisp - (use-package general - :config - (general-create-definer sakomacs/leader-keys - :keymaps `(normal insert visual emacs) - :prefix "SPC" - :global-prefix "C-SPC") - (sakomacs/leader-keys - "t" `(:ignore t :which-key "toggles") - "tt" `(counsel-load-theme :which-key "choose theme") - "e" `(:ignore e :which-key "explorer") - "ee" `(treemacs :which-key "treemacs") - "p" `(:ignore p :which-key "projects") - "pp" `(projectile-switch-project :which-key "open project") - "pk" `(projectile-kill-buffers :which-key "close project") - "o" `(:ignore o :which-key "org") - "oa" `(org-agenda :which-key "agenda") - "g" `(:ignore g :which-key "git") - "gs" `(magit-status :which-key "status"))) -#+end_src -** Emacs-Dashboard -#+begin_src emacs-lisp - (use-package dashboard - :ensure t - :config - (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) - ;; Configuration of Dashboard - (setq dashboard-display-icons-p t) ;; display icons on both GUI and terminal - (setq dashboard-icon-type 'nerd-icons) ;; use `nerd-icons' package - ;; Set the title - (setq dashboard-banner-logo-title "Emacs is vscode for nerds") - ;; Set the banner - (setq dashboard-startup-banner 'official) - ;; center everything - (setq dashboard-center-content t) - ;; jump thing - (setq dashboard-show-shortcuts nil) - (setq dashboard-items '((projects . 5) - (agenda . 5))) - (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) - (setq dashboard-footer-messages '("I think I have Emacs pinky!")) - (dashboard-setup-startup-hook)) -#+end_src -** Evil Mode (vim) -#+begin_src emacs-lisp -(use-package evil - :init - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - :hook (evil-mode . sakomacs/evil-hook) - :ensure t - :demand - :config - (evil-mode 1) - (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) - (define-key evil-insert-state-map (kbd "C-h") `evil-delete-backward-char-and-join) - - ;; visual line motion - (evil-global-set-key 'motion "j" 'evil-next-visual-line) - (evil-global-set-key 'motion "k" 'evil-previous-visual-line) - - (evil-set-initial-state 'messages-buffer-mode 'normal) - (evil-set-initial-state 'dashboard-mode 'normal)) - -;; extra things for Evil -(use-package evil-collection - :after evil - :config - (evil-collection-init)) -#+end_src -** Hydra for scaling text -#+begin_src emacs-lisp -(use-package hydra) -(defhydra hydra-text-scale (:timeout 4) - "scale text" - ("j" text-scale-increase "in") - ("k" text-scale-decrease "out") - ("f" nil "finished" :exit t)) - -(sakomacs/leader-keys - "ts" '(hydra-text-scale/body :which-key "scale text")) -#+end_src -** Helpful for projects -#+begin_src emacs-lisp -(use-package projectile - :diminish projectile-mode - :demand - :config (projectile-mode) - :custom ((projectile-completion-system 'ivy)) - :bind-keymap - ("C-c p" . projectile-command-map) - :init - (when (file-directory-p "~/dev") - (setq projectile-project-search-path '("~/dev"))) - (setq projectile-switch-project-action #'projectile-dired)) - -(use-package counsel-projectile - :config (counsel-projectile-mode)) -#+end_src -** Org-Mode -#+begin_src emacs-lisp - (defun sakomacs/org-mode-setup () - (org-indent-mode) - (variable-pitch-mode 1) - (visual-line-mode 1)) - - (use-package org - :hook (org-mode . sakomacs/org-mode-setup) - :config - (setq org-ellipsis "▼") - (setq org-agenda-start-with-log-mode t) - (setq org-log-done 'time) - (setq org-log-into-drawer t) - - ;; org habits thing - (require 'org-habit) - (add-to-list 'org-modules 'org-habit) - (setq org-habit-graph-column 60) - - ;; archive thingy i forgot - (setq org-refile-targets - '(("archive.org" :maxlevel . 1))) - - ;; save org buffer before refile - (advice-add 'org-refile :after 'org-save-all-org-buffers) - - ;; org agenda files - (setq org-agenda-files - '("~/org/tasks.org" - "~/org/school.org" - "~/org/daily.org" - "~/org/irl.org" - "~/org/work.org")) - - ;; Following - (setq org-return-follows-link t) - - ;; org mode src thing - (require 'org-tempo) - - (add-to-list 'org-structure-template-alist '("sh" . "src shell")) - (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) - (add-to-list 'org-structure-template-alist '("py" . "src python")) - - (setq org-todo-keywords - '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") - (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANCELED(k@)"))) - - (setq org-refile-targets - '(("archive.org" :maxlevel . 1) - ("tasks.org" :maxlevel . 1))) - - ;; Save Org buffers after refiling! - (advice-add 'org-refile :after 'org-save-all-org-buffers) - - (setq org-tag-alist - '((:startgroup) - ; Put mutually exclusive tags here - (:endgroup) - ("@errand" . ?E) - ("@home" . ?H) - ("@work" . ?W) - ("agenda" . ?a) - ("planning" . ?p) - ("publish" . ?P) - ("batch" . ?b) - ("note" . ?n) - ("idea" . ?i))) - - ;; Configure custom agenda views - (setq org-agenda-custom-commands - '(("d" "Dashboard" - ((agenda "" ((org-deadline-warning-days 7))) - (todo "NEXT" - ((org-agenda-overriding-header "Next Tasks"))) - (tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects"))))) - - ("n" "Next Tasks" - ((todo "NEXT" - ((org-agenda-overriding-header "Next Tasks"))))) - - ("W" "Work Tasks" tags-todo "+work-email") - - ;; Low-effort next actions - ("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0" - ((org-agenda-overriding-header "Low Effort Tasks") - (org-agenda-max-todos 20) - (org-agenda-files org-agenda-files))) - - ("w" "Workflow Status" - ((todo "WAIT" - ((org-agenda-overriding-header "Waiting on External") - (org-agenda-files org-agenda-files))) - (todo "REVIEW" - ((org-agenda-overriding-header "In Review") - (org-agenda-files org-agenda-files))) - (todo "PLAN" - ((org-agenda-overriding-header "In Planning") - (org-agenda-todo-list-sublevels nil) - (org-agenda-files org-agenda-files))) - (todo "BACKLOG" - ((org-agenda-overriding-header "Project Backlog") - (org-agenda-todo-list-sublevels nil) - (org-agenda-files org-agenda-files))) - (todo "READY" - ((org-agenda-overriding-header "Ready for Work") - (org-agenda-files org-agenda-files))) - (todo "ACTIVE" - ((org-agenda-overriding-header "Active Projects") - (org-agenda-files org-agenda-files))) - (todo "COMPLETED" - ((org-agenda-overriding-header "Completed Projects") - (org-agenda-files org-agenda-files))) - (todo "CANC" - ((org-agenda-overriding-header "Cancelled Projects") - (org-agenda-files org-agenda-files))))))) - - (setq org-capture-templates - `(("t" "Tasks / Projects") - ("tt" "Task" entry (file+olp "~/Projects/Code/emacs-from-scratch/OrgFiles/Tasks.org" "Inbox") - "* TODO %?\n %U\n %a\n %i" :empty-lines 1) - - ("j" "Journal Entries") - ("jj" "Journal" entry - (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "\n* %<%I:%M %p> - Journal :journal:\n\n%?\n\n" - ;; ,(dw/read-file-as-string "~/Notes/Templates/Daily.org") - :clock-in :clock-resume - :empty-lines 1) - ("jm" "Meeting" entry - (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "* %<%I:%M %p> - %a :meetings:\n\n%?\n\n" - :clock-in :clock-resume - :empty-lines 1) - - ("w" "Workflows") - ("we" "Checking Email" entry (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "* Checking Email :email:\n\n%?" :clock-in :clock-resume :empty-lines 1) - - ("m" "Metrics Capture") - ("mw" "Weight" table-line (file+headline "~/Projects/Code/emacs-from-scratch/OrgFiles/Metrics.org" "Weight") - "| %U | %^{Weight} | %^{Notes} |" :kill-buffer t)))) - - - ;; i need more bullets, i need more bullets, i need more bullets, bigger weapons, bigger weapons, bigger weapons - ;; thanks for the protein sir - (use-package org-bullets - :after org - :hook (org-mode . org-bullets-mode) - :custom - (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) - - ;; word - (defun sakomacs/org-mode-visual-fill () - (setq visual-fill-column-width 100 - visual-fill-column-center-text t) - (visual-fill-column-mode 1)) - - (use-package visual-fill-column - :hook (org-mode . sakomacs/org-mode-visual-fill)) -#+end_src -** Org-Roam -#+begin_src emacs-lisp - (use-package org-roam - :ensure t - :custom - (org-roam-directory "~/org" - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n i" . org-roam-node-insert)) - :config - (org-roam-setup))) -#+end_src -** Treemacs -#+begin_src emacs-lisp - (use-package treemacs - :ensure t - :defer t - :init - (with-eval-after-load 'winum - (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) - :config - (progn - (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) - treemacs-deferred-git-apply-delay 0.5 - treemacs-directory-name-transformer #'identity - treemacs-display-in-side-window t - treemacs-eldoc-display 'simple - treemacs-file-event-delay 2000 - treemacs-file-extension-regex treemacs-last-period-regex-value - treemacs-file-follow-delay 0.2 - treemacs-file-name-transformer #'identity - treemacs-follow-after-init t - treemacs-expand-after-init t - treemacs-find-workspace-method 'find-for-file-or-pick-first - treemacs-git-command-pipe "" - treemacs-goto-tag-strategy 'refetch-index - treemacs-header-scroll-indicators '(nil . "^^^^^^") - treemacs-hide-dot-git-directory t - treemacs-indentation 2 - treemacs-indentation-string " " - treemacs-is-never-other-window nil - treemacs-max-git-entries 5000 - treemacs-missing-project-action 'ask - treemacs-move-forward-on-expand nil - treemacs-no-png-images nil - treemacs-no-delete-other-windows t - treemacs-project-follow-cleanup nil - treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) - treemacs-position 'left - treemacs-read-string-input 'from-child-frame - treemacs-recenter-distance 0.1 - treemacs-recenter-after-file-follow nil - treemacs-recenter-after-tag-follow nil - treemacs-recenter-after-project-jump 'always - treemacs-recenter-after-project-expand 'on-distance - treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") - treemacs-project-follow-into-home nil - treemacs-show-cursor nil - treemacs-show-hidden-files t - treemacs-silent-filewatch nil - treemacs-silent-refresh nil - treemacs-sorting 'alphabetic-asc - treemacs-select-when-already-in-treemacs 'move-back - treemacs-space-between-root-nodes t - treemacs-tag-follow-cleanup t - treemacs-tag-follow-delay 1.5 - treemacs-text-scale nil - treemacs-user-mode-line-format nil - treemacs-user-header-line-format nil - treemacs-wide-toggle-width 70 - treemacs-width 35 - treemacs-width-increment 1 - treemacs-width-is-initially-locked t - treemacs-workspace-switch-cleanup nil) - - ;; The default width and height of the icons is 22 pixels. If you are - ;; using a Hi-DPI display, uncomment this to double the icon size. - ;;(treemacs-resize-icons 44) - - (treemacs-follow-mode t) - (treemacs-tag-follow-mode t) - (treemacs-project-follow-mode t) - (treemacs-filewatch-mode t) - (treemacs-fringe-indicator-mode 'always) - (when treemacs-python-executable - (treemacs-git-commit-diff-mode t)) - - (pcase (cons (not (null (executable-find "git"))) - (not (null treemacs-python-executable))) - (`(t . t) - (treemacs-git-mode 'deferred)) - (`(t . _) - (treemacs-git-mode 'simple))) - - (treemacs-hide-gitignored-files-mode nil)) - :bind - (:map global-map - ("M-0" . treemacs-select-window) - ("C-x t 1" . treemacs-delete-other-windows) - ("C-x t d" . treemacs-select-directory) - ("C-x t B" . treemacs-bookmark) - ("C-x t C-t" . treemacs-find-file) - ("C-x t M-t" . treemacs-find-tag))) - - (use-package treemacs-evil - :after (treemacs evil) - :ensure t) - - (use-package treemacs-projectile - :after (treemacs projectile) - :ensure t) - - (use-package treemacs-magit - :after (treemacs magit) - :ensure t) - -#+end_src -** Dev Packages -*** Magit (git in emacs) -#+begin_src emacs-lisp -(use-package magit - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) -#+end_src -*** Forge for Magit (Adds github, gitlab, etc PRs and Issues to magit) -make sure to setup authinfo -#+begin_src emacs-lisp -(use-package forge - :after magit) -(setq auth-sources '("~/.authinfo")) -#+end_src -*** Direnv -#+begin_src emacs-lisp -(use-package direnv - :config - (direnv-mode)) -#+end_src -*** Lsp-mode -**** Language Servers -#+begin_src emacs-lisp - (defun sakomacs/lsp-mode-setup () - (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) - (lsp-headerline-breadcrumb-mode)) - - (use-package lsp-mode - :commands (lsp lsp-deferred) - :hook (lsp-mode . sakomacs/lsp-mode-setup) - :init - (setq lsp-keymap-prefix "C-c l") - :config - (lsp-enable-which-key-integration t) - (setq lsp-keep-workspace-alive nil)) -#+end_src -**** Lsp-ui -#+begin_src emacs-lisp - (use-package lsp-ui - :hook (lsp-mode . lsp-ui-mode) - :custom - (lsp-ui-doc-position 'bottom)) -#+end_src -**** Treemacs Lsp -#+begin_src emacs-lisp - (use-package lsp-treemacs - :after lsp) -#+end_src -**** lsp-ivy -#+begin_src emacs-lisp -(use-package lsp-ivy) -#+end_src -**** Languages -***** HTML/CSS -#+begin_src emacs-lisp - (use-package web-mode - :hook (web-mode . lsp) - :mode ("\\.html\\'" - "\\.css\\'")) -#+end_src -***** Javascript -#+begin_src emacs-lisp - (use-package js2-mode - :mode "\\.js\\'" - :hook (js2-mode . lsp)) -#+end_src -***** C/C++ -#+begin_src emacs-lisp -(add-hook 'c-mode-hook 'lsp) -(add-hook 'c++-mode-hook 'lsp) -#+end_src -***** CMake -#+begin_src emacs-lisp - (use-package cmake-mode - :mode "CMakeLists.txt" - :hook (cmake-mode . lsp)) -#+end_src -***** Python -#+begin_src emacs-lisp - (use-package python-mode - :mode "\\.py\\'" - :hook (python-mode . lsp)) - - (use-package elpy - :after python-mode - - :custom - (elpy-rpc-python-command "python3") - - :config - (elpy-enable)) -#+end_src -***** Haskell -#+begin_src emacs-lisp - (use-package haskell-mode - :mode "\\.hs\\'" - :hook (python-mode . lsp)) -#+end_src -***** Yaml editing -#+begin_src emacs-lisp - (use-package yaml-mode - :mode ("\\.yaml\\'" - "\\.yml\\'")) -#+end_src -***** Nix -#+begin_src emacs-lisp - (use-package nix-mode - :hook ((nix-mode . lsp) - (nix-mode . format-all-mode) - (nix-mode . (lambda () (setq-local format-all-formatters '(("Nix" alejandra)))))) - :mode "\\.nix\\'") -#+end_src -*** Commenter -#+begin_src emacs-lisp - (use-package evil-nerd-commenter - :bind ("M-/" . evilnc-comment-or-uncomment-lines)) -#+end_src -*** Company Mode (Better Autocompletion) -#+begin_src emacs-lisp -(use-package company - :after lsp-mode - :hook (lsp-mode . company-mode) - :bind (:map company-active-map - ("" . company-complete-selection)) - (:map lsp-mode-map - ("" . company-indent-or-complete-common)) - :custom - (company-minimum-prefix-length 1) - (company-idle-delay 0.0)) - -(use-package company-box - :hook (company-mode . company-box-mode)) -#+end_src -*** Formatting -#+begin_src emacs-lisp -(use-package format-all) -#+end_src -* Fonts -#+begin_src emacs-lisp - (set-face-attribute `default nil :font "JetBrains Mono" :height 125) -#+end_src -* Package setup -#+begin_src emacs-lisp -(require `package) - -(setq package-archives `(("mepla" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) - -(package-initialize) -(unless package-archive-contents - (package-refresh-contents)) - -;; Init package for non-linux -(unless (package-installed-p `use-package) - (package-install `use-package)) - -(require 'use-package) -(setq use-package-always-ensure t) -#+end_src -* Packages -** Command Log Mode -#+begin_src emacs-lisp - (use-package command-log-mode) -#+end_src -** Command Autocompletion Packages -#+begin_src emacs-lisp -;; better search -(use-package swiper) -;; better commands -(use-package counsel) -;; autocompletion on commands (?) -(use-package ivy - :diminish - :bind (("C-s" . swiper) - :map ivy-minibuffer-map - ("TAB" . ivy-alt-done) - ("C-l" . ivy-alt-done) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) - :map ivy-switch-buffer-map - ("C-k" . ivy-previous-line) - ("C-l" . ivy-done) - ("C-d" . ivy-switch-buffer-kill) - :map ivy-reverse-i-search-map - ("C-k" . ivy-previous-line) - ("C-d" . ivy-reverse-i-search-kill)) - :demand - :config - (ivy-mode 1)) -;; better ivy autocompletion -(use-package ivy-rich - :init - (ivy-rich-mode 1)) - -;; counsel M+X -(use-package counsel - :bind (("M-x" . counsel-M-x) - ("C-x b" . counsel-ibuffer) - ("C-x C-f" . counsel-find-file) - :map minibuffer-local-map - ("C-r" . 'counsel-minibuffer-history)) - :config - (setq ivy-inital-inputs-alist nil)) -#+end_src -** Custom Themes -#+begin_src emacs-lisp - (use-package doom-themes - :ensure t - :config - ;; Global settings (defaults) - (setq doom-themes-enable-bold t ; if nil, bold is universally disabled - doom-themes-enable-italic t) ; if nil, italics is universally disabled - ;; load the theme - (load-theme 'doom-dark+ t) - - ;; Enable flashing mode-line on errors - (doom-themes-visual-bell-config)) - ;; Enable custom neotree theme (all-the-icons must be installed!) - ;;(doom-themes-neotree-config) - ;; or for treemacs users - ;;(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme - ;;(doom-themes-treemacs-config) - ;; Corrects (and improves) org-mode's native fontification. - ;;(doom-themes-org-config)) -#+end_src -** Nerd-Fonts (All of the Icons doesnt work for me) -#+begin_src emacs-lisp -(use-package nerd-icons - :custom - ;; "Symbols Nerd Font Mono" is the default and is recommended - ;; but you can use any other Nerd Font if you want - (nerd-icons-font-family "JetBrainsMono NF") - ) -#+end_src -** Rainbow Delimiters -**** TODO find something like this for other languages -#+begin_src emacs-lisp -(use-package rainbow-delimiters - :hook (prog-mode . rainbow-delimiters-mode)) -#+end_src -** Keybinding autocompletion -#+begin_src emacs-lisp -(use-package which-key - :init (which-key-mode) - :diminish which-key-mode - :config - (setq which-key-idle-delay 1)) -#+end_src -** Custom Modeline -#+begin_src emacs-lisp -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :custom ((doom-modeline-height 30))) -#+end_src -** Better help menu -#+begin_src emacs-lisp -(use-package helpful - :ensure t - :custom - (counsel-describe-function-function #'helpful-callable) - (counsel-describe-variable-function #'helpful-variable) - :bind - ([remap describe-function ] . counsel-describe-function) - ([remap describe-command] . helpful-command) - ([remap describe-variable] . counsel-describe-variable) - ([remap describe-key] . helpful-key)) -#+end_src -** General Leader Key -#+begin_src emacs-lisp - (use-package general - :config - (general-create-definer sakomacs/leader-keys - :keymaps `(normal insert visual emacs) - :prefix "SPC" - :global-prefix "C-SPC") - (sakomacs/leader-keys - "t" `(:ignore t :which-key "toggles") - "tt" `(counsel-load-theme :which-key "choose theme") - "e" `(:ignore e :which-key "explorer") - "ee" `(treemacs :which-key "treemacs") - "p" `(:ignore p :which-key "projects") - "pp" `(projectile-switch-project :which-key "open project") - "pk" `(projectile-kill-buffers :which-key "close project") - "o" `(:ignore o :which-key "org") - "oa" `(org-agenda :which-key "agenda") - "g" `(:ignore g :which-key "git") - "gs" `(magit-status :which-key "status"))) -#+end_src -** Emacs-Dashboard -#+begin_src emacs-lisp - (use-package dashboard - :ensure t - :config - (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) - ;; Configuration of Dashboard - (setq dashboard-display-icons-p t) ;; display icons on both GUI and terminal - (setq dashboard-icon-type 'nerd-icons) ;; use `nerd-icons' package - ;; Set the title - (setq dashboard-banner-logo-title "Emacs is vscode for nerds") - ;; Set the banner - (setq dashboard-startup-banner 'official) - ;; center everything - (setq dashboard-center-content t) - ;; jump thing - (setq dashboard-show-shortcuts nil) - (setq dashboard-items '((projects . 5) - (agenda . 5))) - (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) - (setq dashboard-footer-messages '("I think I have Emacs pinky!")) - (dashboard-setup-startup-hook)) -#+end_src -** Evil Mode (vim) -#+begin_src emacs-lisp -(use-package evil - :init - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - :hook (evil-mode . sakomacs/evil-hook) - :ensure t - :demand - :config - (evil-mode 1) - (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) - (define-key evil-insert-state-map (kbd "C-h") `evil-delete-backward-char-and-join) - - ;; visual line motion - (evil-global-set-key 'motion "j" 'evil-next-visual-line) - (evil-global-set-key 'motion "k" 'evil-previous-visual-line) - - (evil-set-initial-state 'messages-buffer-mode 'normal) - (evil-set-initial-state 'dashboard-mode 'normal)) - -;; extra things for Evil -(use-package evil-collection - :after evil - :config - (evil-collection-init)) -#+end_src -** Hydra for scaling text -#+begin_src emacs-lisp -(use-package hydra) -(defhydra hydra-text-scale (:timeout 4) - "scale text" - ("j" text-scale-increase "in") - ("k" text-scale-decrease "out") - ("f" nil "finished" :exit t)) - -(sakomacs/leader-keys - "ts" '(hydra-text-scale/body :which-key "scale text")) -#+end_src -** Helpful for projects -#+begin_src emacs-lisp -(use-package projectile - :diminish projectile-mode - :demand - :config (projectile-mode) - :custom ((projectile-completion-system 'ivy)) - :bind-keymap - ("C-c p" . projectile-command-map) - :init - (when (file-directory-p "~/dev") - (setq projectile-project-search-path '("~/dev"))) - (setq projectile-switch-project-action #'projectile-dired)) - -(use-package counsel-projectile - :config (counsel-projectile-mode)) -#+end_src -** Org-Mode -#+begin_src emacs-lisp - (defun sakomacs/org-mode-setup () - (org-indent-mode) - (variable-pitch-mode 1) - (visual-line-mode 1)) - - (use-package org - :hook (org-mode . sakomacs/org-mode-setup) - :config - (setq org-ellipsis "▼") - (setq org-agenda-start-with-log-mode t) - (setq org-log-done 'time) - (setq org-log-into-drawer t) - - ;; org habits thing - (require 'org-habit) - (add-to-list 'org-modules 'org-habit) - (setq org-habit-graph-column 60) - - ;; archive thingy i forgot - (setq org-refile-targets - '(("archive.org" :maxlevel . 1))) - - ;; save org buffer before refile - (advice-add 'org-refile :after 'org-save-all-org-buffers) - - ;; org agenda files - (setq org-agenda-files - '("~/org/tasks.org" - "~/org/school.org" - "~/org/daily.org" - "~/org/irl.org" - "~/org/work.org")) - - ;; Following - (setq org-return-follows-link t) - - ;; org mode src thing - (require 'org-tempo) - - (add-to-list 'org-structure-template-alist '("sh" . "src shell")) - (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) - (add-to-list 'org-structure-template-alist '("py" . "src python")) - - (setq org-todo-keywords - '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") - (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANCELED(k@)"))) - - (setq org-refile-targets - '(("archive.org" :maxlevel . 1) - ("tasks.org" :maxlevel . 1))) - - ;; Save Org buffers after refiling! - (advice-add 'org-refile :after 'org-save-all-org-buffers) - - (setq org-tag-alist - '((:startgroup) - ; Put mutually exclusive tags here - (:endgroup) - ("@errand" . ?E) - ("@home" . ?H) - ("@work" . ?W) - ("agenda" . ?a) - ("planning" . ?p) - ("publish" . ?P) - ("batch" . ?b) - ("note" . ?n) - ("idea" . ?i))) - - ;; Configure custom agenda views - (setq org-agenda-custom-commands - '(("d" "Dashboard" - ((agenda "" ((org-deadline-warning-days 7))) - (todo "NEXT" - ((org-agenda-overriding-header "Next Tasks"))) - (tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects"))))) - - ("n" "Next Tasks" - ((todo "NEXT" - ((org-agenda-overriding-header "Next Tasks"))))) - - ("W" "Work Tasks" tags-todo "+work-email") - - ;; Low-effort next actions - ("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0" - ((org-agenda-overriding-header "Low Effort Tasks") - (org-agenda-max-todos 20) - (org-agenda-files org-agenda-files))) - - ("w" "Workflow Status" - ((todo "WAIT" - ((org-agenda-overriding-header "Waiting on External") - (org-agenda-files org-agenda-files))) - (todo "REVIEW" - ((org-agenda-overriding-header "In Review") - (org-agenda-files org-agenda-files))) - (todo "PLAN" - ((org-agenda-overriding-header "In Planning") - (org-agenda-todo-list-sublevels nil) - (org-agenda-files org-agenda-files))) - (todo "BACKLOG" - ((org-agenda-overriding-header "Project Backlog") - (org-agenda-todo-list-sublevels nil) - (org-agenda-files org-agenda-files))) - (todo "READY" - ((org-agenda-overriding-header "Ready for Work") - (org-agenda-files org-agenda-files))) - (todo "ACTIVE" - ((org-agenda-overriding-header "Active Projects") - (org-agenda-files org-agenda-files))) - (todo "COMPLETED" - ((org-agenda-overriding-header "Completed Projects") - (org-agenda-files org-agenda-files))) - (todo "CANC" - ((org-agenda-overriding-header "Cancelled Projects") - (org-agenda-files org-agenda-files))))))) - - (setq org-capture-templates - `(("t" "Tasks / Projects") - ("tt" "Task" entry (file+olp "~/Projects/Code/emacs-from-scratch/OrgFiles/Tasks.org" "Inbox") - "* TODO %?\n %U\n %a\n %i" :empty-lines 1) - - ("j" "Journal Entries") - ("jj" "Journal" entry - (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "\n* %<%I:%M %p> - Journal :journal:\n\n%?\n\n" - ;; ,(dw/read-file-as-string "~/Notes/Templates/Daily.org") - :clock-in :clock-resume - :empty-lines 1) - ("jm" "Meeting" entry - (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "* %<%I:%M %p> - %a :meetings:\n\n%?\n\n" - :clock-in :clock-resume - :empty-lines 1) - - ("w" "Workflows") - ("we" "Checking Email" entry (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "* Checking Email :email:\n\n%?" :clock-in :clock-resume :empty-lines 1) - - ("m" "Metrics Capture") - ("mw" "Weight" table-line (file+headline "~/Projects/Code/emacs-from-scratch/OrgFiles/Metrics.org" "Weight") - "| %U | %^{Weight} | %^{Notes} |" :kill-buffer t)))) - - - ;; i need more bullets, i need more bullets, i need more bullets, bigger weapons, bigger weapons, bigger weapons - ;; thanks for the protein sir - (use-package org-bullets - :after org - :hook (org-mode . org-bullets-mode) - :custom - (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) - - ;; word - (defun sakomacs/org-mode-visual-fill () - (setq visual-fill-column-width 100 - visual-fill-column-center-text t) - (visual-fill-column-mode 1)) - - (use-package visual-fill-column - :hook (org-mode . sakomacs/org-mode-visual-fill)) -#+end_src -** Org-Roam -#+begin_src emacs-lisp - (use-package org-roam - :ensure t - :custom - (org-roam-directory "~/org" - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n i" . org-roam-node-insert)) - :config - (org-roam-setup))) -#+end_src -** Treemacs -#+begin_src emacs-lisp - (use-package treemacs - :ensure t - :defer t - :init - (with-eval-after-load 'winum - (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) - :config - (progn - (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) - treemacs-deferred-git-apply-delay 0.5 - treemacs-directory-name-transformer #'identity - treemacs-display-in-side-window t - treemacs-eldoc-display 'simple - treemacs-file-event-delay 2000 - treemacs-file-extension-regex treemacs-last-period-regex-value - treemacs-file-follow-delay 0.2 - treemacs-file-name-transformer #'identity - treemacs-follow-after-init t - treemacs-expand-after-init t - treemacs-find-workspace-method 'find-for-file-or-pick-first - treemacs-git-command-pipe "" - treemacs-goto-tag-strategy 'refetch-index - treemacs-header-scroll-indicators '(nil . "^^^^^^") - treemacs-hide-dot-git-directory t - treemacs-indentation 2 - treemacs-indentation-string " " - treemacs-is-never-other-window nil - treemacs-max-git-entries 5000 - treemacs-missing-project-action 'ask - treemacs-move-forward-on-expand nil - treemacs-no-png-images nil - treemacs-no-delete-other-windows t - treemacs-project-follow-cleanup nil - treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) - treemacs-position 'left - treemacs-read-string-input 'from-child-frame - treemacs-recenter-distance 0.1 - treemacs-recenter-after-file-follow nil - treemacs-recenter-after-tag-follow nil - treemacs-recenter-after-project-jump 'always - treemacs-recenter-after-project-expand 'on-distance - treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") - treemacs-project-follow-into-home nil - treemacs-show-cursor nil - treemacs-show-hidden-files t - treemacs-silent-filewatch nil - treemacs-silent-refresh nil - treemacs-sorting 'alphabetic-asc - treemacs-select-when-already-in-treemacs 'move-back - treemacs-space-between-root-nodes t - treemacs-tag-follow-cleanup t - treemacs-tag-follow-delay 1.5 - treemacs-text-scale nil - treemacs-user-mode-line-format nil - treemacs-user-header-line-format nil - treemacs-wide-toggle-width 70 - treemacs-width 35 - treemacs-width-increment 1 - treemacs-width-is-initially-locked t - treemacs-workspace-switch-cleanup nil) - - ;; The default width and height of the icons is 22 pixels. If you are - ;; using a Hi-DPI display, uncomment this to double the icon size. - ;;(treemacs-resize-icons 44) - - (treemacs-follow-mode t) - (treemacs-tag-follow-mode t) - (treemacs-project-follow-mode t) - (treemacs-filewatch-mode t) - (treemacs-fringe-indicator-mode 'always) - (when treemacs-python-executable - (treemacs-git-commit-diff-mode t)) - - (pcase (cons (not (null (executable-find "git"))) - (not (null treemacs-python-executable))) - (`(t . t) - (treemacs-git-mode 'deferred)) - (`(t . _) - (treemacs-git-mode 'simple))) - - (treemacs-hide-gitignored-files-mode nil)) - :bind - (:map global-map - ("M-0" . treemacs-select-window) - ("C-x t 1" . treemacs-delete-other-windows) - ("C-x t d" . treemacs-select-directory) - ("C-x t B" . treemacs-bookmark) - ("C-x t C-t" . treemacs-find-file) - ("C-x t M-t" . treemacs-find-tag))) - - (use-package treemacs-evil - :after (treemacs evil) - :ensure t) - - (use-package treemacs-projectile - :after (treemacs projectile) - :ensure t) - - (use-package treemacs-magit - :after (treemacs magit) - :ensure t) - -#+end_src -** Dev Packages -*** Magit (git in emacs) -#+begin_src emacs-lisp -(use-package magit - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) -#+end_src -*** Forge for Magit (Adds github, gitlab, etc PRs and Issues to magit) -make sure to setup authinfo -#+begin_src emacs-lisp -(use-package forge - :after magit) -(setq auth-sources '("~/.authinfo")) -#+end_src -*** Direnv -#+begin_src emacs-lisp -(use-package direnv - :config - (direnv-mode)) -#+end_src -*** Lsp-mode -**** Language Servers -#+begin_src emacs-lisp - (defun sakomacs/lsp-mode-setup () - (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) - (lsp-headerline-breadcrumb-mode)) - - (use-package lsp-mode - :commands (lsp lsp-deferred) - :hook (lsp-mode . sakomacs/lsp-mode-setup) - :init - (setq lsp-keymap-prefix "C-c l") - :config - (lsp-enable-which-key-integration t) - (setq lsp-keep-workspace-alive nil)) -#+end_src -**** Lsp-ui -#+begin_src emacs-lisp - (use-package lsp-ui - :hook (lsp-mode . lsp-ui-mode) - :custom - (lsp-ui-doc-position 'bottom)) -#+end_src -**** Treemacs Lsp -#+begin_src emacs-lisp - (use-package lsp-treemacs - :after lsp) -#+end_src -**** lsp-ivy -#+begin_src emacs-lisp -(use-package lsp-ivy) -#+end_src -**** Languages -***** HTML/CSS -#+begin_src emacs-lisp - (use-package web-mode - :hook (web-mode . lsp) - :mode ("\\.html\\'" - "\\.css\\'")) -#+end_src -***** Javascript -#+begin_src emacs-lisp - (use-package js2-mode - :mode "\\.js\\'" - :hook (js2-mode . lsp)) -#+end_src -***** C/C++ -#+begin_src emacs-lisp -(add-hook 'c-mode-hook 'lsp) -(add-hook 'c++-mode-hook 'lsp) -#+end_src -***** CMake -#+begin_src emacs-lisp - (use-package cmake-mode - :mode "CMakeLists.txt" - :hook (cmake-mode . lsp)) -#+end_src -***** Python -#+begin_src emacs-lisp - (use-package python-mode - :mode "\\.py\\'" - :hook (python-mode . lsp)) - - (use-package elpy - :after python-mode - - :custom - (elpy-rpc-python-command "python3") - - :config - (elpy-enable)) -#+end_src -***** Haskell -#+begin_src emacs-lisp - (use-package haskell-mode - :mode "\\.hs\\'" - :hook (python-mode . lsp)) -#+end_src -***** Yaml editing -#+begin_src emacs-lisp - (use-package yaml-mode - :mode ("\\.yaml\\'" - "\\.yml\\'")) -#+end_src -***** Nix -#+begin_src emacs-lisp - (use-package nix-mode - :hook ((nix-mode . lsp) - (nix-mode . format-all-mode) - (nix-mode . (lambda () (setq-local format-all-formatters '(("Nix" alejandra)))))) - :mode "\\.nix\\'") -#+end_src -*** Commenter -#+begin_src emacs-lisp - (use-package evil-nerd-commenter - :bind ("M-/" . evilnc-comment-or-uncomment-lines)) -#+end_src -*** Company Mode (Better Autocompletion) -#+begin_src emacs-lisp -(use-package company - :after lsp-mode - :hook (lsp-mode . company-mode) - :bind (:map company-active-map - ("" . company-complete-selection)) - (:map lsp-mode-map - ("" . company-indent-or-complete-common)) - :custom - (company-minimum-prefix-length 1) - (company-idle-delay 0.0)) - -(use-package company-box - :hook (company-mode . company-box-mode)) -#+end_src -*** Formatting -#+begin_src emacs-lisp -(use-package format-all) -#+end_src -*** Linting -#+begin_src emacs-lisp - (use-package flycheck - :ensure t - :init (global-flycheck-mode) - :diminish flycheck-mode - :config - (setq-default flycheck-disabled-checkers - (append flycheck-disabled-checkers - '(javascript-jshint json-jsonlist))) - (flycheck-add-mode 'javascript-eslint 'web-mode) - (add-hook 'after-init-hook #'global-flycheck-mode)) -#+end_src -* Fonts -#+begin_src emacs-lisp - (set-face-attribute `default nil :font "JetBrains Mono" :height 125) -#+end_src -* Package setup -#+begin_src emacs-lisp -(require `package) - -(setq package-archives `(("mepla" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("elpa" . "https://elpa.gnu.org/packages/"))) - -(package-initialize) -(unless package-archive-contents - (package-refresh-contents)) - -;; Init package for non-linux -(unless (package-installed-p `use-package) - (package-install `use-package)) - -(require 'use-package) -(setq use-package-always-ensure t) -#+end_src -* Packages -** Command Log Mode -#+begin_src emacs-lisp - (use-package command-log-mode) -#+end_src -** Command Autocompletion Packages -#+begin_src emacs-lisp -;; better search -(use-package swiper) -;; better commands -(use-package counsel) -;; autocompletion on commands (?) -(use-package ivy - :diminish - :bind (("C-s" . swiper) - :map ivy-minibuffer-map - ("TAB" . ivy-alt-done) - ("C-l" . ivy-alt-done) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) - :map ivy-switch-buffer-map - ("C-k" . ivy-previous-line) - ("C-l" . ivy-done) - ("C-d" . ivy-switch-buffer-kill) - :map ivy-reverse-i-search-map - ("C-k" . ivy-previous-line) - ("C-d" . ivy-reverse-i-search-kill)) - :demand - :config - (ivy-mode 1)) -;; better ivy autocompletion -(use-package ivy-rich - :init - (ivy-rich-mode 1)) - -;; counsel M+X -(use-package counsel - :bind (("M-x" . counsel-M-x) - ("C-x b" . counsel-ibuffer) - ("C-x C-f" . counsel-find-file) - :map minibuffer-local-map - ("C-r" . 'counsel-minibuffer-history)) - :config - (setq ivy-inital-inputs-alist nil)) -#+end_src -** Custom Themes -#+begin_src emacs-lisp - (use-package doom-themes - :ensure t - :config - ;; Global settings (defaults) - (setq doom-themes-enable-bold t ; if nil, bold is universally disabled - doom-themes-enable-italic t) ; if nil, italics is universally disabled - ;; load the theme - (load-theme 'doom-dark+ t) - - ;; Enable flashing mode-line on errors - (doom-themes-visual-bell-config)) - ;; Enable custom neotree theme (all-the-icons must be installed!) - ;;(doom-themes-neotree-config) - ;; or for treemacs users - ;;(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme - ;;(doom-themes-treemacs-config) - ;; Corrects (and improves) org-mode's native fontification. - ;;(doom-themes-org-config)) -#+end_src -** Nerd-Fonts (All of the Icons doesnt work for me) -#+begin_src emacs-lisp -(use-package nerd-icons - :custom - ;; "Symbols Nerd Font Mono" is the default and is recommended - ;; but you can use any other Nerd Font if you want - (nerd-icons-font-family "JetBrainsMono NF") - ) -#+end_src -** Rainbow Delimiters -**** TODO find something like this for other languages -#+begin_src emacs-lisp -(use-package rainbow-delimiters - :hook (prog-mode . rainbow-delimiters-mode)) -#+end_src -** Keybinding autocompletion -#+begin_src emacs-lisp -(use-package which-key - :init (which-key-mode) - :diminish which-key-mode - :config - (setq which-key-idle-delay 1)) -#+end_src -** Custom Modeline -#+begin_src emacs-lisp -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1) - :custom ((doom-modeline-height 30))) -#+end_src -** Better help menu -#+begin_src emacs-lisp -(use-package helpful - :ensure t - :custom - (counsel-describe-function-function #'helpful-callable) - (counsel-describe-variable-function #'helpful-variable) - :bind - ([remap describe-function ] . counsel-describe-function) - ([remap describe-command] . helpful-command) - ([remap describe-variable] . counsel-describe-variable) - ([remap describe-key] . helpful-key)) -#+end_src -** General Leader Key -#+begin_src emacs-lisp - (use-package general - :config - (general-create-definer sakomacs/leader-keys - :keymaps `(normal insert visual emacs) - :prefix "SPC" - :global-prefix "C-SPC") - (sakomacs/leader-keys - "t" `(:ignore t :which-key "toggles") - "tt" `(counsel-load-theme :which-key "choose theme") - "e" `(:ignore e :which-key "explorer") - "ee" `(treemacs :which-key "treemacs") - "p" `(:ignore p :which-key "projects") - "pp" `(projectile-switch-project :which-key "open project") - "pk" `(projectile-kill-buffers :which-key "close project") - "o" `(:ignore o :which-key "org") - "oa" `(org-agenda :which-key "agenda") - "g" `(:ignore g :which-key "git") - "gs" `(magit-status :which-key "status"))) -#+end_src -** Emacs-Dashboard -#+begin_src emacs-lisp - (use-package dashboard - :ensure t - :config - (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) - ;; Configuration of Dashboard - (setq dashboard-display-icons-p t) ;; display icons on both GUI and terminal - (setq dashboard-icon-type 'nerd-icons) ;; use `nerd-icons' package - ;; Set the title - (setq dashboard-banner-logo-title "Emacs is vscode for nerds") - ;; Set the banner - (setq dashboard-startup-banner 'official) - ;; center everything - (setq dashboard-center-content t) - ;; jump thing - (setq dashboard-show-shortcuts nil) - (setq dashboard-items '((projects . 5) - (agenda . 5))) - (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) - (setq dashboard-footer-messages '("I think I have Emacs pinky!")) - (dashboard-setup-startup-hook)) -#+end_src -** Evil Mode (vim) -#+begin_src emacs-lisp -(use-package evil - :init - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - :hook (evil-mode . sakomacs/evil-hook) - :ensure t - :demand - :config - (evil-mode 1) - (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) - (define-key evil-insert-state-map (kbd "C-h") `evil-delete-backward-char-and-join) - - ;; visual line motion - (evil-global-set-key 'motion "j" 'evil-next-visual-line) - (evil-global-set-key 'motion "k" 'evil-previous-visual-line) - - (evil-set-initial-state 'messages-buffer-mode 'normal) - (evil-set-initial-state 'dashboard-mode 'normal)) - -;; extra things for Evil -(use-package evil-collection - :after evil - :config - (evil-collection-init)) -#+end_src -** Hydra for scaling text -#+begin_src emacs-lisp -(use-package hydra) -(defhydra hydra-text-scale (:timeout 4) - "scale text" - ("j" text-scale-increase "in") - ("k" text-scale-decrease "out") - ("f" nil "finished" :exit t)) - -(sakomacs/leader-keys - "ts" '(hydra-text-scale/body :which-key "scale text")) -#+end_src -** Helpful for projects -#+begin_src emacs-lisp -(use-package projectile - :diminish projectile-mode - :demand - :config (projectile-mode) - :custom ((projectile-completion-system 'ivy)) - :bind-keymap - ("C-c p" . projectile-command-map) - :init - (when (file-directory-p "~/dev") - (setq projectile-project-search-path '("~/dev"))) - (setq projectile-switch-project-action #'projectile-dired)) - -(use-package counsel-projectile - :config (counsel-projectile-mode)) -#+end_src -** Org-Mode -#+begin_src emacs-lisp - (defun sakomacs/org-mode-setup () - (org-indent-mode) - (variable-pitch-mode 1) - (visual-line-mode 1)) - - (use-package org - :hook (org-mode . sakomacs/org-mode-setup) - :config - (setq org-ellipsis "▼") - (setq org-agenda-start-with-log-mode t) - (setq org-log-done 'time) - (setq org-log-into-drawer t) - - ;; org habits thing - (require 'org-habit) - (add-to-list 'org-modules 'org-habit) - (setq org-habit-graph-column 60) - - ;; archive thingy i forgot - (setq org-refile-targets - '(("archive.org" :maxlevel . 1))) - - ;; save org buffer before refile - (advice-add 'org-refile :after 'org-save-all-org-buffers) - - ;; org agenda files - (setq org-agenda-files - '("~/org/tasks.org" - "~/org/school.org" - "~/org/daily.org" - "~/org/irl.org" - "~/org/work.org")) - - ;; Following - (setq org-return-follows-link t) - - ;; org mode src thing - (require 'org-tempo) - - (add-to-list 'org-structure-template-alist '("sh" . "src shell")) - (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) - (add-to-list 'org-structure-template-alist '("py" . "src python")) - - (setq org-todo-keywords - '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)") - (sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANCELED(k@)"))) - - (setq org-refile-targets - '(("archive.org" :maxlevel . 1) - ("tasks.org" :maxlevel . 1))) - - ;; Save Org buffers after refiling! - (advice-add 'org-refile :after 'org-save-all-org-buffers) - - (setq org-tag-alist - '((:startgroup) - ; Put mutually exclusive tags here - (:endgroup) - ("@errand" . ?E) - ("@home" . ?H) - ("@work" . ?W) - ("agenda" . ?a) - ("planning" . ?p) - ("publish" . ?P) - ("batch" . ?b) - ("note" . ?n) - ("idea" . ?i))) - - ;; Configure custom agenda views - (setq org-agenda-custom-commands - '(("d" "Dashboard" - ((agenda "" ((org-deadline-warning-days 7))) - (todo "NEXT" - ((org-agenda-overriding-header "Next Tasks"))) - (tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects"))))) - - ("n" "Next Tasks" - ((todo "NEXT" - ((org-agenda-overriding-header "Next Tasks"))))) - - ("W" "Work Tasks" tags-todo "+work-email") - - ;; Low-effort next actions - ("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0" - ((org-agenda-overriding-header "Low Effort Tasks") - (org-agenda-max-todos 20) - (org-agenda-files org-agenda-files))) - - ("w" "Workflow Status" - ((todo "WAIT" - ((org-agenda-overriding-header "Waiting on External") - (org-agenda-files org-agenda-files))) - (todo "REVIEW" - ((org-agenda-overriding-header "In Review") - (org-agenda-files org-agenda-files))) - (todo "PLAN" - ((org-agenda-overriding-header "In Planning") - (org-agenda-todo-list-sublevels nil) - (org-agenda-files org-agenda-files))) - (todo "BACKLOG" - ((org-agenda-overriding-header "Project Backlog") - (org-agenda-todo-list-sublevels nil) - (org-agenda-files org-agenda-files))) - (todo "READY" - ((org-agenda-overriding-header "Ready for Work") - (org-agenda-files org-agenda-files))) - (todo "ACTIVE" - ((org-agenda-overriding-header "Active Projects") - (org-agenda-files org-agenda-files))) - (todo "COMPLETED" - ((org-agenda-overriding-header "Completed Projects") - (org-agenda-files org-agenda-files))) - (todo "CANC" - ((org-agenda-overriding-header "Cancelled Projects") - (org-agenda-files org-agenda-files))))))) - - (setq org-capture-templates - `(("t" "Tasks / Projects") - ("tt" "Task" entry (file+olp "~/Projects/Code/emacs-from-scratch/OrgFiles/Tasks.org" "Inbox") - "* TODO %?\n %U\n %a\n %i" :empty-lines 1) - - ("j" "Journal Entries") - ("jj" "Journal" entry - (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "\n* %<%I:%M %p> - Journal :journal:\n\n%?\n\n" - ;; ,(dw/read-file-as-string "~/Notes/Templates/Daily.org") - :clock-in :clock-resume - :empty-lines 1) - ("jm" "Meeting" entry - (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "* %<%I:%M %p> - %a :meetings:\n\n%?\n\n" - :clock-in :clock-resume - :empty-lines 1) - - ("w" "Workflows") - ("we" "Checking Email" entry (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "* Checking Email :email:\n\n%?" :clock-in :clock-resume :empty-lines 1) - - ("m" "Metrics Capture") - ("mw" "Weight" table-line (file+headline "~/Projects/Code/emacs-from-scratch/OrgFiles/Metrics.org" "Weight") - "| %U | %^{Weight} | %^{Notes} |" :kill-buffer t)))) - - - ;; i need more bullets, i need more bullets, i need more bullets, bigger weapons, bigger weapons, bigger weapons - ;; thanks for the protein sir - (use-package org-bullets - :after org - :hook (org-mode . org-bullets-mode) - :custom - (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) - - ;; word - (defun sakomacs/org-mode-visual-fill () - (setq visual-fill-column-width 100 - visual-fill-column-center-text t) - (visual-fill-column-mode 1)) - - (use-package visual-fill-column - :hook (org-mode . sakomacs/org-mode-visual-fill)) -#+end_src -** Org-Roam -#+begin_src emacs-lisp - (use-package org-roam - :ensure t - :custom - (org-roam-directory "~/org" - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n i" . org-roam-node-insert)) - :config - (org-roam-setup))) -#+end_src -** Treemacs -#+begin_src emacs-lisp - (use-package treemacs - :ensure t - :defer t - :init - (with-eval-after-load 'winum - (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) - :config - (progn - (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) - treemacs-deferred-git-apply-delay 0.5 - treemacs-directory-name-transformer #'identity - treemacs-display-in-side-window t - treemacs-eldoc-display 'simple - treemacs-file-event-delay 2000 - treemacs-file-extension-regex treemacs-last-period-regex-value - treemacs-file-follow-delay 0.2 - treemacs-file-name-transformer #'identity - treemacs-follow-after-init t - treemacs-expand-after-init t - treemacs-find-workspace-method 'find-for-file-or-pick-first - treemacs-git-command-pipe "" - treemacs-goto-tag-strategy 'refetch-index - treemacs-header-scroll-indicators '(nil . "^^^^^^") - treemacs-hide-dot-git-directory t - treemacs-indentation 2 - treemacs-indentation-string " " - treemacs-is-never-other-window nil - treemacs-max-git-entries 5000 - treemacs-missing-project-action 'ask - treemacs-move-forward-on-expand nil - treemacs-no-png-images nil - treemacs-no-delete-other-windows t - treemacs-project-follow-cleanup nil - treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) - treemacs-position 'left - treemacs-read-string-input 'from-child-frame - treemacs-recenter-distance 0.1 - treemacs-recenter-after-file-follow nil - treemacs-recenter-after-tag-follow nil - treemacs-recenter-after-project-jump 'always - treemacs-recenter-after-project-expand 'on-distance - treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") - treemacs-project-follow-into-home nil - treemacs-show-cursor nil - treemacs-show-hidden-files t - treemacs-silent-filewatch nil - treemacs-silent-refresh nil - treemacs-sorting 'alphabetic-asc - treemacs-select-when-already-in-treemacs 'move-back - treemacs-space-between-root-nodes t - treemacs-tag-follow-cleanup t - treemacs-tag-follow-delay 1.5 - treemacs-text-scale nil - treemacs-user-mode-line-format nil - treemacs-user-header-line-format nil - treemacs-wide-toggle-width 70 - treemacs-width 35 - treemacs-width-increment 1 - treemacs-width-is-initially-locked t - treemacs-workspace-switch-cleanup nil) - - ;; The default width and height of the icons is 22 pixels. If you are - ;; using a Hi-DPI display, uncomment this to double the icon size. - ;;(treemacs-resize-icons 44) - - (treemacs-follow-mode t) - (treemacs-tag-follow-mode t) - (treemacs-project-follow-mode t) - (treemacs-filewatch-mode t) - (treemacs-fringe-indicator-mode 'always) - (when treemacs-python-executable - (treemacs-git-commit-diff-mode t)) - - (pcase (cons (not (null (executable-find "git"))) - (not (null treemacs-python-executable))) - (`(t . t) - (treemacs-git-mode 'deferred)) - (`(t . _) - (treemacs-git-mode 'simple))) - - (treemacs-hide-gitignored-files-mode nil)) - :bind - (:map global-map - ("M-0" . treemacs-select-window) - ("C-x t 1" . treemacs-delete-other-windows) - ("C-x t d" . treemacs-select-directory) - ("C-x t B" . treemacs-bookmark) - ("C-x t C-t" . treemacs-find-file) - ("C-x t M-t" . treemacs-find-tag))) - - (use-package treemacs-evil - :after (treemacs evil) - :ensure t) - - (use-package treemacs-projectile - :after (treemacs projectile) - :ensure t) - - (use-package treemacs-magit - :after (treemacs magit) - :ensure t) - -#+end_src -** Dev Packages -*** Magit (git in emacs) -#+begin_src emacs-lisp -(use-package magit - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) -#+end_src -*** Forge for Magit (Adds github, gitlab, etc PRs and Issues to magit) -make sure to setup authinfo -#+begin_src emacs-lisp -(use-package forge - :after magit) -(setq auth-sources '("~/.authinfo")) -#+end_src -*** Direnv -#+begin_src emacs-lisp -(use-package direnv - :config - (direnv-mode)) -#+end_src -*** Lsp-mode -**** Language Servers -#+begin_src emacs-lisp - (defun sakomacs/lsp-mode-setup () - (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) - (lsp-headerline-breadcrumb-mode)) - - (use-package lsp-mode - :commands (lsp lsp-deferred) - :hook (lsp-mode . sakomacs/lsp-mode-setup) - :init - (setq lsp-keymap-prefix "C-c l") - :config - (lsp-enable-which-key-integration t) - (setq lsp-keep-workspace-alive nil)) -#+end_src -**** Lsp-ui -#+begin_src emacs-lisp - (use-package lsp-ui - :hook (lsp-mode . lsp-ui-mode) - :custom - (lsp-ui-doc-position 'bottom)) -#+end_src -**** Treemacs Lsp -#+begin_src emacs-lisp - (use-package lsp-treemacs - :after lsp) -#+end_src -**** lsp-ivy -#+begin_src emacs-lisp -(use-package lsp-ivy) -#+end_src -**** Languages -***** HTML/CSS -#+begin_src emacs-lisp - (use-package web-mode - :hook (web-mode . lsp) - :mode ("\\.html\\'" - "\\.css\\'")) -#+end_src -***** Javascript -#+begin_src emacs-lisp - (use-package js2-mode - :mode "\\.js\\'" - :hook (js2-mode . lsp)) -#+end_src -***** C/C++ -#+begin_src emacs-lisp -(add-hook 'c-mode-hook 'lsp) -(add-hook 'c++-mode-hook 'lsp) -#+end_src -***** CMake -#+begin_src emacs-lisp - (use-package cmake-mode - :mode "CMakeLists.txt" - :hook (cmake-mode . lsp)) -#+end_src -***** Python -#+begin_src emacs-lisp - (use-package python-mode - :mode "\\.py\\'" - :hook (python-mode . lsp)) - - (use-package elpy - :after python-mode - - :custom - (elpy-rpc-python-command "python3") - - :config - (elpy-enable)) -#+end_src -***** Haskell -#+begin_src emacs-lisp - (use-package haskell-mode - :mode "\\.hs\\'" - :hook (python-mode . lsp)) -#+end_src -***** Yaml editing -#+begin_src emacs-lisp - (use-package yaml-mode - :mode ("\\.yaml\\'" - "\\.yml\\'")) -#+end_src -***** Nix -#+begin_src emacs-lisp - (use-package nix-mode - :hook ((nix-mode . lsp) - (nix-mode . format-all-mode) - (nix-mode . (lambda () (setq-local format-all-formatters '(("Nix" alejandra)))))) - :mode "\\.nix\\'") -#+end_src -*** Commenter -#+begin_src emacs-lisp - (use-package evil-nerd-commenter - :bind ("M-/" . evilnc-comment-or-uncomment-lines)) -#+end_src -*** Company Mode (Better Autocompletion) -#+begin_src emacs-lisp -(use-package company - :after lsp-mode - :hook (lsp-mode . company-mode) - :bind (:map company-active-map - ("" . company-complete-selection)) - (:map lsp-mode-map - ("" . company-indent-or-complete-common)) - :custom - (company-minimum-prefix-length 1) - (company-idle-delay 0.0)) - -(use-package company-box - :hook (company-mode . company-box-mode)) -#+end_src -*** Formatting -#+begin_src emacs-lisp -(use-package format-all) -#+end_src -* Fonts -#+begin_src emacs-lisp - (set-face-attribute `default nil :font "JetBrains Mono" :height 125) + (set-face-attribute `default nil :font "JetBrains Mono" :height 140) #+end_src * Package setup #+begin_src emacs-lisp @@ -2395,11 +432,6 @@ make sure to setup authinfo ;; ,(dw/read-file-as-string "~/Notes/Templates/Daily.org") :clock-in :clock-resume :empty-lines 1) - ("jm" "Meeting" entry - (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") - "* %<%I:%M %p> - %a :meetings:\n\n%?\n\n" - :clock-in :clock-resume - :empty-lines 1) ("w" "Workflows") ("we" "Checking Email" entry (file+olp+datetree "~/Projects/Code/emacs-from-scratch/OrgFiles/Journal.org") @@ -2410,13 +442,12 @@ make sure to setup authinfo "| %U | %^{Weight} | %^{Notes} |" :kill-buffer t)))) - ;; i need more bullets, i need more bullets, i need more bullets, bigger weapons, bigger weapons, bigger weapons - ;; thanks for the protein sir - (use-package org-bullets + ;; make it look better + (use-package org-superstar :after org - :hook (org-mode . org-bullets-mode) + :hook (org-mode . org-superstar-mode) :custom - (org-bullets-bullet-list '("◉" "○" "●" "○" "●" "○" "●"))) + (org-superstar-headline-bullets-list'("◉" "○" "●" "○" "●" "○" "●"))) ;; word (defun sakomacs/org-mode-visual-fill () @@ -2547,9 +578,10 @@ make sure to setup authinfo ** Dev Packages *** Magit (git in emacs) #+begin_src emacs-lisp -(use-package magit - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) + (use-package magit + :custom + (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) + ) #+end_src *** Forge for Magit (Adds github, gitlab, etc PRs and Issues to magit) make sure to setup authinfo @@ -2833,6 +865,11 @@ Dired is a built-in file manager for Emacs that does some pretty amazing things! (add-hook 'emacs-startup-hook (elfeed-update)) #+end_src +** Telegram +only god knows why im doing this +#+begin_src emacs-lisp + (use-package telega) +#+end_src * Org Mode Configuration Setup ** Babel Languages #+begin_src emacs-lisp