dotfiles/slackware/home/doom/.doom.d/config.org
2023-02-18 17:22:58 -05:00

5.7 KiB

Ian's Emacs Config

Appearance

Misc

(setq fancy-splash-image
      (concat doom-private-dir "sink.png"))  ;; the best emacs logo
(load-theme 'doom-oceanic-next t)
(setq lsp-lens-enable nil)                   ;; gets rid of the little '0 references' note from lsp

Font

(setq
 doom-font (font-spec
            :family "Fira Mono for Powerline"
            :size=28
            :weight=medium)
 ;; default-font-size 28
 doom-font-increment 1
 ;; TODO doom-unicode-font, check out fira-code-symbol?
 )

Window Management and Navigation

TODO General Concepts and Rationale

Tab Behavior

  (setq tab-bar-show nil)
  (doom-modeline-mode -1)
  (define-key evil-normal-state-map (kbd "s-t") 'tab-next)
  (define-key evil-normal-state-map (kbd "s-z") 'toggle-maximize-buffer)

Window Movement

  (defun split-and-follow-horizontally ()
    (interactive)
    (split-window-below)
    (balance-windows)
    (other-window 1))

  (defun split-and-follow-vertically ()
    (interactive)
    (split-window-right)
    (balance-windows)
    (other-window 1))
  (global-set-key (kbd "s-c") 'delete-window)
  (global-set-key (kbd "s-h") 'windmove-left)
  (global-set-key (kbd "s-j") 'windmove-down)
  (global-set-key (kbd "s-k") 'windmove-up)
  (global-set-key (kbd "s-l") 'windmove-right)
  (define-key evil-normal-state-map (kbd "s-d") 'kill-this-buffer)
  (define-key evil-normal-state-map (kbd "s-n") 'projectile-next-project-buffer)
  (define-key evil-normal-state-map (kbd "s-p") 'projectile-previous-project-buffer)
  (define-key evil-normal-state-map (kbd "s-J") 'split-and-follow-horizontally)
  (define-key evil-normal-state-map (kbd "s-L") 'split-and-follow-vertically)
  (define-key evil-normal-state-map (kbd "s-b") 'buffer-menu)
  (define-key evil-normal-state-map (kbd "s-x") 'execute-extended-command)
  (global-set-key (kbd "s-SPC") 'tab-next)
  ;; disable mac default bindings
  (when IS-MAC
      (setq mac-pass-command-to-system nil))

TODO Toggle Maximize Buffer

This was meant to replace the functionality of ctrl b z in tmux. It's not really good enough though, I'd like it to be independent of workspaces and tabs, for example, so that I can zoom one window, move to another context and zoom the others and be able to undo the zoom on the buffer I'm on specifically

(defun toggle-maximize-buffer ()
  "Maximize buffer"
  (interactive)
  (if (= 1 (length (window-list)))
      (jump-to-register '_)
    (progn
      (window-configuration-to-register '_)
      (delete-other-windows))))

IRC

(setq circe-network-options
      '(("Libera"
         :host "dump.town"
         :port (6667 . 6697)
         :tls t
         :user "bl0rt/libera"
         :pass (password-store-get "self/irc/znc"))))

Org Mode

(setq deft-directory "~/notes/deft"
      deft-extensions '("org" "txt")
      deft-recursive t)

(setq org-roam-directory "~/notes/roam")

(map! :leader
      (:prefix ("e" . "export")
       :desc "Export Org to HTML"
       "e" #'org-html-export-to-html))

Ejira

(use-package! ejira
  :init
  (setq jiralib2-url              "https://everblue.atlassian.net"
        jiralib2-auth             'basic
        jiralib2-user-login-name  "ian@fs.tech"
        jiralib2-token            (password-store-get "work/api-keys/jira")

        ;; NOTE, this directory needs to be in `org-agenda-files'`
        ejira-org-directory       "~/notes/jira"
        ejira-projects            '("FP" "RWA")

        ejira-priorities-alist    '(("Highest" . ?A)
                                    ("High"    . ?B)
                                    ("Medium"  . ?C)
                                    ("Low"     . ?D)
                                    ("Lowest"  . ?E))
        ejira-todo-states-alist   '(("To Do"       . 1)
                                    ("Development In Progress" . 2)
                                    ("QA"        . 3)))
  :config
  ;; Tries to auto-set custom fields by looking into /editmeta
  ;; of an issue and an epic.
  (add-hook 'jiralib2-post-login-hook #'ejira-guess-epic-sprint-fields)

  ;; They can also be set manually if autoconfigure is not used.
  ;; (setq ejira-sprint-field       'customfield_10001
  ;;       ejira-epic-field         'customfield_10002
  ;;       ejira-epic-summary-field 'customfield_10004)

  (require 'ejira-agenda)

  ;; Make the issues visisble in your agenda by adding `ejira-org-directory'
  ;; into your `org-agenda-files'.
  (add-to-list 'org-agenda-files ejira-org-directory)

  ;; Add an agenda view to browse the issues that
  (org-add-agenda-custom-command
   '("j" "My JIRA issues"
     ((ejira-jql "resolution = unresolved and assignee = currentUser()"
                 ((org-agenda-overriding-header "Assigned to me")))))))

One-Off Behavior Tweaks

Projectile search path

(setq projectile-project-search-path '("~/code/"))

Speed up flycheck for TS/JS file opening

source

(with-eval-after-load 'flycheck
  (advice-add 'flycheck-eslint-config-exists-p :override (lambda() t)))

Company mode manual activation

Keep auto-complete from constantly suggesting things.

  (setq company-minimum-prefix-length 100)
  (map! :i "S-o" #'company-complete)

Todo

Bind 'Kill buffer and window' to spc b w

Make c-spc change tabs, make sure tabs are invisible

Word wrap on org mode

Highlight matching paren