Skip to content

kaiwei/beorg-init.org

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

beorg Scheme Expressions

;; -*- coding: utf-8 -*-

This is the initialization file for `beorg’.

https://beorgapp.com/manual/scripting/ https://beorg.app/learning/

UI

(defvar ui-swap-item-swipe-direction #t
  "Whether the swipe direction on items in the agenda or TODO tab should be
swapped. If #t then swiping left-to-right will show state change options rather
than editing the item in the outliner.")

Item Editor Quick Action

(define (my/schedule-for-today)
  (set-current-item-scheduled! (current-date)))

(define (my/schedule-todo-for-today)
  (begin (set-current-item-scheduled! (current-date))
         (set-current-item-state! "TODO")))

(define (add-location-to-current-item)
  (location-get-lat-lon (lambda (lat lon)
                          (set-current-item-property! "location"
                                                      (string-append lat "," lon)))))

(define (make-current-item-top-priority-today)
  (begin (set-current-item-scheduled! (current-date))
         (set-current-item-priority! "A")))

(define (schedule-current-item-for-tomorrow)
  (set-current-item-scheduled! (date-adjust (current-date) 1 'days)))

(define (my/schedule-todo-for-tomorrow)
  (begin (set-current-item-scheduled! (date-adjust (current-date) 1 'days))
         (set-current-item-state! "TODO")))

(define (remove-all-dates-from-current-item)
  (begin (delete-current-item-scheduled!)
         (delete-current-item-deadline!)
         (delete-current-item-active-date!)))

(defvar item-editor-menu
  '(("Assign current location" (add-location-to-current-item))
    ("Make top priority today" (make-current-item-top-priority-today))
    ("Schedule TODO for today" (my/schedule-todo-for-today))
    ("Schedule for today" (my/schedule-for-today))
    ("Schedule TODO for tomorrow" (my/schedule-todo-for-tomorrow))
    ("Schedule for tomorrow" (schedule-current-item-for-tomorrow))
    ("Remove all dates" (remove-all-dates-from-current-item)))
  "The items defined here can be run directly from the item editor screen to make quick adjustments.")

使中文单字搜索生效

(set! filter-min-chars 2)

Add New Line between Headlines

https://appsonthemove.freshdesk.com/support/discussions/topics/14000015618

(set! beorg-add-newline-between-headlines #t)

Disable Deletion Operation

(set! file-disable-delete #t
      "If set to #t then the option to delete files won't be available in beorg.")

Show Built-in TODO Filter

(set! filter-include-default #t
      "Whether or not the built-in TODO filters should be shown")

States

(set! org-todo-action-keywords '("TODO" "DONE" "IN-PROGRESS" "WAIT" "CANCELED"))

Priorities

(set! org-priorities '("A" "B" "C"))

Excluding Tasks

https://beorg.app/learning/excluding-tasks-from-specific-files-for-the-agenda-and-todo-lists/

(set! agenda-exclude-files
      '("archives.org"
        "init.org"))

(set! todo-exclude-files
      agenda-exclude-files)

Custom TODO filters

Top Priority TODO

(filter-add "❗️Top Priority TODO"
            (lambda (item)
              (and
               (string=? (item-priority item) "A")
               (string=? (item-state item) "TODO")
               (not (member "ARCHIVE" (item-tags item)))
               )))

IN-PROGRESS, TODO and WAIT

(filter-add "🪬 IN-PROGRESS, TODO and WAIT"
            (lambda (item)
              (and (or
                    (string=? (item-state item) "IN-PROGRESS")
                    (string=? (item-state item) "TODO")
                    (string=? (item-state item) "WAIT")
                    )
                   (not (member "ARCHIVE" (item-tags item)))
                   )))

without Tag - ARCHIVE

(filter-add "🔨 TODO w/o ARCHIVE"
            (lambda (item)
              (and (string=? (item-state item) "TODO") (not (member "ARCHIVE" (item-tags item))))
              ))

inbox.org TODO

(filter-add "📥 inbox.org TODO"
            (lambda (item)
              (and
               (string=? (item-file item) "inbox.org")
               (string=? (item-state item) "TODO")
               )))

Templates

https://appsonthemove.freshdesk.com/support/discussions/topics/14000015064

(set! item-templates
      '(
        ;;; Quick TODO - schedule for today, don't prompt for notes
        ("📎 QTODO"
         "s TODO f inbox.org sch 0 h Shortterm n \"Captured: [%now%]\"")
        ;;; Personal TODO - schedule for today but prompt for notes immediately
        ("📝 Personal TODO"
         "s TODO f inbox.org sch 0 h Personal n \"Captured: [%now%]\n\n\" e")
        ))

Editor Toolbar Items

(defvar editor-toolbar-items '(
                               ("icon-time" (insert (date->string (current-date) "<~Y-~m-~d ~a ~H:~M>")))
                               ("icon-left" (backward-char))
                               ("icon-right" (forward-char))
                               ("icon-list" (insert "+ "))
                               ("icon-todolist" (insert "+ [ ] "))
                               ("icon-change" (show-transform-commands))
                               ("icon-tools" (show-tools-commands))
                               ("icon-settings" (insert-code-snippet)))
  "A list of buttons to show above the keyboard when editing notes. The list is a list of lists stating the button text and the code to run. For example '((\"<\" (backward-char)) (\">\" (forward-char))) defines a toolbar with the buttons < and > which respectively execute the functions backward-char and forward-char.")

Subfolder Support

https://appsonthemove.freshdesk.com/support/discussions/topics/14000016681

(set! sync-subfolders #t)

Releases

No releases published

Packages

No packages published