~zenomat/emacs

18cc1e8671a216764ad679260f9eb43a131afc32 — TheOnAndOnlyZenomat 1 year, 10 months ago 67550dd
updated config
5 files changed, 165 insertions(+), 114 deletions(-)

M custom.el
M custom/edwina/edwina.el
M init.el
M init.org
A init.pdf
M custom.el => custom.el +2 -2
@@ 4,9 4,9 @@
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-safe-themes
   '("5036346b7b232c57f76e8fb72a9c0558174f87760113546d3a9838130f1cdb74" "e074be1c799b509f52870ee596a5977b519f6d269455b84ed998666cf6fc802a" "e6ff132edb1bfa0645e2ba032c44ce94a3bd3c15e3929cdf6c049802cf059a2a" "7a994c16aa550678846e82edc8c9d6a7d39cc6564baaaacc305a3fdc0bd8725f" default))
   '("5b809c3eae60da2af8a8cfba4e9e04b4d608cb49584cb5998f6e4a1c87c057c4" "71e5acf6053215f553036482f3340a5445aee364fb2e292c70d9175fb0cc8af7" "d74c5485d42ca4b7f3092e50db687600d0e16006d8fa335c69cf4f379dbd0eee" "5036346b7b232c57f76e8fb72a9c0558174f87760113546d3a9838130f1cdb74" "e074be1c799b509f52870ee596a5977b519f6d269455b84ed998666cf6fc802a" "e6ff132edb1bfa0645e2ba032c44ce94a3bd3c15e3929cdf6c049802cf059a2a" "7a994c16aa550678846e82edc8c9d6a7d39cc6564baaaacc305a3fdc0bd8725f" default))
 '(package-selected-packages
   '(elpher rust-mode wc-mode helpful edwina yaml-mode olivetti splash-screen ox-pandoc focus use-package rainbow-delimiters org-bullets markdown-preview-eww markdown-mode+ ivy-rich ivy-prescient horizon-theme elisp-refs doom-themes doom-modeline counsel buffer-move ample-theme))
   '(electric-pair-local-mode hl-todo csharp-mode tree-sitter-langs tree-sitter elpher rust-mode wc-mode helpful edwina yaml-mode olivetti splash-screen ox-pandoc focus use-package rainbow-delimiters org-bullets markdown-preview-eww markdown-mode+ ivy-rich ivy-prescient horizon-theme elisp-refs doom-themes doom-modeline counsel buffer-move ample-theme))
 '(safe-local-variable-values
   '((eval add-hook 'after-save-hook
	   (lambda nil

M custom/edwina/edwina.el => custom/edwina/edwina.el +0 -2
@@ 278,7 278,6 @@ SIDE is passed to `split-window' to position the stack area."
    (define-key prefix-map (kbd "^") 'edwina-inc-mfact)
    (define-key prefix-map (kbd "}") 'edwina-inc-mfact)
    (define-key prefix-map (kbd "]") 'edwina-inc-mfact)
    (define-key prefix-map (kbd "d") 'edwina-dec-nmaster)
    (define-key prefix-map (kbd "C-d") 'edwina-dec-nmaster)
    (define-key prefix-map (kbd "i") 'edwina-inc-nmaster)
    (define-key prefix-map (kbd "k") 'edwina-delete-window)


@@ 305,7 304,6 @@ SIDE is passed to `split-window' to position the stack area."
    ("K" edwina-swap-previous-window)
    ("h" edwina-dec-mfact)
    ("l" edwina-inc-mfact)
    ("d" edwina-dec-nmaster)
    ("i" edwina-inc-nmaster)
    ("S-c" edwina-delete-window)
    ("C" edwina-delete-window)

M init.el => init.el +41 -16
@@ 1,6 1,7 @@
(setq user-full-name "Adrian Eichelbaum"
      user-mail-address "ad.eichelbaum@gmail.com")
      user-mail-address "adrsrv@protonmail.com")

(setq inhibit-splash-screen t)
(setq initial-scratch-message ";; Welcome back, Zeno")

(scroll-bar-mode -1)        ; Disable visible scrollbar


@@ 37,8 38,8 @@

(substitute-key-definition 'kill-buffer 'kill-buffer-and-window global-map)

(setq split-height-threshold nil)
(setq split-width-threshold 0)
;;(setq split-height-threshold nil)
;;(setq split-width-threshold 0)

(setq org-publish-project-alist
      '(("zenopage" ;; my blog project (just a name)


@@ 63,16 64,6 @@

(global-set-key (kbd "C-c n") #'new-buffer-new-window)

(use-package rust-mode
)

(add-hook 'rust-mode-hook
    (lambda () (setq indent-tabs-mode nil)))

(setq rust-format-on-save t)

(define-key rust-mode-map (kbd "C-c C-c") 'rust-run)

(require 'package)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")


@@ 86,7 77,7 @@
(require 'use-package)
(setq use-package-always-ensure t)

(require 'splash-screen)
;;(require 'splash-screen)

(setq calendar-location-name "Leizpig, DE") 
(setq calendar-latitude 51.33)


@@ 119,8 110,8 @@
  (doom-modeline-minor-modes 1))
)

(use-package rainbow-delimiters
  :hook (prog-mode . rainbow-delimiters-mode))
(use-package rainbow-delimiters)
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)

(use-package markdown-mode
  :mode (("README\\.md\\'" . gfm-mode)


@@ 134,6 125,7 @@
    ("C-c l" . 'org-store-link)
    ("C-c a" . 'org-agenda)
    ("C-c c" . 'org-capture)
    ("M-SPC" . 'org-insert-item)
    )
  )



@@ 203,3 195,36 @@
(use-package elpher
)
(add-hook 'elpher-mode-hook (lambda () (display-line-numbers-mode 0)))

(use-package hl-todo
:hook (csharp-mode . hl-todo-mode)
:hook (rust-mode . hl-todo-mode)
:hook (org-mode . hl-todo-mode))
(add-hook 'prog-mode-hook 'hl-todo-mode)

(setq hl-todo-keyword-faces
      '(("TODO"   . "#ffd000")
        ("FIXME"  . "#FF0000")
        ("NOTE"  . "#15ff00")))

(use-package rust-mode
)

(add-hook 'prog-mode-hook #'electric-pair-local-mode)

(add-hook 'rust-mode-hook
    (lambda () (setq indent-tabs-mode nil)))

(setq rust-format-on-save t)

(define-key rust-mode-map (kbd "C-c C-c") 'rust-run)

;;(add-hook 'csharp-mode-hook (lambda () (hl-todo-mode)))

(use-package tree-sitter)
(use-package tree-sitter-langs)

(use-package csharp-mode
 :config
 (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-tree-sitter-mode))
 )

M init.org => init.org +122 -94
@@ 7,13 7,14 @@

#+begin_src emacs-lisp
(setq user-full-name "Adrian Eichelbaum"
      user-mail-address "ad.eichelbaum@gmail.com")
      user-mail-address "adrsrv@protonmail.com")
#+end_src

* UI Customization
Sets a custom scratch-buffer message and disables some UI elements to make emacs more minimal in appearance

#+BEGIN_SRC emacs-lisp
(setq inhibit-splash-screen t)
(setq initial-scratch-message ";; Welcome back, Zeno")

(scroll-bar-mode -1)        ; Disable visible scrollbar


@@ 53,6 54,29 @@ Show line numbers, highlight current line
(load-theme 'doom-horizon t)
#+END_SRC

* Package setup
Prepare the repos and other stuff

#+begin_src emacs-lisp
(require 'package)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")
                         ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
 (package-refresh-contents))
#+end_src
* Use-package
A more easy and usefull way of managing packages, everyhting which belongs together is in one place and can be installed automatically

#+begin_src emacs-lisp
(require 'use-package)
(setq use-package-always-ensure t)
#+end_src

The =use-package-always-ensure t= enables auto install
* Folder Setup

Adds the custom folder to the load-path. This is where custom emacs addons are stored, if not installed with the package manager.


@@ 78,7 102,7 @@ Changes the location where backupfiles and autosave files are stored, so they do
#+END_SRC

* QOL Changes
** Delete the selected region, when typing over it, like on expects
** Delete the selected region, when typing over it, like one expects

#+BEGIN_SRC emacs-lisp
(delete-selection-mode t)


@@ 97,11 121,10 @@ Changes the location where backupfiles and autosave files are stored, so they do
#+END_SRC

** Split buffers vertically

#+BEGIN_SRC emacs-lisp
(setq split-height-threshold nil)
(setq split-width-threshold 0)
#+END_SRC
 #+BEGIN_SRC emacs-lisp
 ;;(setq split-height-threshold nil)
 ;;(setq split-width-threshold 0)
 #+END_SRC

* Publishing to Jekyll with org-mode
I publish my blog using Jekyll and I want to be able to publish using EMACS's org-mode


@@ 134,85 157,11 @@ creates a function, which creates a new bufer in a new frame and assign it to =C

(global-set-key (kbd "C-c n") #'new-buffer-new-window)
#+end_src
* Rust Environment
** Rust Major Mode
#+begin_src emacs-lisp
(use-package rust-mode
)
#+end_src

** Spaces rather than tabs to indent
Rust uses spaces to indent, rather than tabs, so we disable the use of tabs for indentation

#+begin_src emacs-lisp
(add-hook 'rust-mode-hook
    (lambda () (setq indent-tabs-mode nil)))
#+end_src

** Code formatting on save
The =rust-format-buffer= function will format your code with =rustfmt= if installed. By default, this is bound to =C-c C-f=.
The variable =rust-format-on-save= enables automatic formatting on save.

#+begin_src emacs-lisp
(setq rust-format-on-save t)
#+end_src

** Running / testing / compiling code
The =rust-run=, =rust-test=, =rust-compile= and =rust-check= functions shell out to Cargo to run, test, build and check your code. Under the hood, these use the standard Emacs compile function.

These are not bound by default. To bind these to keyboard shortcuts, you can use the following in your init.el:

#+begin_src emacs-lisp
(define-key rust-mode-map (kbd "C-c C-c") 'rust-run)
#+end_src

* Packages
** Package setup
Prepare the repos and other stuff

#+begin_src emacs-lisp
(require 'package)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")
                         ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
 (package-refresh-contents))
#+end_src

** Use-package
A more easy and usefull way of managing packages, everyhting which belongs together is in one place and can be installed automatically

#+begin_src emacs-lisp
(require 'use-package)
(setq use-package-always-ensure t)
#+end_src

The =use-package-always-ensure t= enables auto install

** Custom splash-screen

#+begin_src emacs-lisp
(require 'splash-screen)
#+end_src

** Change theme based on time

Set your location, to get sunrise and sunset

#+begin_src emacs-lisp
(setq calendar-location-name "Leizpig, DE") 
(setq calendar-latitude 51.33)
(setq calendar-longitude 12.37)
#+end_src

Load the package and set the theme based on time. The first argument is day, the second the theme night.

#+begin_src emacs-lisp
(require 'theme-changer)
(change-theme 'doom-horizon 'doom-horizon)
;;(require 'splash-screen)
#+end_src

** Move buffers around


@@ 230,6 179,10 @@ Install package through use-package and define keybindings in the =:bind=-sectio
  )
#+end_src

** All-the-icons
 #+begin_src emacs-lisp
 (use-package all-the-icons)
 #+end_src
** Doom-themes

Install using use-package. In the =:config=-part you can define config options for the package.


@@ 261,13 214,13 @@ Change the modeline to the one of doom emacs, because I think it is more beautif

** Rainbow-delimiters

Changes paranthesis to dfferent colors, corosponding paranthesis have the same color.
It is enabled in every =prog-mode=, which means, it is activated in every mode, which is classified as a programming mode
 Changes paranthesis to dfferent colors, corosponding paranthesis have the same color.
 It is enabled in every =prog-mode=, which means, it is activated in every mode, which is classified as a programming mode

#+begin_src emacs-lisp
(use-package rainbow-delimiters
  :hook (prog-mode . rainbow-delimiters-mode))
#+end_src
 #+begin_src emacs-lisp
 (use-package rainbow-delimiters)
 (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
 #+end_src

** Markdown



@@ 298,18 251,18 @@ Activate the package on certain file extensions. If configs are to be added, jus
    ("C-c l" . 'org-store-link)
    ("C-c a" . 'org-agenda)
    ("C-c c" . 'org-capture)
    ("M-SPC" . 'org-insert-item)
    )
  )
#+end_src

*** Org-bullets
  Change the headline bullet points to icons, is pretty

Change the headline bullet points to icons, is pretty

#+begin_src emacs-lisp
(use-package org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+end_src
  #+begin_src emacs-lisp
  (use-package org-bullets)
  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
  #+end_src

*** Ox-pandoc



@@ 426,3 379,78 @@ A gemeni/gopher client
)
(add-hook 'elpher-mode-hook (lambda () (display-line-numbers-mode 0)))
#+end_src
** hl-todo
  Highlights keywords like todo, fixme, ...
 #+begin_src emacs-lisp
 (use-package hl-todo
 :hook (csharp-mode . hl-todo-mode)
 :hook (rust-mode . hl-todo-mode)
 :hook (org-mode . hl-todo-mode))
 (add-hook 'prog-mode-hook 'hl-todo-mode)
 #+end_src

 To set the keywords to highlight, aswell as the color add them to this list
 #+begin_src emacs-lisp
 (setq hl-todo-keyword-faces
       '(("TODO"   . "#ffd000")
         ("FIXME"  . "#FF0000")
         ("NOTE"  . "#15ff00")))
 #+end_src
* Rust Environment
** Rust Major Mode
#+begin_src emacs-lisp
(use-package rust-mode
)
#+end_src

** Electric-pair mode
 Mode to automatically close delimiters like parenthesis
 #+begin_src emacs-lisp
 (add-hook 'prog-mode-hook #'electric-pair-local-mode)
 #+end_src

** Spaces rather than tabs to indent
Rust uses spaces to indent, rather than tabs, so we disable the use of tabs for indentation

#+begin_src emacs-lisp
(add-hook 'rust-mode-hook
    (lambda () (setq indent-tabs-mode nil)))
#+end_src

** Code formatting on save
The =rust-format-buffer= function will format your code with =rustfmt= if installed. By default, this is bound to =C-c C-f=.
The variable =rust-format-on-save= enables automatic formatting on save.

#+begin_src emacs-lisp
(setq rust-format-on-save t)
#+end_src

** Running / testing / compiling code
The =rust-run=, =rust-test=, =rust-compile= and =rust-check= functions shell out to Cargo to run, test, build and check your code. Under the hood, these use the standard Emacs compile function.

These are not bound by default. To bind these to keyboard shortcuts, you can use the following in your init.el:

#+begin_src emacs-lisp
(define-key rust-mode-map (kbd "C-c C-c") 'rust-run)
#+end_src

** hl-todo Mode
  #+begin_src emacs-lisp
  ;;(add-hook 'csharp-mode-hook (lambda () (hl-todo-mode)))
  #+end_src
* C# Environment
** tree-sitter support
 For indentation and highlighting
 #+begin_src emacs-lisp
 (use-package tree-sitter)
 (use-package tree-sitter-langs)
 #+end_src

** C#-mode
 Mode for editing C# in emacs
 #+begin_src emacs-lisp
 (use-package csharp-mode
  :config
  (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-tree-sitter-mode))
  )
 #+end_src

A init.pdf => init.pdf +0 -0