Compare commits
8 Commits
25b247c79d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e91b480dc | |||
| a7768782fe | |||
| 008ce842e7 | |||
| 6221e35733 | |||
| a3893fc061 | |||
| 4eea3f9d46 | |||
| bffcee2c6c | |||
| b3cf8eeaac |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,6 +21,7 @@ eln-cache/*
|
||||
|
||||
# etc
|
||||
auto-save-list*
|
||||
url
|
||||
|
||||
# don't ignore .gitignore
|
||||
!.gitignore
|
||||
|
||||
@@ -12,8 +12,14 @@ Functions needed at the start of the configuration
|
||||
* User Emacs Directories
|
||||
set the directory for emacs and it's apps to put stuff.
|
||||
#+begin_src emacs-lisp
|
||||
(if (version< "28" emacs-version)
|
||||
(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
|
||||
|
||||
* 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
|
||||
#+begin_src emacs-lisp
|
||||
(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
|
||||
(if (file-exists-p personal-file-path)
|
||||
|
||||
@@ -20,7 +20,7 @@ this speeds up emacs startup
|
||||
|
||||
** Set Package Directory
|
||||
#+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
|
||||
|
||||
** Add package sources
|
||||
|
||||
@@ -15,25 +15,26 @@ scheduling, and loads of other stuff
|
||||
|
||||
* 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 :height 0.91))))
|
||||
'(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 :height 0.91))))
|
||||
'(org-code ((t (:inherit (shadow fixed-pitch) :height 0.91))))
|
||||
'(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) :height 0.91))))
|
||||
'(org-indent ((t (:inherit (org-hide fixed-pitch) :height 0.91))))
|
||||
'(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) :height 0.91))))
|
||||
'(org-property-value ((t (:inherit fixed-pitch :height 0.91))) t)
|
||||
'(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch) :height 0.91))))
|
||||
'(org-table ((t (:inherit fixed-pitch :foreground "#83a598" :height 0.91))))
|
||||
'(org-tag ((t (:inherit (shadow fixed-pitch) :height 0.91 :weight bold :height 0.8))))
|
||||
'(org-verbatim ((t (:inherit (shadow fixed-pitch) :height 0.91))))))
|
||||
'(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
|
||||
@@ -63,7 +64,7 @@ Make header and document title fonts bigger for better visibility.
|
||||
:custom
|
||||
(org-hide-emphasis-markers nil)
|
||||
(org-agenda-files
|
||||
`(,(expand-file-name "shared/org" (safe-getenv "HOME" user-home-path))))
|
||||
`(,(expand-file-name "docs/notes" (safe-getenv "HOME" user-home-path))))
|
||||
|
||||
:config
|
||||
;; font setup
|
||||
|
||||
@@ -1,27 +1,81 @@
|
||||
#+TITLE: Font Configuration
|
||||
This config uses Mozilla's Fira Set of fonts and the related Fira Code fonts with added Nerd fonts.
|
||||
So for this to run, Fira Sans and FiraCode Nerd Font needs to be installed in the system.
|
||||
|
||||
* Configuration
|
||||
** default fonts
|
||||
* 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
|
||||
`(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
|
||||
:foundry "CTDB" :family "FiraCode Nerd Font Mono"))))
|
||||
'(fixed-pitch ((t (:family "FiraCode Nerd Font Mono"))))
|
||||
'(fixed-pitch-serif ((t (:family "FiraCode Nerd Font Mono"))))
|
||||
'(variable-pitch ((t (:inherit default :height 1.2 :weight medium :family "Cantarell")))))
|
||||
: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
|
||||
|
||||
** Chinese Font
|
||||
* 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
|
||||
|
||||
@@ -5,6 +5,7 @@ this file/section configures the UI settings
|
||||
|
||||
* Toolbar and Scrollbar
|
||||
removing this stuff makes emacs looks more cleaner
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(tool-bar-mode -1)
|
||||
(menu-bar-mode -1)
|
||||
@@ -14,11 +15,9 @@ this file/section configures the UI settings
|
||||
* Maximize
|
||||
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)
|
||||
|
||||
#+END_SRC
|
||||
#+end_src
|
||||
|
||||
* Window Size
|
||||
Set the default window size when making a new frame
|
||||
@@ -37,13 +36,6 @@ run the function at startup of a frame
|
||||
(add-hook 'before-make-frame-hook 'set-window-size)
|
||||
#+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
|
||||
#+begin_src emacs-lisp
|
||||
(when (> emacs-major-version 27)
|
||||
@@ -68,46 +60,36 @@ sets the tab size 5 spaces
|
||||
c-basic-offset custom-tab-size))
|
||||
#+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
|
||||
Highlights the current line
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
|
||||
(global-hl-line-mode 1)
|
||||
#+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
|
||||
|
||||
** Highlight
|
||||
highlight matching pairs of parenthesis, and other characters
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(show-paren-mode 1)
|
||||
|
||||
#+END_SRC
|
||||
|
||||
#+end_src
|
||||
** Electric-pair-mode
|
||||
Automatically pair parentheses, and other characters, built in on emacs
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(electric-pair-mode 1)
|
||||
|
||||
#+END_SRC
|
||||
#+end_src
|
||||
|
||||
* Clock/Time in Modeline
|
||||
currently unused
|
||||
@@ -116,41 +98,63 @@ sets the tab size 5 spaces
|
||||
;; (display-time-mode)
|
||||
#+END_SRC
|
||||
|
||||
* Focus on Hover
|
||||
#+begin_src emacs-lisp
|
||||
(setq mouse-autoselect-window t)
|
||||
#+end_src
|
||||
|
||||
* Ligatures
|
||||
#+begin_src emacs-lisp
|
||||
(when (> emacs-major-version 28)
|
||||
(use-package ligature
|
||||
:config
|
||||
;; Enable the "www" ligature in every possible major mode
|
||||
(ligature-set-ligatures 't '("www"))
|
||||
;; Enable traditional ligature support in eww-mode, if the
|
||||
;; `variable-pitch' face supports it
|
||||
(ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
|
||||
;; Enable all Cascadia Code ligatures in programming modes
|
||||
(ligature-set-ligatures 'prog-mode '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
|
||||
":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
|
||||
"!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
|
||||
"<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
|
||||
"<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
|
||||
"..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
|
||||
"~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
|
||||
"[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
|
||||
">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:"
|
||||
"<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!"
|
||||
"##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:"
|
||||
"?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
|
||||
"\\\\" "://"))
|
||||
;; Enables ligature checks globally in all buffers. You can also do it
|
||||
;; per mode with `ligature-mode'.
|
||||
(global-ligature-mode t)))
|
||||
|
||||
|
||||
;; (when (> emacs-major-version 28)
|
||||
;; (use-package ligature
|
||||
;; :config
|
||||
;; ;; Enable the "www" ligature in every possible major mode
|
||||
;; (ligature-set-ligatures 't '("www"))
|
||||
;; ;; Enable traditional ligature support in eww-mode, if the
|
||||
;; ;; `variable-pitch' face supports it
|
||||
;; (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
|
||||
;; ;; Enable all ligatures in programming modes
|
||||
;; (ligature-set-ligatures 'prog-mode '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
|
||||
;; ":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
|
||||
;; "!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
|
||||
;; "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
|
||||
;; "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
|
||||
;; "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
|
||||
;; "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
|
||||
;; "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
|
||||
;; ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:"
|
||||
;; "<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!"
|
||||
;; "##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:"
|
||||
;; "?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
|
||||
;; "\\\\" "://"))
|
||||
;; ;; Enables ligature checks globally in all buffers. You can also do it
|
||||
;; ;; per mode with `ligature-mode'.
|
||||
;; (global-ligature-mode t)))
|
||||
#+end_src
|
||||
|
||||
* Theme
|
||||
Load theme (that is built-in)
|
||||
#+begin_src emacs-lisp
|
||||
(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
|
||||
|
||||
* Welcome Screen
|
||||
|
||||
@@ -13,13 +13,27 @@ Tree sitter highlighting in emacs.[[https://tree-sitter.github.io/tree-sitter/sy
|
||||
Tree-sitter Syntax Highlighting website]]
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(when (version< emacs-version "29")
|
||||
(use-package tree-sitter-langs)
|
||||
(use-package tree-sitter
|
||||
:after tree-sitter-langs
|
||||
:diminish
|
||||
:config
|
||||
(global-tree-sitter-mode))
|
||||
(global-tree-sitter-mode)))
|
||||
|
||||
(use-package tree-sitter-langs
|
||||
:after tree-sitter)
|
||||
(add-hook 'prog-mode 'tree-sitter-hl-mode )
|
||||
|
||||
#+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
|
||||
|
||||
* Imenu-list
|
||||
@@ -31,7 +45,6 @@ Imenu, the tool to get function names in source codes in emacs, displayed and co
|
||||
|
||||
* Neotree
|
||||
Tree-based explorer for Emacs
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package neotree
|
||||
:hook (neotree-mode . (lambda ()
|
||||
@@ -49,7 +62,6 @@ Tree-based explorer for Emacs
|
||||
|
||||
* Magit
|
||||
[[https://magit.vc][Git Interface for Emacs]]
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package magit
|
||||
:bind
|
||||
@@ -66,6 +78,7 @@ This package provides Popup autocompletion
|
||||
:bind
|
||||
(:map company-active-map
|
||||
("<tab>" . company-select-next))
|
||||
:hook prog-mode
|
||||
:custom
|
||||
(company-minimum-prefix-length 1)
|
||||
(company-idle-delay 0.0))
|
||||
@@ -75,12 +88,11 @@ This package provides Popup autocompletion
|
||||
REST API Client in Emacs
|
||||
#+begin_src emacs-lisp
|
||||
(use-package restclient
|
||||
:command (restclient-mode))
|
||||
:commands (restclient-mode))
|
||||
#+end_src
|
||||
|
||||
* Eglot
|
||||
A simple package for LSP support
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package eglot
|
||||
:config
|
||||
|
||||
@@ -29,7 +29,7 @@ Tell gnus to read ~gnus.el~ from the config dir.
|
||||
other configuration on gnus is on the ~gnus.el~ file.
|
||||
|
||||
* 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
|
||||
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
|
||||
|
||||
* SMTP Mail Config
|
||||
** Call required features
|
||||
#+begin_src emacs-lisp
|
||||
(require 'smtpmail)
|
||||
(require 'starttls)
|
||||
#+end_src
|
||||
|
||||
** Set Emacs' built in SMTP mail sender method
|
||||
#+begin_src emacs-lisp
|
||||
(setq send-mail-function 'smtpmail-send-it)
|
||||
|
||||
@@ -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
|
||||
@@ -9,16 +9,16 @@
|
||||
(defun lang-default-settings ()
|
||||
"default setting for a language"
|
||||
(display-line-numbers-mode)
|
||||
(eglot-ensure)
|
||||
(company-mode))
|
||||
(treesit-auto-mode)
|
||||
(eglot-ensure))
|
||||
#+end_src
|
||||
|
||||
* Built-in Modes
|
||||
** hook default settings to configured language modes
|
||||
#+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)
|
||||
(add-hook (intern (concat lang "-mode-hook")) (lambda () (lang-default-settings)))))
|
||||
(add-hook (intern (concat lang "-mode-hook")) 'lang-default-settings)))
|
||||
#+end_src
|
||||
|
||||
** add LSP server program names to eglot's configuration
|
||||
@@ -28,41 +28,52 @@
|
||||
(java-mode . ("jdtls" "--stdio"))
|
||||
(js-mode . ("typescript-language-server" "--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)))
|
||||
#+end_src
|
||||
|
||||
* Installed Modes
|
||||
** Go
|
||||
unused, as tree-sitter has covered most needed functionality
|
||||
#+begin_src emacs-lisp
|
||||
(use-package go-mode
|
||||
:mode "\\.go\\'"
|
||||
:hook
|
||||
(go-mode . (lambda () (lang-default-settings)))
|
||||
:config
|
||||
(setq go-tab-width default-custom-tab-size))
|
||||
|
||||
;; (use-package go-mode
|
||||
;; :mode "\\.go\\'"
|
||||
;; :hook (go-mode . lang-default-settings)
|
||||
;; :config
|
||||
;; (setq go-tab-width default-custom-tab-size))
|
||||
#+end_src
|
||||
|
||||
** TypeScript
|
||||
No longer using typescript-mode, as there's a builtin typescript-ts mode in Emacs 29
|
||||
#+begin_src emacs-lisp
|
||||
(if (version< emacs-version "29")
|
||||
(use-package typescript-mode
|
||||
:mode "\\.ts\\'"
|
||||
:init
|
||||
(add-to-list 'eglot-server-programs `(typescript-mode . ("typescript-language-server")))
|
||||
:mode ("\\.ts\\'" ("\\.tsx\\'" . typescript-tsx-mode))
|
||||
:config
|
||||
(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
|
||||
(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
|
||||
|
||||
** Markdown
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package markdown-mode
|
||||
:commands (markdown-mode gfm-mode)
|
||||
:mode (("\\.md\\'". markdown-mode)
|
||||
("\\.markdown\\'" . markdown-mode))
|
||||
:init
|
||||
(setq markdown-command "multimarkdown"))
|
||||
:mode ("\\.md\\'" "\\.markdown\\'")
|
||||
:custom ((markdown-command "multimarkdown" "set the markdown command")))
|
||||
#+end_src
|
||||
|
||||
** JSON
|
||||
@@ -72,10 +83,24 @@
|
||||
("\\.jsonl\\'" . json-mode)))
|
||||
#+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
|
||||
*** Pyenv
|
||||
python venv manager
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package pyvenv
|
||||
:commands (pyvenv-mode pyvenv-activate pyvenv-workon pyvenv-exec-shell pyvenv-virtual-env)
|
||||
@@ -84,6 +109,17 @@ python venv manager
|
||||
(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
|
||||
|
||||
*** Tab Size
|
||||
Python code is recomendded to set the tab size to 4
|
||||
|
||||
@@ -96,3 +132,12 @@ Python code is recomendded to set the tab size to 4
|
||||
c-basic-offset custom-tab-size))))
|
||||
#+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
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
* Ido
|
||||
Ido is a autocomplete package for emacs' commands
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ido
|
||||
:custom
|
||||
(ido-virtual-buffers t)
|
||||
(ido-use-faces t)
|
||||
:config
|
||||
(setq ido-everywhere t
|
||||
ido-virtual-buffers t
|
||||
ido-use-faces t)
|
||||
(ido-everywhere t)
|
||||
(ido-mode 1))
|
||||
#+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"))
|
||||
#+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
|
||||
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
|
||||
(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
|
||||
|
||||
* Org Tree Slide
|
||||
@@ -59,14 +75,36 @@ do presentations in Org mode
|
||||
#+end_src
|
||||
|
||||
* Emacs Shell
|
||||
This sets the prompt to a lambda, for aesthetic reasons
|
||||
|
||||
** History
|
||||
#+begin_src emacs-lisp
|
||||
(setq eshell-prompt-function (lambda nil
|
||||
(if (= (user-uid) 0) " #λ " " λ ")))
|
||||
(setq eshell-highlight-prompt nil)
|
||||
(add-hook 'eshell-expand-input-functions 'eshell-expand-history-references)
|
||||
#+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
|
||||
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
|
||||
(use-package undo-tree
|
||||
:diminish
|
||||
:custom
|
||||
(undo-tree-history-directory-alist `(("." . ,(expand-file-name "cache" user-emacs-directory))) ".undo-tree files dir")
|
||||
:config
|
||||
(global-undo-tree-mode))
|
||||
#+end_src
|
||||
@@ -84,6 +124,13 @@ a visualizer for Emacs' cool but confusing undo/history system
|
||||
; (use-package pass)
|
||||
#+end_src
|
||||
|
||||
* Nov.el
|
||||
Mode to read epub files
|
||||
#+begin_src emacs-lisp
|
||||
(use-package nov
|
||||
:mode ("\\.epub\\'" . nov-mode))
|
||||
#+end_src
|
||||
|
||||
* Elgrep
|
||||
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))
|
||||
#+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 is a emacs package for reading RSS Web News.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user