Skip to content
development
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Packages

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)

Defaults

(use-package uniquify
  :config
  (setq uniquify-buffer-name-style 'forward
        uniquify-separator "/"
        uniquify-after-kill-buffer-p t    ;; rename buffer after killing uniquify
        uniquify-ignore-buffers-re "^\\*" ;; don't mock special buffers
        ))


;; Enable show paren mode and set it to show matching parens immediately
(show-paren-mode)
(setq show-paren-delay 0
      show-paren-style 'expression)

;; Enable ~y-or-no-p~
(fset 'yes-or-no-p 'y-or-n-p)

;; Enable visible-bell to save ears
(setq-default visible-bell t)

;; Remove initial message from scratch buffer:
(setq-default initial-scratch-message "")

;; Remove startup message:
(setq-default inhibit-startup-message t)

;; http://ergoemacs.org/emacs/emacs_tabs_space_indentation_setup.html
(setq-default indent-tabs-mode nil)

;; Strip UI
(scroll-bar-mode 0)
(tool-bar-mode 0)
(menu-bar-mode 0)

;; Show line number in the mode-line:
(line-number-mode t)

;; Show column number in the mode-line:
(column-number-mode t)

;; Show file size in the mode-line:
(size-indication-mode t)

;; Enable global font lock
(global-font-lock-mode)

;; highlight current line
(global-hl-line-mode)

;; whitespaces
(setq whitespace-style '(tab-mark))
(global-whitespace-mode)

;; backups
(setq make-backup-files nil
      auto-save-default nil)

;; TODO add description
(auto-save-visited-mode)
(global-auto-revert-mode)

;; TODO add save on hooks from lolsmacs

;; emacs server
(server-start)

;; Remember the positon in the buffer
(save-place-mode 1)

Beacon

(use-package beacon
  :straight t
  :config
  (beacon-mode +1)
  (setq beacon-color "#ff8059"))

Helper Functions

Write helper to run a piece of code when a package is loaded.

References:

  1. doom after!
  2. ace wiki

End of line helper

source

(defun no-junk-please-were-unixish ()
  (interactive)
  (let ((coding-str (symbol-name buffer-file-coding-system)))
    (when (string-match "-\\(?:dos\\|mac\\)$" coding-str)
      (set-buffer-file-coding-system 'unix))))

Navigation

Scrolling

(use-package smooth-scrolling
  :straight (smooth-scrolling :type git :host github :repo "aspiers/smooth-scrolling")
  :init
  (smooth-scrolling-mode 1))

Modalka

(use-package crux
  :straight t)

(defun run-exit-modalka (func &rest args)
  "run func and exit modalka mode afterwards."
  (apply func args)
  (if modalka-mode
      (disable-modalka)))

(defun enable-modalka ()
  "Enable modalka if it's not already active"
  (interactive)
  (if (not modalka-mode)
      (modalka-mode 1))
  (message "modalka is enable now."))

(defun disable-modalka ()
  "Disable modalka if it's active."
  (interactive)
  (if modalka-mode
      (modalka-mode -1))
  (message "modalka is disable now."))

(defun insert-forward ()
  "Move one character forward and exit modalka"
  (interactive)
  (run-exit-modalka 'forward-char))

(defun insert-end-of-line ()
  "Move to the end of line and exit modalka"
  (interactive)
  (run-exit-modalka 'end-of-line))

(defun insert-new-line-above ()
  "Open a new line above and exit modalka"
  (interactive)
  (run-exit-modalka 'crux-smart-open-line-above))

(defun insert-new-line ()
  "Open a new line and exit modalka"
  (interactive)
  (run-exit-modalka 'crux-smart-open-line nil))

(defun kill-line-forward ()
  "Kill current line and the one after it"
  (interactive)
  (crux-kill-whole-line 2))

(defun kill-line-backward ()
  "Kill current line and the one before it"
  (interactive)
  (previous-line 1)
  (crux-kill-whole-line 2))

(defun replace-char-at-point ()
  "Replace char at point"
  (interactive)
  (let ((cursor-color (face-attribute 'cursor :background)))
    (blink-cursor-mode 0)
    (set-cursor-color "#005e00")
    (let ((char (read-key)))
      (delete-char 1)
      (insert char)
      (backward-char))
    (set-cursor-color cursor-color)
    (blink-cursor-mode 1)
    ))

(defun find-literate-config ()
  "Find literate config file"
  (interactive)
  (find-file (expand-file-name "README.org" user-emacs-directory)))

(defun kill-point-or-region ()
  "kill current character at point or marked region"
  (interactive)
  (if mark-active
      (kill-region (region-beginning) (region-end))
    (kill-region (point) (+ (point) 1))))

(use-package easy-kill
  :straight t)

(use-package avy
  :straight t)

(use-package modalka
  :straight t
  :after general crux hydra general
  :config
  (setq-default cursor-type '(bar . 2))
  (setq modalka-cursor-type 'box)

  (defhydra kill-hydra (:color blue)
    ("d" crux-kill-whole-line "kill current line")
    ("w" kill-word "kill next word")
    ("$" kill-line "kill to the end of line")
    ("j" kill-line-forward "kill line forward")
    ("k" kill-line-backward "kill line backward"))

  (modalka-global-mode 1)

  (general-define-key
   :keymaps 'modalka-mode-map
   :prefix "SPC"
   "" nil
   ":" 'hydra-anzu/body
   "J" 'hydra-journal/body
   "P" 'hydra-projectile-other-window/body
   "X" 'org-capture
   "bb" 'ivy-switch-buffer
   "br" 'crux-rename-file-and-buffer
   "e" 'hydra-expand/body
   "ff" 'counsel-find-file
   "fi" 'find-literate-config
   "fr" 'counsel-recentf
   "fs" 'save-buffer
   "gg" 'magit-status
   "i"  'ivy-yasnippet
   "j" 'dumb-jump-hydra/body
   "l" 'hydra-eglot/body
   "p" 'hydra-projectile/body
   "or" 'hydra-roam/body
   "oa" 'org-agenda
   "w" 'hydra-window/body
   )

  (general-define-key
   :keymaps 'modalka-mode-map
   "M-;" 'comment-line
   "RET" ""
   "DEL" ""
   "!" ""
   "@" ""
   "#" ""
   "%" ""
   "^" ""
   "&" ""
   "(" ""
   ")" ""
   "-" ""
   "+" ""
   "\\" ""
   "|" ""
   "[" ""
   "]" ""
   "{" ""
   "'" ""
   ";" ""
   "\"" ""
   ":" 'avy-goto-line
   "/" 'swiper-isearch
   "." ""
   "," ""
   ">" ""
   "<" ""
   "`'" ""
   "~" ""
   "0" 'beginning-of-line
   "*" 'swiper-thing-at-point
   "=" 'indent-region
   "$" 'end-of-line
   "A" 'insert-end-of-line
   "B" ""
   "C" ""
   "D" ""
   "E" ""
   "F" 'avy-goto-char-timer
   "G" 'end-of-buffer
   "H" ""
   "I" ""
   "J" ""
   "K" ""
   "L" ""
   "M" ""
   "N" ""
   "O" 'insert-new-line-above
   "P" ""
   "Q" ""
   "R" ""
   "S" ""
   "T" ""
   "U" ""
   "V" ""
   "W" ""
   "Y" ""
   "Z" ""
   "C-r" 'undo-redo
   "X" 'backward-delete-char-untabify
   "^" 'back-to-indentation
   "a" 'insert-forward
   "b" 'backward-word
   "c" ""
   "d" 'kill-hydra/body
   "e" ""
   "f" 'avy-goto-char-in-line
   "g" nil
   "gg" 'beginning-of-buffer
   "h" 'backward-char
   "i" 'disable-modalka
   "j" 'next-line
   "k" 'previous-line
   "l" 'forward-char
   "m" ""
   "n" ""
   "o" 'insert-new-line
   "p" 'yank
   "q" ""
   "r" 'replace-char-at-point
   "s" ""
   "t" ""
   "u" 'undo
   "v" ""
   "w" 'forward-word
   "x" 'kill-point-or-region
   "z" ""
   "y" nil
   "yy" 'easy-kill
   )

  (modalka-define-kbd "1" "M-1")
  (modalka-define-kbd "2" "M-2")
  (modalka-define-kbd "3" "M-3")
  (modalka-define-kbd "4" "M-4")
  (modalka-define-kbd "5" "M-5")
  (modalka-define-kbd "6" "M-6")
  (modalka-define-kbd "7" "M-7")
  (modalka-define-kbd "8" "M-8")
  (modalka-define-kbd "9" "M-9")
  (general-define-key [escape] 'enable-modalka)
  )

General

  • NOTE: It’s important to keep it up here, to have :general keyword available in use-package.
  • evil-collection binds over SPC in many packages. To use SPC as a leader key with the general library set general-override-states (source).
(use-package general
  :straight t)

Hydra

  • NOTE: It’s important to keep it up here, to have :general keyword available in use-package.
(use-package hydra
  :straight t
  :config
  ;; This configuration is noted on the header of `hydra-example.el`
  (setq hydra-examples-verbatim t)
  ;; hydra-move-splitters are defined here
  (require 'hydra-examples))

Ivy

  • NOTE: Ivy is splitted into:
    1. ivy
    2. swiper
    3. counsel: Installing this one will bring in the other two as dependencies..
(use-package counsel
  :straight t
  :general ("C-s" 'swiper-isearch
            "M-y" 'counsel-yank-pop)
  :config
  ;; Enable ivy globally
  (ivy-mode 1)
  (counsel-mode 1)
  )

This ivy-rich package provides some quick documents around the completion object, which is quite useful.

(use-package ivy-rich
  :straight t
  :config
  (ivy-rich-mode 1))

Better sorting (prescient):

(use-package ivy-prescient
  :straight t
  :config
  (ivy-prescient-mode))

Sources

  1. Swiper Documents

Ace

(use-package ace-window
  :straight t)

Keybindings

Zoom Hydra

(defhydra hydra-zoom (global-map "<f2>")
  "zoom"
  ("=" text-scale-increase "in")
  ("-" text-scale-decrease "out")
  ("r" text-scale-set "reset"))

Help Hydra

(global-set-key
 (kbd "<f1>")
 (defhydra hydra-help (:color blue)
   "help"
   ("f" counsel-describe-function "function")
   ("v" counsel-describe-variable "variable")
   ("k" describe-key "key")))

Window Hydra

(defhydra hydra-window (:color blue)
  "window"
  ("h" windmove-left "move-left")
  ("j" windmove-down "move-down")
  ("k" windmove-up "move-up")
  ("l" windmove-right "move-write")

  ("H" hydra-move-splitter-left nil)
  ("J" hydra-move-splitter-down nil)
  ("K" hydra-move-splitter-up nil)
  ("L" hydra-move-splitter-right nil)
  ("/" (lambda ()
         (interactive)
         (split-window-right)
         (windmove-right))
   "split-vertically")
  ("-" (lambda ()
         (interactive)
         (split-window-below)
         (windmove-down))
   "split-horizontally")
  ("o" delete-other-windows "one" :exit t)
  ("a" ace-window "ace")
  ("s" ace-swap-window "swap")
  ("d" ace-delete-window "del")
  ("i" ace-maximize-window "ace-one" :exit t))

Utils

Restart Emacs

(use-package restart-emacs
  :straight t)

Path

(use-package exec-path-from-shell
  :straight t
  :config
  (when (memq window-system '(mac ns x))
    (exec-path-from-shell-initialize)))

Workgroups

(use-package workgroups
  :straight (workgroups :type git :host github :repo "tlh/workgroups.el")
  :init
  (require 'workgroups)
  (workgroups-mode 1)
  :config
  (setq wg-prefix-key (kbd "C-c w")))

VTerm

(use-package vterm
  :straight t
  :config
  (define-key vterm-mode-map [escape] nil)
  (setq vterm-kill-buffer-on-exit t))

eshell

(use-package eshell
  :config
  (setq eshell-visual-commands '("vi" "screen" "top" "less" "more" "lynx"
                                 "ncftp" "pine" "tin" "trn" "elm" "vim" "apt"
                                 "nmtui" "alsamixer" "htop" "el" "elinks" "sbt"
                                 ))
  (add-hook
   'eshell-mode-hook
   (lambda ()
     (setq pcomplete-cycle-completions nil)))
  )

eshell-up

(use-package eshell-up
  :straight t)

eshell-toggle

(require 'eshell)
(require 'em-smart)
(setq eshell-where-to-jump 'begin)
(setq eshell-review-quick-commands nil)
(setq eshell-smart-space-goes-to-end t)
(use-package eshell-toggle
  :straight (eshell-toggle :type git :host github :repo "4DA/eshell-toggle")
  :custom
  (eshell-toggle-size-fraction 3)
  (eshell-toggle-use-projectile-root t)
  (eshell-toggle-run-command nil)
  (eshell-toggle-init-function #'eshell-toggle-init-eshell)
  :bind
  ("<f12>" . eshell-toggle))

esh-autosuggest

(use-package esh-autosuggest
  :straight t
  :hook (eshell-mode . esh-autosuggest-mode))

Org

Main Tools

Org-Mode

(use-package org
  :straight org-plus-contrib
  :config
  (require 'ob-tangle)
  (require 'org-tempo)

  (setq org-use-speed-commands t
        org-src-fontify-natively t
        org-src-tab-acts-natively t
        org-capture-inbox-file "~/org/inbox.org"
        org-capture-web-file "~/org/web.org"
        org-agenda-files '("~/org/agenda.org"))

  (setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
  (require 'org-protocol))

Org-Journal

(defun get-org-journal-date (date)
  "Get org-journal's file for the DATE."
  (let ((name (format-time-string org-journal-file-format date)))
    (expand-file-name (concat (file-name-as-directory org-journal-dir) name))))

(defun get-org-journal-today ()
  "Get today's journal file path."
  (get-org-journal-date (current-time)))

(defun org-journal-today ()
  "Get todays journal file path."
  (interactive)
  (find-file (get-org-journal-today)))

(use-package org-journal
  :straight t
  :after org
  :config
  (setq org-journal-dir "~/org/journal"
        org-journal-date-prefix "#+TITLE: "
        org-journal-file-format "%Y-%m-%d.org"
        org-journal-date-format "%A, %d %B %Y")

  (defhydra hydra-journal (:color blue)
    ("t" org-journal-today "get today's journal file"))
  )

Org-Roam

(use-package org-roam
  :straight t
  :after org
  :hook
  (after-init . org-roam-mode)
  :custom
  (org-roam-directory "~/org/wiki")
  :config

  (defhydra hydra-roam (:color blue)
    ("l" org-roam "roam")
    ("f" org-roam-find-file "find roam file")
    ("g" org-roam-graph-show "show graph")
    ("i" org-roam-insert "insert roam link")
    ("I" org-roam-insert-immediate "insert roam link immediately")
    ))

Org Capture Templates

(setq org-capture-templates `(("t" "Todo [inbox]" entry
                               (file+headline org-capture-inbox-file "Tasks")
                               "* TODO %i%?")
                              ("j" "Journal"
                               entry (file ,(get-org-journal-today))
                               "* %<%H:%M-%Z>: %?"
                               :empty-lines 1)
                              ("b" "Quick link bookmark" entry
                               (file+headline org-capture-web-file "Bookmarks")
                               "* %a %U"
                               :immediate-finish t)
                              ("B" "Link capture" entry
                               (file+headline org-capture-web-file "Bookmarks")
                               "* %a %U")
                              ("l" "Quick read later" entry
                               (file+headline org-capture-web-file "Read Later")
                               "* TODO %a %U"
                               :immediate-finish t)
                              ("L" "Read Later" entry
                               (file+headline org-capture-web-file "Read Later")
                               "* TODO %a %U")
                              ))

Bullets

(use-package org-bullets      
  :straight t
  :config
  (add-hook 'org-mode-hook #'org-bullets-mode))

Fix void symbol's function error on export

Currently quickfix for this is:

(org-reload)

Web Tools

(use-package org-web-tools
  :straight t)

Sources

  1. org-documents structured templates

Org Pomodoro

(use-package org-pomodoro
  :straight t)

Programming

Projectile

(use-package projectile
  :straight t
  :config
  (projectile-mode +1)
  (setq projectile-enable-caching t))

(use-package counsel-projectile
  :after projectile
  :straight t
  :config
  (setq projectile-completion-system 'ivy)

  (defhydra hydra-projectile-other-window (:color teal)
    "projectile-other-window"
    ("f"  projectile-find-file-other-window        "file")
    ("g"  projectile-find-file-dwim-other-window   "file dwim")
    ("d"  projectile-find-dir-other-window         "dir")
    ("b"  projectile-switch-to-buffer-other-window "buffer")
    ("q"  nil                                      "cancel" :color blue))

  (defhydra hydra-projectile (:color teal
                                     :hint nil)
    "
 PROJECTILE:

 Find File            Search/Tags          Buffers                Cache
   ------------------------------------------------------------------------------------------
     _f_: file            _a_: ag                _i_: Ibuffer           _c_: cache clear
     _/_: file dwim                              _b_: switch to buffer  _x_: remove known project
     _._: file curr dir   _o_: multi-occur       _K_: Kill all buffers  _X_: cleanup non-existing
     _r_: recent file                                               ^^^^_z_: cache current
     _d_: dir                                                           _s_: Save buffers

   "
    ("a"   counsel-projectile-ag)
    ("b"   counsel-projectile-switch-to-buffer)
    ("c"   projectile-invalidate-cache)
    ("d"   counsel-projectile-find-dir)
    ("f"   counsel-projectile-find-file)
    ("."   counsel-projectile-find-file-dwim)
    ("/"   projectile-find-file-in-directory)
    ("i"   projectile-ibuffer)
    ("K"   projectile-kill-buffers)
    ("o"   projectile-multi-occur)
    ("p"   projectile-switch-project)
    ("r"   projectile-recentf)
    ("x"   projectile-remove-known-project)
    ("X"   projectile-cleanup-known-projects)
    ("z"   projectile-cache-current-file)
    ("s"   projectile-save-project-buffers)
    ("q"   nil "cancel" :color blue)))

Git

(use-package magit
  :straight t
  :config
  ;; It's possible to deactivate modalka in modes like this, however
  ;; look like it's not the best idea. For now I'm going to take this
  ;; approach:
  ;; 1. By default I want to navigate any buffer.
  ;; 2. If I want to do any change (including staging on git), I need to
  ;;    switch to insert mode.
  ;;
  ;;(add-to-list 'modalka-excluded-modes 'magit-status-mode)
  ;;(add-to-list 'modalka-excluded-modes 'magit-section-mode-hook)
  )

Smartparens

(use-package smartparens
  :straight t
  :config
  (require 'smartparens-config)

  ;; do not pair stars
  (sp-local-pair 'org-mode "*" nil :actions :rem)
  (smartparens-global-mode))

**‌ Company

(use-package company
  :straight t
  :config
  (add-hook 'after-init-hook 'global-company-mode)
  (setq company-idle-delay 0
        company-minimum-prefix-length 2)
  (general-define-key
   :keymaps 'prog-mode-map
   "C-." 'company-complete))


(use-package company-quickhelp
  :after company
  :straight t
  :config
  (eval-after-load 'company
    '(define-key company-active-map (kbd "C-h") #'company-quickhelp-manual-begin)))

Yasnippet

(use-package yasnippet
  :straight t
  :init
  (yas-global-mode 1))

LSP

Download latest version of elixir-ls into /.emacs.d/elixir-ls/

(setq lsp-keymap-prefix "C-l")

(use-package lsp-mode
  :straight t
  :hook
  (scala-mode . lsp)
  (elixir-mode . lsp)
  (python-mode . lsp)
  (typescript-mode . lsp)
  (lsp-mode . lsp-lens-mode)
  :commands lsp
  :config
  (setq lsp-prefer-flymake nil))

(use-package lsp-metals
  :straight t
  :config (setq lsp-metals-treeview-show-when-views-received nil))

(use-package lsp-ui
  :straight t
  :commands lsp-ui-mode)

(use-package lsp-ivy
  :straight t
  :commands lsp-ivy-workspace-symbol)

(use-package lsp-treemacs
  :straight t
  :commands lsp-treemacs-errors-list)

(use-package company-lsp
  :straight t)

(use-package posframe
  :straight t)

(use-package dap-mode
  :straight t
  :hook
  (lsp-mode . dap-mode)
  (lsp-mode . dap-ui-mode))

Languages

Scala

;; Enable scala-mode for highlighting, indentation and motion commands
(use-package scala-mode
  :straight t
  :mode "^\w+\\.s\\(cala\\|bt\\)$"
  :interpreter
    ("scala" . scala-mode))

;; Enable sbt mode for executing sbt commands
(use-package sbt-mode
  :straight t
  :commands sbt-start sbt-command
  :config
  ;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31
  ;; allows using SPACE when in the minibuffer
  (substitute-key-definition
   'minibuffer-complete-word
   'self-insert-command
   minibuffer-local-completion-map)
   ;; sbt-supershell kills sbt-mode:  https://github.com/hvesalai/emacs-sbt-mode/issues/152
   (setq sbt:program-options '("-Dsbt.supershell=false"))
)

Markdown

(use-package markdown-mode
  :straight t)

Pip Requirements

(use-package pip-requirements
  :straight t
  :mode ("/requirements.txt$" . pip-requirements-mode))

Terraform

(use-package terraform-mode
  :straight t)

(use-package company-terraform
  :after company
  :straight t
  :config
  (require 'company-terraform)
  (company-terraform-init))

Jinja2

(use-package jinja2-mode
  :straight t
  :defer t)

Elixir

(use-package elixir-mode
  :straight t)
(use-package alchemist
  :straight t
  :hook (elixir-mode . alchemist-mode))

TypeScript

(use-package typescript-mode
  :straight t
  :config
  (require 'ansi-color)
  (defun colorize-compilation-buffer ()
    (ansi-color-apply-on-region compilation-filter-start (point-max)))
  (add-hook 'compilation-filter-hook 'colorize-compilation-buffer))

Tools

Dumb Jump

(use-package dumb-jump
  :straight t
  :config
  (setq dumb-jump-selector 'ivy)
  (defhydra dumb-jump-hydra (:color blue :columns 3)
    "Dumb Jump"
    ("j" dumb-jump-go "Go")
    ("o" dumb-jump-go-other-window "Other window")
    ("e" dumb-jump-go-prefer-external "Go external")
    ("x" dumb-jump-go-prefer-external-other-window "Go external other window")
    ("i" dumb-jump-go-prompt "Prompt")
    ("l" dumb-jump-quick-look "Quick look")
    ("b" dumb-jump-back "Back")))

Anzu

(use-package anzu
  :straight t
  :config
  (defhydra hydra-anzu (:color blue)
    "Anzu"
    ("q" anzu-query-replace "query replace")
    ("r" anzu-query-replace-regexp "regex replace")
    ("c" anzu-query-replace-at-cursor "cursor at thing replace")))

DirEnv

(use-package direnv
  :straight t
  :config
  (direnv-mode))

Rainbow Mode

(use-package rainbow-delimiters
  :straight t
  :config
  (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))

Expand Region

(use-package expand-region
  :straight t
  :config
  (defhydra hydra-expand ()
    "expand-region"
    ("c" er/contact-region "contract")
    ("e" er/expand-region "expand")
    ("w" er/mark-word "word")
    ("s" er/mark-symbol "symbol"))
  )

Treemacs

(use-package treemacs
  :straight t
  :general
  ("<f8>" 'treemacs)
  :config
  (treemacs-follow-mode t)
  (treemacs-filewatch-mode t)
  (treemacs-git-mode 'deferred))

;; quickly add projectile projects to treemacs workspace
(use-package treemacs-projectile
  :after projectile treemacs
  :straight t)

;; allows to use treemacs icons in dired mode
(use-package treemacs-icons-dired
  :after treemacs dired
  :straight t
  :config (treemacs-icons-dired-mode))

;; show the status of git tracked files using magit
(use-package treemacs-magit
  :after treemacs magit
  :straight t)

Docker

(use-package dockerfile-mode
  :straight t
  :config
  (add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode)))

Yasnippet

(use-package yasnippet
  :straight t
  :defer t
  :diminish yas-minor-mode
  :config
  (yas-reload-all)
  (add-hook 'prog-mode-hook #'yas-minor-mode))

(use-package yasnippet-snippets
  :after yasnippet
  :straight t
  :config (yasnippet-snippets-initialize))

(use-package ivy-yasnippet
  :after yasnippet
  :straight t)

Lint

(use-package flycheck
  :straight t
  :config
  (add-hook 'prog-mode-hook 'flycheck-mode))

(use-package flycheck-pos-tip
  :after flycheck
  :straight t
  :config
  (setq flycheck-pos-tip-timeout 10
        flycheck-display-errors-delay 0.5)
  (flycheck-pos-tip-mode +1))

Yaml

(use-package yaml-mode
  :straight t)

JSON

(use-package json-mode
  :straight t)

Python

(use-package python-black
  :straight t
  :demand t
  :after python)

Elixir

Resolve project directory discover (more info).

(defun elixir/find-mix-project (dir)
  "Try to locate a Elixir project root by 'mix.exs' above DIR."
  (let ((mix_root (locate-dominating-file dir "mix.exs")))
    (message "Found Elixir project root in '%s' starting from '%s'" mix_root dir)
    (if (stringp mix_root) `(transient . ,mix_root) nil)))

(add-hook 'project-find-functions 'elixir/find-mix-project nil nil)

Look

Theme

Modus Operandi! I’ve never used light themes like this, but I’m going to give it a try for a while. Interesting thing about this theme is WCAG standard which requires to have contrast ratio of >=7:1 between foreground and background colors.

(use-package modus-operandi-theme
  :straight t
  :config
  (load-theme 'modus-operandi t))

To be done [0%]

Tune Modus Operandi

This theme is also very customizable and the documntation provides a good details on it, I need to come back to it and tune it in future.

Modeline

(use-package smart-mode-line
  :straight t
  :config
  (sml/setup))

Font

(set-frame-font (font-spec :family "Fira Code" :size 15) nil t)

PDF

After starting off Emacs for the first time, it’s needed to run M-x pdf-tools-install.

(defhydra hydra-pdftools (:color blue :hint nil)
        "
                                                                      ╭───────────┐
       Move  History   Scale/Fit     Annotations  Search/Link    Do   │ PDF Tools │
   ╭──────────────────────────────────────────────────────────────────┴───────────╯
         ^^_g_^^      _B_    ^↧^    _+_    ^ ^     [_al_] list    [_s_] search    [_u_] revert buffer
         ^^^↑^^^      ^↑^    _H_    ^↑^  ↦ _W_ ↤   [_am_] markup  [_o_] outline   [_i_] info
         ^^_p_^^      ^ ^    ^↥^    _0_    ^ ^     [_at_] text    [_F_] link      [_d_] dark mode
         ^^^↑^^^      ^↓^  ╭─^─^─┐  ^↓^  ╭─^ ^─┐   [_ad_] delete  [_f_] search link
    _h_ ←pag_e_→ _l_  _N_  │ _P_ │  _-_    _b_     [_aa_] dired
         ^^^↓^^^      ^ ^  ╰─^─^─╯  ^ ^  ╰─^ ^─╯   [_y_]  yank
         ^^_n_^^      ^ ^  _r_eset slice box
         ^^^↓^^^
         ^^_G_^^
   --------------------------------------------------------------------------------
        "
        ("\\" hydra-master/body "back")
        ("<ESC>" nil "quit")
        ("al" pdf-annot-list-annotations)
        ("ad" pdf-annot-delete)
        ("aa" pdf-annot-attachment-dired)
        ("am" pdf-annot-add-markup-annotation)
        ("at" pdf-annot-add-text-annotation)
        ("y"  pdf-view-kill-ring-save)
        ("+" pdf-view-enlarge :color red)
        ("-" pdf-view-shrink :color red)
        ("0" pdf-view-scale-reset)
        ("H" pdf-view-fit-height-to-window)
        ("W" pdf-view-fit-width-to-window)
        ("P" pdf-view-fit-page-to-window)
        ("n" pdf-view-next-page-command :color red)
        ("p" pdf-view-previous-page-command :color red)
        ("d" pdf-view-dark-minor-mode)
        ("b" pdf-view-set-slice-from-bounding-box)
        ("r" pdf-view-reset-slice)
        ("g" pdf-view-first-page)
        ("G" pdf-view-last-page)
        ("e" pdf-view-goto-page)
        ("o" pdf-outline)
        ("s" pdf-occur)
        ("i" pdf-misc-display-metadata)
        ("u" pdf-view-revert-buffer)
        ("F" pdf-links-action-perfom)
        ("f" pdf-links-isearch-link)
        ("B" pdf-history-backward :color red)
        ("N" pdf-history-forward :color red)
        ("l" image-forward-hscroll :color red)
        ("h" image-backward-hscroll :color red))

(use-package pdf-tools
  :straight t
  :mode (("\\.pdf\\'" . pdf-view-mode))
  :init (load "pdf-tools-autoloads" nil t)
  :general
  (pdf-view-mode-map
   "H" 'hydra-pdftools/body
   "j" 'pdf-view-next-line-or-next-page
   "k" 'pdf-view-previous-line-or-previous-page)
  :config
  ;; https://github.com/politza/pdf-tools/issues/475
  (setenv "PKG_CONFIG_PATH" "/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig")

  (pdf-tools-install)
  ;; open pdfs scaled to fit page
  (setq-default pdf-view-display-size 'fit-page)
  ;; automatically annotate highlights
  (setq pdf-annot-activate-created-annotations t)
  (add-hook 'pdf-view-mode-hook
            (lambda ()
              (blink-cursor-mode -1)))
  (add-to-list 'modalka-excluded-modes 'pdf-view-mode))
(use-package org-noter
  :straight t
  :config
  (setq org-noter-auto-save-last-location t))

EPub

(use-package nov
  :straight t
  :config
  (defun nov-font-setup ()
    (face-remap-add-relative 'variable-pitch :family "Liberation Serif"
                             :height 1.0))
  (add-hook 'nov-mode-hook 'nov-font-setup))

TO-Do [33%]

Learn how speed commands for org-mode work

F1 v org-speed-commands-default RET

Is it possible to set non-programming mode fonts to something that supports Persian as well?

NOT USABLE: Unfortunately as you can test here, FiraGo doesn’t show پ as good as it should be!

FiraGo looks like a good candidate, and looks like setting the font as a hook for text-mode would be the solution. However the FiraGo font is separated per language, and may not support all characters at once.

Learn and use Expand Region

Extract useful things from lolsmacs

Undo-tree

Ensure SQLite3 is installed on the host

https://www.orgroam.com/manual/Post_002dInstallation-Tasks.html#Post_002dInstallation-Tasks

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published