Sources/Orgstar/Preferences.swift

5ac7dd8915d13640badfe09136d90e6b673166a3
orgstar/Sources/Orgstar/Preferences.swift

20 lines · 835 bytes

 1import Foundation
 2import OrgCore
 3
 4/// Org preferences, stored in user defaults by the Settings window.
 5enum Preferences {
 6    static let defaultTodoKeywords = "TODO PROJ LOOP STRT WAIT HOLD IDEA | DONE KILL"
 7
 8    /// TODO keywords for files without `#+TODO`, read at launch.
 9    static var orgSettings: OrgSettings {
10        let line = UserDefaults.standard.string(forKey: "todoKeywords") ?? defaultTodoKeywords
11        return OrgSettings.default.withTodoKeywords(line) ?? .default
12    }
13
14    static func options(tagsColumn: Int, headingAfterSubtree: Bool, splitLine: Bool, alphabeticalLists: Bool) -> EditingOptions {
15        EditingOptions(
16            tagsColumn: tagsColumn, insertHeadingRespectContent: headingAfterSubtree,
17            metaReturnMaySplitLine: splitLine, listAllowAlphabetical: alphabeticalLists
18        )
19    }
20}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form