Browse Source

update

master
Brett Langdon 3 years ago
parent
commit
71294e7c24
No known key found for this signature in database GPG Key ID: C2BEA329670CD664
4 changed files with 145 additions and 4 deletions
  1. +4
    -4
      emacs.d/init.el
  2. +7
    -0
      emacs.d/layers/xit/init.el
  3. +133
    -0
      emacs.d/vendor/xit-mode.el
  4. +1
    -0
      gitignore_global

+ 4
- 4
emacs.d/init.el View File

@ -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 ((


+ 7
- 0
emacs.d/layers/xit/init.el View File

@ -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)))

+ 133
- 0
emacs.d/vendor/xit-mode.el View File

@ -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 <ryolson@me.com>
;; 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 <http://www.gnu.org/licenses/>.
;;; 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

+ 1
- 0
gitignore_global View File

@ -7,3 +7,4 @@
*.projectile
*.coverage
htmlcov
*.ccls-cache

Loading…
Cancel
Save