From 88ba9924cd0ba716d6f5406fb89ecd2b6b9285ca Mon Sep 17 00:00:00 2001 From: Ava Gaiety W Date: Tue, 12 Sep 2023 19:55:31 -0500 Subject: [PATCH] Obsidian tags, vim --- .obsidian/workspace.json | 6 +- content/.obsidian/app.json | 4 + content/.obsidian/appearance.json | 4 + content/.obsidian/community-plugins.json | 3 + content/.obsidian/core-plugins-migration.json | 30 +++ content/.obsidian/core-plugins.json | 21 ++ content/.obsidian/hotkeys.json | 1 + .../obsidian-relative-line-numbers/main.js | 176 +++++++++++++++++ .../manifest.json | 10 + content/.obsidian/types.json | 8 + content/.obsidian/workspace.json | 180 ++++++++++++++++++ 11 files changed, 440 insertions(+), 3 deletions(-) create mode 100644 content/.obsidian/app.json create mode 100644 content/.obsidian/appearance.json create mode 100644 content/.obsidian/community-plugins.json create mode 100644 content/.obsidian/core-plugins-migration.json create mode 100644 content/.obsidian/core-plugins.json create mode 100644 content/.obsidian/hotkeys.json create mode 100644 content/.obsidian/plugins/obsidian-relative-line-numbers/main.js create mode 100644 content/.obsidian/plugins/obsidian-relative-line-numbers/manifest.json create mode 100644 content/.obsidian/types.json create mode 100644 content/.obsidian/workspace.json diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 5ea4d50..78c3ef8 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -4,11 +4,11 @@ "type": "split", "children": [ { - "id": "be6dfdd7fd6b4bd2", + "id": "a470dcfe9214cd52", "type": "tabs", "children": [ { - "id": "6eef4bfce0aa6755", + "id": "73b3910cd9e889d3", "type": "leaf", "state": { "type": "empty", @@ -107,7 +107,7 @@ "markdown-importer:Open format converter": false } }, - "active": "6eef4bfce0aa6755", + "active": "73b3910cd9e889d3", "lastOpenFiles": [ "content/posts/batch-of-kobolds.md", "content/posts/silhouette-spray-paintings.md", diff --git a/content/.obsidian/app.json b/content/.obsidian/app.json new file mode 100644 index 0000000..f6f5273 --- /dev/null +++ b/content/.obsidian/app.json @@ -0,0 +1,4 @@ +{ + "showLineNumber": true, + "vimMode": true +} \ No newline at end of file diff --git a/content/.obsidian/appearance.json b/content/.obsidian/appearance.json new file mode 100644 index 0000000..da22729 --- /dev/null +++ b/content/.obsidian/appearance.json @@ -0,0 +1,4 @@ +{ + "accentColor": "", + "baseFontSize": 19 +} \ No newline at end of file diff --git a/content/.obsidian/community-plugins.json b/content/.obsidian/community-plugins.json new file mode 100644 index 0000000..82fada4 --- /dev/null +++ b/content/.obsidian/community-plugins.json @@ -0,0 +1,3 @@ +[ + "obsidian-relative-line-numbers" +] \ No newline at end of file diff --git a/content/.obsidian/core-plugins-migration.json b/content/.obsidian/core-plugins-migration.json new file mode 100644 index 0000000..dab71c6 --- /dev/null +++ b/content/.obsidian/core-plugins-migration.json @@ -0,0 +1,30 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": false +} \ No newline at end of file diff --git a/content/.obsidian/core-plugins.json b/content/.obsidian/core-plugins.json new file mode 100644 index 0000000..56b44a5 --- /dev/null +++ b/content/.obsidian/core-plugins.json @@ -0,0 +1,21 @@ +[ + "file-explorer", + "global-search", + "switcher", + "graph", + "backlink", + "canvas", + "outgoing-link", + "tag-pane", + "properties", + "page-preview", + "daily-notes", + "templates", + "note-composer", + "command-palette", + "editor-status", + "bookmarks", + "outline", + "word-count", + "file-recovery" +] \ No newline at end of file diff --git a/content/.obsidian/hotkeys.json b/content/.obsidian/hotkeys.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/content/.obsidian/hotkeys.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/content/.obsidian/plugins/obsidian-relative-line-numbers/main.js b/content/.obsidian/plugins/obsidian-relative-line-numbers/main.js new file mode 100644 index 0000000..2053cba --- /dev/null +++ b/content/.obsidian/plugins/obsidian-relative-line-numbers/main.js @@ -0,0 +1,176 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module2) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// main.ts +__export(exports, { + default: () => RelativeLineNumbers +}); +var import_obsidian = __toModule(require("obsidian")); + +// node_modules/codemirror-line-numbers-relative/dist/index.js +var import_view = __toModule(require("@codemirror/view")); +var import_state = __toModule(require("@codemirror/state")); +var import_gutter = __toModule(require("@codemirror/gutter")); +var relativeLineNumberGutter = /* @__PURE__ */ new import_state.Compartment(); +var Marker = class extends import_gutter.GutterMarker { + constructor(text) { + super(); + this.text = text; + } + toDOM() { + return document.createTextNode(this.text); + } +}; +var absoluteLineNumberGutter = /* @__PURE__ */ (0, import_gutter.gutter)({ + lineMarker: (view, line) => { + const lineNo = view.state.doc.lineAt(line.from).number; + const absoluteLineNo = new Marker(lineNo.toString()); + const cursorLine = view.state.doc.lineAt(view.state.selection.asSingle().ranges[0].to).number; + if (lineNo === cursorLine) { + return absoluteLineNo; + } + return null; + }, + initialSpacer: () => { + const spacer = new Marker("0"); + return spacer; + } +}); +function relativeLineNumbers(lineNo, state) { + if (lineNo > state.doc.lines) { + return " "; + } + const cursorLine = state.doc.lineAt(state.selection.asSingle().ranges[0].to).number; + if (lineNo === cursorLine) { + return " "; + } else { + return Math.abs(cursorLine - lineNo).toString(); + } +} +var showLineNumbers = /* @__PURE__ */ relativeLineNumberGutter.of(/* @__PURE__ */ (0, import_gutter.lineNumbers)({ formatNumber: relativeLineNumbers })); +var lineNumbersUpdateListener = /* @__PURE__ */ import_view.EditorView.updateListener.of((viewUpdate) => { + if (viewUpdate.selectionSet) { + viewUpdate.view.dispatch({ + effects: relativeLineNumberGutter.reconfigure((0, import_gutter.lineNumbers)({ formatNumber: relativeLineNumbers })) + }); + } +}); +function lineNumbersRelative() { + return [absoluteLineNumberGutter, showLineNumbers, lineNumbersUpdateListener]; +} + +// main.ts +var RelativeLineNumbers = class extends import_obsidian.Plugin { + isLegacy() { + var _a; + return (_a = this.app.vault.config) == null ? void 0 : _a.legacyEditor; + } + onload() { + return __async(this, null, function* () { + const showLineNumber = this.app.vault.getConfig("showLineNumber"); + if (showLineNumber) { + this.enable(); + } + this.setupConfigChangeListener(); + }); + } + onunload() { + this.disable(); + } + enable() { + this.enabled = true; + if (this.isLegacy()) { + this.legacyEnable(); + } else { + this.registerEditorExtension(lineNumbersRelative()); + } + } + disable() { + this.enabled = false; + if (this.isLegacy) { + this.legacyDisable(); + } + } + legacyEnable() { + this.registerCodeMirror((cm) => { + cm.on("cursorActivity", this.legacyRelativeLineNumbers); + }); + } + legacyDisable() { + this.app.workspace.iterateCodeMirrors((cm) => { + cm.off("cursorActivity", this.legacyRelativeLineNumbers); + cm.setOption("lineNumberFormatter", CodeMirror.defaults["lineNumberFormatter"]); + }); + } + setupConfigChangeListener() { + const configChangedEvent = this.app.vault.on("config-changed", () => { + const showLineNumber = this.app.vault.getConfig("showLineNumber"); + if (showLineNumber && !this.enabled) { + this.enable(); + } else if (!showLineNumber && this.enabled) { + this.disable(); + } + }); + configChangedEvent.ctx = this; + this.registerEvent(configChangedEvent); + } + legacyRelativeLineNumbers(cm) { + const current = cm.getCursor().line + 1; + if (cm.state.curLineNum === current) { + return; + } + cm.state.curLineNum = current; + cm.setOption("lineNumberFormatter", (line) => { + if (line === current) { + return String(current); + } + return String(Math.abs(current - line)); + }); + } +}; diff --git a/content/.obsidian/plugins/obsidian-relative-line-numbers/manifest.json b/content/.obsidian/plugins/obsidian-relative-line-numbers/manifest.json new file mode 100644 index 0000000..4632a86 --- /dev/null +++ b/content/.obsidian/plugins/obsidian-relative-line-numbers/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "obsidian-relative-line-numbers", + "name": "Relative Line Numbers", + "version": "2.0.1", + "minAppVersion": "0.13.14", + "description": "Enables relative line numbers in editor mode", + "author": "Nadav Spiegelman", + "authorUrl": "https://nadav.is", + "isDesktopOnly": true +} \ No newline at end of file diff --git a/content/.obsidian/types.json b/content/.obsidian/types.json new file mode 100644 index 0000000..f7e6513 --- /dev/null +++ b/content/.obsidian/types.json @@ -0,0 +1,8 @@ +{ + "types": { + "aliases": "aliases", + "cssclasses": "multitext", + "tags": "tags", + "date": "date" + } +} \ No newline at end of file diff --git a/content/.obsidian/workspace.json b/content/.obsidian/workspace.json new file mode 100644 index 0000000..dc6c6e9 --- /dev/null +++ b/content/.obsidian/workspace.json @@ -0,0 +1,180 @@ +{ + "main": { + "id": "49205cc3f8b50d4a", + "type": "split", + "children": [ + { + "id": "e4a83a36da533a38", + "type": "tabs", + "children": [ + { + "id": "322acde0beb2114a", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "posts/arizona_school_finance.md", + "mode": "source", + "source": false + } + } + } + ] + } + ], + "direction": "vertical" + }, + "left": { + "id": "c292250ca19b9d5d", + "type": "split", + "children": [ + { + "id": "961e01ef4683345a", + "type": "tabs", + "children": [ + { + "id": "df7798dc1c5b6006", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical" + } + } + }, + { + "id": "8ca86ec79a0654db", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + } + } + }, + { + "id": "f51520f031fb9cb0", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {} + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "84b4c7c45382c2e6", + "type": "split", + "children": [ + { + "id": "347649453b61dff7", + "type": "tabs", + "children": [ + { + "id": "42162f3dca32df2b", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "posts/arizona_school_finance.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + } + }, + { + "id": "29249f1e336856fc", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "posts/arizona_school_finance.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + } + } + }, + { + "id": "eb7080a18ac7d0c3", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true + } + } + }, + { + "id": "6a35de7fe86aba5e", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "posts/arizona_school_finance.md" + } + } + }, + { + "id": "1c0cf52d2725e231", + "type": "leaf", + "state": { + "type": "all-properties", + "state": { + "sortOrder": "frequency" + } + } + }, + { + "id": "ba6012bd24619e06", + "type": "leaf", + "state": { + "type": "file-properties", + "state": { + "file": "posts/arizona_school_finance.md" + } + } + } + ], + "currentTab": 5 + } + ], + "direction": "horizontal", + "width": 300 + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Open quick switcher": false, + "graph:Open graph view": false, + "canvas:Create new canvas": false, + "daily-notes:Open today's daily note": false, + "templates:Insert template": false, + "command-palette:Open command palette": false + } + }, + "active": "322acde0beb2114a", + "lastOpenFiles": [ + "images/arizona-public-portal.svg", + "posts/allovue.md", + "posts/arizona_school_finance.md", + "posts/a_modern_terminal_workflow_5.md", + "images/arizona_allovue.webp", + "posts/coming-out-again-nb.md", + "posts/code2college-volunteering.md", + "posts/blm.md" + ] +} \ No newline at end of file