From 71294e7c24f455ac819796311b2763cdb0744f43 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Fri, 2 Sep 2022 11:01:03 -0400 Subject: [PATCH] update --- emacs.d/init.el | 8 +-- emacs.d/layers/xit/init.el | 7 ++ emacs.d/vendor/xit-mode.el | 133 +++++++++++++++++++++++++++++++++++++ gitignore_global | 1 + 4 files changed, 145 insertions(+), 4 deletions(-) create mode 100644 emacs.d/layers/xit/init.el create mode 100644 emacs.d/vendor/xit-mode.el diff --git a/emacs.d/init.el b/emacs.d/init.el index 60c3037..9fdd2aa 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -49,8 +49,8 @@ ;; Configure package (require 'package) - (add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/") t) + (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) + (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) (package-initialize) (when (not package-archive-contents) @@ -145,7 +145,7 @@ (use-package doom-modeline :ensure t :defer t - :hook (after-init . doom-modeline-init))) + :hook (after-init . doom-modeline-mode))) ;; -- Global packages -- @@ -153,7 +153,6 @@ ;; Configure osx-clipboard ;; https://github.com/joddie/osx-clipboard-mode (use-package osx-clipboard - :defer t :diminish osx-clipboard-mode :config (osx-clipboard-mode t)) @@ -302,6 +301,7 @@ (forge--format repo "https://%h/%o/%n/blob/%r/%f%L" `((?r . ,rev) (?f . ,file) (?L . ,highlight)))))) + (use-package lsp-mode :defer t :hook (( diff --git a/emacs.d/layers/xit/init.el b/emacs.d/layers/xit/init.el new file mode 100644 index 0000000..1ad7943 --- /dev/null +++ b/emacs.d/layers/xit/init.el @@ -0,0 +1,7 @@ + ;; Enable xit-mode + ;; https://github.com/ryanolsonx/xit-mode/ + ;; https://xit.jotaen.net/ + (load "~/.emacs.d/vendor/xit-mode.el") + (add-hook 'xit-mode-hook + '(lambda () + (setq tab-width 4))) diff --git a/emacs.d/vendor/xit-mode.el b/emacs.d/vendor/xit-mode.el new file mode 100644 index 0000000..ad5834f --- /dev/null +++ b/emacs.d/vendor/xit-mode.el @@ -0,0 +1,133 @@ +;;; xit-mode.el --- A [x]it! major mode for Emacs. -*- lexical-binding: t; -*- + +;; See: https://xit.jotaen.net/ + +;; Copyright (C) 2022 Ryan Olson + +;; Authors: Ryan Olson +;; Keywords: xit todo + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(defvar xit-mode-hook nil) + +;; (defvar xit-mode-map +;; (let ((map (make-sparse-keymap))) +;; (define-key map "\C-j" 'newline-and-indent) +;; map) +;; "Keymap for `xit-mode'.") + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.xit\\'" . xit-mode)) + +;; descriptions disabled until tags in descriptions are resolved. +;; right now tags don't display if a description has a face. +(defvar xit-mode-font-lock-keywords + (list + '("^[a-zA-Z]+.*$" 0 'xit-group-title) + '("^\\(\\[ \\]\\) [\\!|\\.]*\\(.*\\)" + (1 'xit-open-checkbox)) + ;(2 'xit-open-description)) + '("^\\(\\[x\\]\\) \\(.*\\)" + (1 'xit-checked-checkbox)) + ;(2 'xit-checked-description)) + '("^\\(\\[@\\]\\) [\\!|\\.]*\\(.*\\)" + (1 'xit-ongoing-checkbox)) + ;(2 'xit-ongoing-description)) + '("^\\(\\[~\\]\\) \\(.*\\)" + (1 'xit-obsolete-checkbox) + (2 'xit-obsolete-description)) + '("^\\[[x|@| |~]\\] \\([\\!|\\.]+\\)[^\\!|\\.]" 1 'xit-priority) + '("\s#[a-zA-Z0-9\\-_]+\\(=[a-zA-Z0-9\\-+]+\\)?\\w" 0 'xit-tag) + '("\s->\s\\([1-2][0-1][0-9][0-9]-[0-1][0-9]\\(-[0-3][0-9]\\)?\\)" 1 'xit-due-date)) + "Highlighting specification for `xit-mode'.") + +(defface xit-group-title + '((t :inherit (font-lock-string-face underline))) + "Face used for checkboxes group title" + :group 'xit-faces) + +(defface xit-open-checkbox + '((t :inherit font-lock-type-face)) + "Face used for open checkbox." + :group 'xit-faces) + +(defface xit-open-description + '((t :inherit default)) + "Face used for open checkbox description." + :group 'xit-faces) + +(defface xit-checked-checkbox + '((t :inherit success)) + "Face used for checked checkbox." + :group 'xit-faces) + +(defface xit-checked-description + '((t :foreground "#838383")) + "Face used for checked checkbox description." + :group 'xit-faces) + +(defface xit-ongoing-checkbox + '((t :inherit font-lock-keyword-face)) + "Face used for ongoing checkbox." + :group 'xit-faces) + +(defface xit-ongoing-description + '((t :inherit default)) + "Face used for ongoing checkbox description." + :group 'xit-faces) + +(defface xit-obsolete-checkbox + '((t :foreground "#838383")) + "Face used for obsolete checkbox." + :group 'xit-faces) + +(defface xit-obsolete-description + '((t :foreground "#838383")) + "Face used for obsolete checkbox description." + :group 'xit-faces) + +(defface xit-priority + '((t :inherit error)) + "Face used for priority markers ! or ." + :group 'xit-faces) + +(defface xit-tag + '((t :inherit font-lock-constant-face)) + "Face used for tags." + :group 'xit-faces) + +(defface xit-due-date + '((t :inherit font-lock-variable-name-face)) + "Face used for due dates." + :group 'xit-faces) + +(defun xit-mode () + "Major mode for [x]it!" + (interactive) + (kill-all-local-variables) + ;;(use-local-map xit-mode-map) + (setq font-lock-defaults '(xit-mode-font-lock-keywords)) + (setq major-mode 'xit-mode) + (setq mode-name "[x]it!") + (run-hooks 'xit-mode-hook)) + +(provide 'xit-mode) +;;; xit-mode.el ends here diff --git a/gitignore_global b/gitignore_global index b626a5f..851fdda 100644 --- a/gitignore_global +++ b/gitignore_global @@ -7,3 +7,4 @@ *.projectile *.coverage htmlcov +*.ccls-cache