Compare commits

..

10 Commits

11 changed files with 449 additions and 158 deletions

1
.gitignore vendored
View File

@@ -21,6 +21,7 @@ eln-cache/*
# etc # etc
auto-save-list* auto-save-list*
url
# don't ignore .gitignore # don't ignore .gitignore
!.gitignore !.gitignore

View File

@@ -12,8 +12,14 @@ Functions needed at the start of the configuration
* User Emacs Directories * User Emacs Directories
set the directory for emacs and it's apps to put stuff. set the directory for emacs and it's apps to put stuff.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(if (version< "28" emacs-version)
(setq user-emacs-directory (setq user-emacs-directory
(expand-file-name "emacs" (safe-getenv "XDG_DATA_HOME" "~/.local/share"))) (expand-file-name "emacs" (safe-getenv "XDG_DATA_HOME" "~/.local/share"))))
#+end_src
* Backup Directory
#+begin_src emacs-lisp
(setq backup-directory-alist `(("." . ,(expand-file-name "backups" user-emacs-directory))))
#+end_src #+end_src
* Custom File * Custom File
@@ -27,7 +33,7 @@ This file stores variables containing personal information, and is not distribut
A sample of this file though is included in this config to be used A sample of this file though is included in this config to be used
#+begin_src emacs-lisp #+begin_src emacs-lisp
(let ((personal-file-path (expand-file-name "personal.org" user-emacs-config-directory)) (let ((personal-file-path (expand-file-name "personal.org" user-emacs-config-directory))
(sample-personal-file-path (expand-file-name "/personal-sample.org" user-emacs-config-directory ))) (sample-personal-file-path (expand-file-name "personal-sample.org" user-emacs-config-directory )))
;; load main personal file if it exists ;; load main personal file if it exists
(if (file-exists-p personal-file-path) (if (file-exists-p personal-file-path)

View File

@@ -1,5 +1,12 @@
#+TITLE: Packages #+TITLE: Packages
* Old Emacs TLS Compatibility
Emacs versions older than 26.3 have problems with TLS Authentication to connect with ELPA, this fixes that
#+begin_src emacs-lisp
(when (version< emacs-version "26.3")
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
#+end_src
* Configuration * Configuration
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'package) (require 'package)
@@ -13,13 +20,14 @@ this speeds up emacs startup
** Set Package Directory ** Set Package Directory
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq package-user-dir (expand-file-name "emacs/packages" (safe-getenv "XDG_DATA_HOME" "~/.local/share"))) (setq package-user-dir (expand-file-name "packages" user-emacs-directory))
#+end_src #+end_src
** Add package sources ** Add package sources
#+begin_src emacs-lisp
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
#+begin_src emacs-lisp
(add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/"))
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/")) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
#+end_src #+end_src

76
init.org.d/30-org.org Normal file
View File

@@ -0,0 +1,76 @@
#+TITLE: Org Mode
This the Mode with multitude of useful features like this configuration being a literate document,
scheduling, and loads of other stuff
* General Settings
#+begin_src emacs-lisp
(defun org-config-setup ()
(variable-pitch-mode)
(visual-line-mode) ;; wrap line
(org-indent-mode) ;; fake indentations
(setq org-hide-leading-stars nil)
(display-line-numbers-mode -1)
(display-fill-column-indicator-mode -1))
#+end_src
* Font Setup
Set different types of fonts for differents elements of Org-mode files, like variable pitch for regular text, and fixed pitch for code blocks
#+begin_src emacs-lisp
(defun org-config-font-setup ()
"set org mode element fonts"
(custom-set-faces
'(org-block ((t (:inherit fixed-pitch))))
;; '(org-block-begin-line ((t (:inherit fixed-pitch))))
;; '(org-block-end-line ((t (:inherit fixed-pitch))))
'(org-checkbox ((t (:inherit fixed-pitch))))
'(org-code ((t (:inherit (shadow fixed-pitch)))))
'(org-document-info ((t (:foreground "dark orange"))))
'(org-document-info-keyword ((t (:inherit (shadow fixed-pitch) ))))
'(org-indent ((t (:inherit (org-hide fixed-pitch) ))))
'(org-link ((t (:foreground "royal blue" :underline t))))
'(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch) ))))
'(org-property-value ((t (:inherit fixed-pitch ))) t)
'(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch) ))))
'(org-table ((t (:inherit fixed-pitch :foreground "#83a598" ))))
'(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8))))
'(org-verbatim ((t (:inherit (shadow fixed-pitch)))))))
#+end_src
** Header Font Setup
Make header and document title fonts bigger for better visibility.
#+begin_src emacs-lisp
(defun org-config-level-font-setup ()
"set header/level and document title fonts"
(custom-set-faces
'(org-document-title ((t
(:inherit (bold variable-pitch)
:height 2.2))))
'(org-level-1 ((t (:inherit outline-1 :weight bold
:height 1.5))))
'(org-level-2 ((t (:inherit outline-2 :weight bold
:height 1.4))))
'(org-level-3 ((t (:inherit outline-3 :weight bold
:height 1.3))))
'(org-level-4 ((t (:inherit variable-pitch :weight bold
:height 1.2))))
'(org-level-5 ((t (:inherit variable-pitch :weight bold
:height 1.1))))))
#+end_src
* Load Package
#+begin_src emacs-lisp
(use-package org
:custom
(org-hide-emphasis-markers nil)
(org-agenda-files
`(,(expand-file-name "docs/notes" (safe-getenv "HOME" user-home-path))))
:config
;; font setup
(org-config-font-setup)
(org-config-level-font-setup)
;;other settings
:hook (org-mode . org-config-setup))
#+end_src

81
init.org.d/40-fonts.org Normal file
View File

@@ -0,0 +1,81 @@
#+TITLE: Font Configuration
* set default fonts
#+begin_src emacs-lisp
(let ((default-family "Roboto Mono")
(variable-family "Inter"))
(custom-set-faces
;; set default font
`(default ((t (:inherit nil :extend nil :stipple nil
:inverse-video nil :box nil
:strike-through nil :overline nil :underline nil
:slant normal :weight normal
:height 100 :width normal
:family ,default-family))))
`(fixed-pitch ((t (:family ,default-family))))
`(fixed-pitch-serif ((t (:family ,default-family))))
`(variable-pitch ((t (:inherit default :weight regular :family ,variable-family))))))
#+end_src
* Font setter function
#+begin_src emacs-lisp
(defun set-face-attr-family (face font-families &optional attributes)
"Set FACE's font family to the first available font family from FONT-FAMILIES list,
and apply other ATTRIBUTES specified in the plist."
(when attributes
(while attributes
(let ((attr (pop attributes))
(value (pop attributes)))
(set-face-attribute face nil attr value))))
(let ((available-font (seq-find (lambda (font)
(find-font (font-spec :family font)))
font-families)))
(when available-font
;; Set the font family
(set-face-attribute face nil :family available-font)
;; Apply other attributes from the plist
(message "Set %s face to use font family: %s with attributes: %s"
face available-font attributes))))
#+end_src
* Set face family and attributes
#+begin_src emacs-lisp
(set-face-attr-family 'default
'("Roboto Mono" "Source Code Pro" "Fira Code" "Noto Sans Mono" "Cascadia Code" "SF Pro Mono" "fixed")
'(:inherit nil :extend nil :stipple nil
:inverse-video nil :box nil
:strike-through nil :overline nil :underline nil
:slant normal :weight normal
:height 100 :width normal))
(set-face-attr-family 'variable-pitch
'("Inter" "Cantarell" "Fira Sans" "Noto Sans" "Segoe UI" "SF Pro Display")
'(:inherit default :weight regular))
(set-face-attribute 'fixed-pitch nil :family (face-attribute 'default :family))
(set-face-attribute 'fixed-pitch-serif nil :family (face-attribute 'default :family))
(set-face-attribute 'fringe nil :background (face-background 'default))
(set-face-attribute 'line-number nil :background (face-background 'default))
(set-face-attribute 'line-number nil :foreground (face-foreground 'shadow))
#+end_src
* Chinese Font
#+begin_src emacs-lisp
;; (dolist (charset '(kana han symbol cjk-misc bopomofo))
;; (set-fontset-font (frame-parameter nil 'font)
;; charset (font-spec :family "Noto Sans Mono CJK TC Regular"
;; :size 10)))
#+end_src
* Font finder function
#+begin_src emacs-lisp
;; (defun find-available-font-family (font-families)
;; "Return the first available font family from FONT-FAMILIES list, or nil if none is found."
;; (seq-find (lambda (font)
;; (find-font (font-spec :family font)))
;; font-families))
#+end_src

View File

@@ -5,20 +5,19 @@ this file/section configures the UI settings
* Toolbar and Scrollbar * Toolbar and Scrollbar
removing this stuff makes emacs looks more cleaner removing this stuff makes emacs looks more cleaner
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(tool-bar-mode -1) (tool-bar-mode -1)
(menu-bar-mode -1) (menu-bar-mode -1)
(scroll-bar-mode -1) (scroll-bar-mode -1)
#+end_src #+end_src
* Maximize * Maximize
Start emacs as a maximized window at start Start emacs as a maximized window at start
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
;; (add-hook 'window-setup-hook 'toggle-frame-maximized t) ;; (add-hook 'window-setup-hook 'toggle-frame-maximized t)
#+end_src
#+END_SRC
* Window Size * Window Size
Set the default window size when making a new frame Set the default window size when making a new frame
@@ -37,18 +36,11 @@ run the function at startup of a frame
(add-hook 'before-make-frame-hook 'set-window-size) (add-hook 'before-make-frame-hook 'set-window-size)
#+end_src #+end_src
* Fringes
Fringes are the small gap at the side of emacs.
#+BEGIN_SRC emacs-lisp
(fringe-mode '(12 . 6))
#+END_SRC
* 80 Column Line with fill-column-indicator * 80 Column Line with fill-column-indicator
#+begin_src emacs-lisp #+begin_src emacs-lisp
(when (> emacs-major-version 27)
(add-hook 'text-mode-hook #'display-fill-column-indicator-mode) (add-hook 'text-mode-hook #'display-fill-column-indicator-mode)
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode) (add-hook 'prog-mode-hook #'display-fill-column-indicator-mode))
#+end_src #+end_src
* Cursor Shape * Cursor Shape
@@ -68,46 +60,36 @@ sets the tab size 5 spaces
c-basic-offset custom-tab-size)) c-basic-offset custom-tab-size))
#+end_src #+end_src
* Line numbers
Turn on line numbers in text mode/code modes.
~this part is not fully working~
#+BEGIN_SRC emacs-lisp
(add-hook 'term-mode-hook (lambda () (display-line-numbers-mode -1)))
(add-hook 'text-mode-hook 'display-line-numbers-mode)
(add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode)
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
#+END_SRC
* Line Highlight * Line Highlight
Highlights the current line Highlights the current line
#+begin_src emacs-lisp #+begin_src emacs-lisp
(global-hl-line-mode 1) (global-hl-line-mode 1)
#+end_src #+end_src
* Indentation guides
#+begin_src emacs-lisp
(use-package highlight-indent-guides
:hook (prog-mode . highlight-indent-guides-mode))
;; :custom
;; (highlight-indent-guides-method 'character "set the guide style to a bitmap picture")
;; (highlight-indent-guides-character "│" "set the guide character to a horizontal line")
;; (highlight-indent-guides-auto-enabled nil)
;; :config
;; (set-face-foreground 'highlight-indent-guides-character-face (face-foreground 'fill-column-indicator)))
#+end_src
* Matching Pairs * Matching Pairs
** Highlight ** Highlight
highlight matching pairs of parenthesis, and other characters highlight matching pairs of parenthesis, and other characters
#+begin_src emacs-lisp
#+BEGIN_SRC emacs-lisp
(show-paren-mode 1) (show-paren-mode 1)
#+end_src
#+END_SRC
** Electric-pair-mode ** Electric-pair-mode
Automatically pair parentheses, and other characters, built in on emacs Automatically pair parentheses, and other characters, built in on emacs
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
(electric-pair-mode 1) (electric-pair-mode 1)
#+end_src
#+END_SRC
* Clock/Time in Modeline * Clock/Time in Modeline
currently unused currently unused
@@ -116,45 +98,67 @@ sets the tab size 5 spaces
;; (display-time-mode) ;; (display-time-mode)
#+END_SRC #+END_SRC
* Focus on Hover
#+begin_src emacs-lisp
(setq mouse-autoselect-window t)
#+end_src
* Ligatures * Ligatures
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; (when (> emacs-major-version 28)
(use-package ligature ;; (use-package ligature
:config ;; :config
;; Enable the "www" ligature in every possible major mode ;; ;; Enable the "www" ligature in every possible major mode
(ligature-set-ligatures 't '("www")) ;; (ligature-set-ligatures 't '("www"))
;; Enable traditional ligature support in eww-mode, if the ;; ;; Enable traditional ligature support in eww-mode, if the
;; `variable-pitch' face supports it ;; ;; `variable-pitch' face supports it
(ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi")) ;; (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
;; Enable all Cascadia Code ligatures in programming modes ;; ;; Enable all ligatures in programming modes
(ligature-set-ligatures 'prog-mode '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>" ;; (ligature-set-ligatures 'prog-mode '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!==" ;; ":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
"!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<" ;; "!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
"<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->" ;; "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
"<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<" ;; "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
"..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~=" ;; "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
"~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|" ;; "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
"[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:" ;; "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:" ;; ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:"
"<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!" ;; "<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!"
"##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:" ;; "##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:"
"?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)" ;; "?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
"\\\\" "://")) ;; "\\\\" "://"))
;; Enables ligature checks globally in all buffers. You can also do it ;; ;; Enables ligature checks globally in all buffers. You can also do it
;; per mode with `ligature-mode'. ;; ;; per mode with `ligature-mode'.
(global-ligature-mode t)) ;; (global-ligature-mode t)))
#+end_src #+end_src
* Theme * Theme
Load theme (that is built-in) Load theme (that is built-in)
#+begin_src emacs-lisp #+begin_src emacs-lisp
(load-theme 'modus-vivendi t) (load-theme 'modus-vivendi t)
;; (use-package solarized-theme
;; :config
;; (load-theme 'solarized-selenized-black))
#+end_src
* Fringes
Fringes are the small gap at the side of emacs.
#+begin_src emacs-lisp
(fringe-mode '(12 . 6))
#+end_src
* Line numbers
Turn on line numbers in text mode/code modes.
#+begin_src emacs-lisp
(add-hook 'term-mode-hook (lambda () (display-line-numbers-mode -1)))
(add-hook 'text-mode-hook 'display-line-numbers-mode)
(add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode)
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
#+end_src #+end_src
* Welcome Screen * Welcome Screen
Having a blank screen at the start is much more simpler and better Having a blank screen at the start is much more simpler and better
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq inhibit-startup-screen t) (setq inhibit-startup-screen t)
#+end_src #+end_src

View File

@@ -13,13 +13,27 @@ Tree sitter highlighting in emacs.[[https://tree-sitter.github.io/tree-sitter/sy
Tree-sitter Syntax Highlighting website]] Tree-sitter Syntax Highlighting website]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
(when (version< emacs-version "29")
(use-package tree-sitter-langs)
(use-package tree-sitter (use-package tree-sitter
:after tree-sitter-langs
:diminish :diminish
:config :config
(global-tree-sitter-mode)) (global-tree-sitter-mode)))
(use-package tree-sitter-langs (add-hook 'prog-mode 'tree-sitter-hl-mode )
:after tree-sitter)
#+end_src
** treesit-auto
automatically install treesitter language
#+begin_src emacs-lisp
(use-package treesit-auto
:custom
(treesit-auto-install 'prompt)
:config
(treesit-auto-add-to-auto-mode-alist 'all)
(global-treesit-auto-mode))
#+end_src #+end_src
* Imenu-list * Imenu-list
@@ -31,7 +45,6 @@ Imenu, the tool to get function names in source codes in emacs, displayed and co
* Neotree * Neotree
Tree-based explorer for Emacs Tree-based explorer for Emacs
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package neotree (use-package neotree
:hook (neotree-mode . (lambda () :hook (neotree-mode . (lambda ()
@@ -49,7 +62,6 @@ Tree-based explorer for Emacs
* Magit * Magit
[[https://magit.vc][Git Interface for Emacs]] [[https://magit.vc][Git Interface for Emacs]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package magit (use-package magit
:bind :bind
@@ -66,14 +78,21 @@ This package provides Popup autocompletion
:bind :bind
(:map company-active-map (:map company-active-map
("<tab>" . company-select-next)) ("<tab>" . company-select-next))
:hook prog-mode
:custom :custom
(company-minimum-prefix-length 1) (company-minimum-prefix-length 1)
(company-idle-delay 0.0)) (company-idle-delay 0.0))
#+end_src #+end_src
* RESTClient
REST API Client in Emacs
#+begin_src emacs-lisp
(use-package restclient
:commands (restclient-mode))
#+end_src
* Eglot * Eglot
A simple package for LSP support A simple package for LSP support
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package eglot (use-package eglot
:config :config

View File

@@ -29,7 +29,7 @@ Tell gnus to read ~gnus.el~ from the config dir.
other configuration on gnus is on the ~gnus.el~ file. other configuration on gnus is on the ~gnus.el~ file.
* RMail Config * RMail Config
Even though Gnus is used as the main E-Mail reader, Rmail is also setup as a backup mail reader incase gnus became unused Even though Gnus is used as the main E-Mail reader, Rmail is also setup as a redundant mail reader.
** Dependencies ** Dependencies
Since RMail is only a Mail Reader, E-Mails needs to be fetched using external programs. Since RMail is only a Mail Reader, E-Mails needs to be fetched using external programs.
@@ -48,6 +48,12 @@ And those external programs are;
#+end_src #+end_src
* SMTP Mail Config * SMTP Mail Config
** Call required features
#+begin_src emacs-lisp
(require 'smtpmail)
(require 'starttls)
#+end_src
** Set Emacs' built in SMTP mail sender method ** Set Emacs' built in SMTP mail sender method
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq send-mail-function 'smtpmail-send-it) (setq send-mail-function 'smtpmail-send-it)

View File

@@ -1,16 +0,0 @@
#+TITLE: PDF-Tools Configuration
* Intro
*PDF-Tools* is a emacs package that provides better PDF support to emacs.
It is faster, and less resource intensive compared to Emacs' PDFView mode
#+begin_src emacs-lisp
(use-package pdf-tools
;; :hook "\\.pdf\\'"
:config
(pdf-loader-install)
:hook
(pdf-major-mode . (lambda () (fringe-mode 0)))
(pdf-outline-buffer-mode . (lambda ()
(display-line-numbers-mode -1))))
#+end_src

View File

@@ -9,16 +9,16 @@
(defun lang-default-settings () (defun lang-default-settings ()
"default setting for a language" "default setting for a language"
(display-line-numbers-mode) (display-line-numbers-mode)
(eglot-ensure) (treesit-auto-mode)
(company-mode)) (eglot-ensure))
#+end_src #+end_src
* Built-in Modes * Built-in Modes
** hook default settings to configured language modes ** hook default settings to configured language modes
#+begin_src emacs-lisp #+begin_src emacs-lisp
(let ((langs '("sh" "c++" "mhtml" "java" "js" "python" "latex"))) (let ((langs '("sh" "c++" "go-ts" "java" "js" "json" "LaTeX" "mhtml" "python" "typescript-ts" "tsx-ts" "python-ts")))
(dolist (lang langs) (dolist (lang langs)
(add-hook (intern (concat lang "-mode-hook")) (lambda () (lang-default-settings))))) (add-hook (intern (concat lang "-mode-hook")) 'lang-default-settings)))
#+end_src #+end_src
** add LSP server program names to eglot's configuration ** add LSP server program names to eglot's configuration
@@ -28,41 +28,52 @@
(java-mode . ("jdtls" "--stdio")) (java-mode . ("jdtls" "--stdio"))
(js-mode . ("typescript-language-server" "--stdio")) (js-mode . ("typescript-language-server" "--stdio"))
(python-mode . ("pyright-langserver" "--stdio")) (python-mode . ("pyright-langserver" "--stdio"))
(latex-mode . ("texlab" "--stdio"))))) (latex-mode . ("texlab"))
(json-mode . ("vscode-json-languageserver" "--stdio")))))
(setq eglot-server-programs (append server-programs eglot-server-programs))) (setq eglot-server-programs (append server-programs eglot-server-programs)))
#+end_src #+end_src
* Installed Modes * Installed Modes
** Go ** Go
unused, as tree-sitter has covered most needed functionality
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package go-mode ;; (use-package go-mode
:mode "\\.go\\'" ;; :mode "\\.go\\'"
:hook ;; :hook (go-mode . lang-default-settings)
(go-mode . (lambda () (lang-default-settings))) ;; :config
:config ;; (setq go-tab-width default-custom-tab-size))
(setq go-tab-width default-custom-tab-size))
#+end_src #+end_src
** TypeScript ** TypeScript
No longer using typescript-mode, as there's a builtin typescript-ts mode in Emacs 29
#+begin_src emacs-lisp #+begin_src emacs-lisp
(if (version< emacs-version "29")
(use-package typescript-mode (use-package typescript-mode
:mode "\\.ts\\'" :mode ("\\.ts\\'" ("\\.tsx\\'" . typescript-tsx-mode))
:init :config
(add-to-list 'eglot-server-programs `(typescript-mode . ("typescript-language-server"))) (define-derived-mode typescript-tsx-mode typescript-mode "TypeScriptReact")
(dolist (mode '(ykpescript-mode typescript-tsx-mode))
(add-to-list 'eglot-server-programs `(,mode . ("typescript-language-server", "--stdio"))))
:hook :hook
(typescript-mode . (lambda () (lang-default-settings)))) (typescript-mode . (lambda () (lang-default-settings)
(let ((custom-tab-size 2))
(setq-default default-tab-width custom-tab-size
tab-width custom-tab-size
c-basic-offset custom-tab-size))))
(typescript-tsx-mode . (lambda ()
(lang-default-settings)
(let ((custom-tab-size 4))
(setq-default default-tab-width custom-tab-size
tab-width custom-tab-size
c-basic-offset custom-tab-size))))))
#+end_src #+end_src
** Markdown ** Markdown
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package markdown-mode (use-package markdown-mode
:commands (markdown-mode gfm-mode) :commands (markdown-mode gfm-mode)
:mode (("\\.md\\'". markdown-mode) :mode ("\\.md\\'" "\\.markdown\\'")
("\\.markdown\\'" . markdown-mode)) :custom ((markdown-command "multimarkdown" "set the markdown command")))
:init
(setq markdown-command "multimarkdown"))
#+end_src #+end_src
** JSON ** JSON
@@ -72,14 +83,41 @@
("\\.jsonl\\'" . json-mode))) ("\\.jsonl\\'" . json-mode)))
#+end_src #+end_src
** LaTeX (AUCTeX)
#+begin_src emacs-lisp
(use-package tex
:ensure auctex
:custom
(TeX-view-program-selection '((output-pdf "PDF Tools")) "set emacs as pdf viewer")
(TeX-source-correlate-start-server t "recommended setting")
(TeX-engine 'xetex "set engine to xelatex")
(TeX-PDF-mode t "use pdf mode")
(TeX-auto-save t "recommended setting")
(TeX-parse-self t "packages support")
:config
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer))
#+end_src
** Python ** Python
*** Pyenv *** Pyenv
python venv manager python venv manager
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package pyvenv (use-package pyvenv
:commands (pyvenv-mode pyvenv-activate pyvenv-workon pyvenv-exec-shell pyvenv-virtual-env) :commands (pyvenv-mode pyvenv-activate pyvenv-workon pyvenv-exec-shell pyvenv-virtual-env)
:hook (python-mode . pyvenv-mode)) :hook (python-mode . pyvenv-mode)
:config
(setenv "WORKON_HOME" (expand-file-name ".local/opt/miniforge3/envs" (safe-getenv "HOME" user-home-path))))
#+end_src
*** Jupyter
#+begin_src emacs-lisp
(use-package ein
:commands (ein:run ein:notebook-open ein:login)
:bind ("C-c C-o" . ein:notebook-open)
:config
(add-to-list 'org-babel-load-languages '(ein . t)))
;; :custom
;; (ein:jupyter-server-use-subcommand "server" "use jupyterlab instead of jupyter notebook")
#+end_src #+end_src
*** Tab Size *** Tab Size
@@ -94,3 +132,12 @@ Python code is recomendded to set the tab size to 4
c-basic-offset custom-tab-size)))) c-basic-offset custom-tab-size))))
#+end_src #+end_src
* CSV-mode
#+begin_src emacs-lisp
(use-package csv-mode
:pin "gnu"
:commands (csv-mode csv-align-mode csv-field-index-mode)
:mode (("\\.csv\\'" . csv-align-mode) ("\\.tsv\\'" . csv-align-mode))
:custom (csv-invisibility-default nil "show separators when records are aligned"))
#+end_src

View File

@@ -5,13 +5,13 @@
* Ido * Ido
Ido is a autocomplete package for emacs' commands Ido is a autocomplete package for emacs' commands
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ido (use-package ido
:custom
(ido-virtual-buffers t)
(ido-use-faces t)
:config :config
(setq ido-everywhere t (ido-everywhere t)
ido-virtual-buffers t
ido-use-faces t)
(ido-mode 1)) (ido-mode 1))
#+end_src #+end_src
@@ -26,6 +26,21 @@ This config just sets the download directory
(eww-search-prefix "https://lite.duckduckgo.com/lite/?q=" "prefix url to do search")) (eww-search-prefix "https://lite.duckduckgo.com/lite/?q=" "prefix url to do search"))
#+end_src #+end_src
* PDF-Tools
*PDF-Tools* is a emacs package that provides better PDF support to emacs.
It is faster, and less resource intensive compared to Emacs' PDFView mode
#+begin_src emacs-lisp
(use-package pdf-tools
;; :hook "\\.pdf\\'"
:config
(pdf-loader-install)
:hook
(pdf-major-mode . (lambda () (fringe-mode 0)))
(pdf-outline-buffer-mode . (lambda ()
(display-line-numbers-mode -1))))
#+end_src
* Fancy Battery * Fancy Battery
This shows the battery level on the emacs modeline This shows the battery level on the emacs modeline
@@ -42,7 +57,8 @@ color delimiters (parentheses, brackets, braces, etc) according to their level/d
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package rainbow-delimiters (use-package rainbow-delimiters
:hook (emacs-lisp-mode . rainbow-delimiters-mode)) :hook ((emacs-lisp-mode . rainbow-delimiters-mode)
(prog-mode . rainbow-delimiters-mode)))
#+end_src #+end_src
* Org Tree Slide * Org Tree Slide
@@ -59,14 +75,36 @@ do presentations in Org mode
#+end_src #+end_src
* Emacs Shell * Emacs Shell
This sets the prompt to a lambda, for aesthetic reasons ** History
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq eshell-prompt-function (lambda nil (add-hook 'eshell-expand-input-functions 'eshell-expand-history-references)
(if (= (user-uid) 0) "" " λ ")))
(setq eshell-highlight-prompt nil)
#+end_src #+end_src
** Autocomplete
setup EShell's tab completion to be like bash's
#+begin_src emacs-lisp
(add-hook 'eshell-mode-hook (lambda () (setq pcomplete-cycle-completions nil)))
(setq eshell-cmpl-cycle-completions nil)
#+end_src
** Prompt
This sets the prompt to a lambda, for aesthetic reasons
#+begin_src emacs-lisp
(setq eshell-prompt-function
(lambda nil
(concat
(propertize (concat
"\n# "
(user-login-name)
"@"
(car (split-string system-name "\\."))
":"
(file-name-nondirectory (eshell/pwd))
(if (= (user-uid) 0) "" " λ"))
'face `(:inherit 'eshell-prompt :weight bold))
(propertize " " 'face `(:inherit default)))))
(setq eshell-highlight-prompt nil)
#+end_src
* Undo Tree * Undo Tree
a visualizer for Emacs' cool but confusing undo/history system a visualizer for Emacs' cool but confusing undo/history system
@@ -74,6 +112,8 @@ a visualizer for Emacs' cool but confusing undo/history system
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package undo-tree (use-package undo-tree
:diminish :diminish
:custom
(undo-tree-history-directory-alist `(("." . ,(expand-file-name "cache" user-emacs-directory))) ".undo-tree files dir")
:config :config
(global-undo-tree-mode)) (global-undo-tree-mode))
#+end_src #+end_src
@@ -84,6 +124,13 @@ a visualizer for Emacs' cool but confusing undo/history system
; (use-package pass) ; (use-package pass)
#+end_src #+end_src
* Nov.el
Mode to read epub files
#+begin_src emacs-lisp
(use-package nov
:mode ("\\.epub\\'" . nov-mode))
#+end_src
* Elgrep * Elgrep
a built in grep command in emacs a built in grep command in emacs
@@ -118,6 +165,18 @@ Abbrev is helpful for typing long commands, but I don't need to know it in the m
(org-crypt-use-before-save-magic)) (org-crypt-use-before-save-magic))
#+end_src #+end_src
* Telega
Telegram chat client for Emacs
#+begin_src emacs-lisp
(use-package telega
:commands telega
:pin "melpa-stable"
:custom
(telega-directory (expand-file-name "telega" user-emacs-directory) "set telega runtime files to be inside user-emacs-directory")
(telega-use-images t)
(telega-emoji-font-family "Noto Color Emoji")
(telega-emoji-use-images nil))
#+end_src
* Elfeed Web * Elfeed Web
Elfeed is a emacs package for reading RSS Web News. Elfeed is a emacs package for reading RSS Web News.