Compare commits

...

2 Commits

6 changed files with 131 additions and 12 deletions

View File

@ -1,5 +1,12 @@
#+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
#+begin_src emacs-lisp
(require 'package)
@ -17,9 +24,10 @@ this speeds up emacs startup
#+end_src
** 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" . "http://melpa.org/packages/"))
#+end_src

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

@ -0,0 +1,75 @@
#+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 :height 0.91))))
;; '(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-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-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))))))
#+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 "shared/org" (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

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

@ -0,0 +1,27 @@
#+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
#+begin_src emacs-lisp
(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
: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")))))
#+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

View File

@ -45,10 +45,10 @@ run the function at startup of a frame
#+END_SRC
* 80 Column Line with fill-column-indicator
#+begin_src emacs-lisp
(add-hook 'text-mode-hook #'display-fill-column-indicator-mode)
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
(when (> emacs-major-version 27)
(add-hook 'text-mode-hook #'display-fill-column-indicator-mode)
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode))
#+end_src
* Cursor Shape
@ -118,8 +118,8 @@ sets the tab size 5 spaces
* Ligatures
#+begin_src emacs-lisp
(use-package ligature
(when (> emacs-major-version 28)
(use-package ligature
:config
;; Enable the "www" ligature in every possible major mode
(ligature-set-ligatures 't '("www"))
@ -142,13 +142,13 @@ sets the tab size 5 spaces
"\\\\" "://"))
;; Enables ligature checks globally in all buffers. You can also do it
;; per mode with `ligature-mode'.
(global-ligature-mode t))
(global-ligature-mode t)))
#+end_src
* Theme
Load theme (that is built-in)
#+begin_src emacs-lisp
(load-theme 'modus-vivendi t)
#+end_src

View File

@ -70,7 +70,14 @@ This package provides Popup autocompletion
(company-minimum-prefix-length 1)
(company-idle-delay 0.0))
#+end_src
* RESTClient
REST API Client in Emacs
#+begin_src emacs-lisp
(use-package restclient
:command (restclient-mode))
#+end_src
* Eglot
A simple package for LSP support

View File

@ -79,7 +79,9 @@ python venv manager
#+begin_src emacs-lisp
(use-package pyvenv
: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
*** Tab Size