From 12febc1bc4223fb8f85baeba6d4e60f86a454f85 Mon Sep 17 00:00:00 2001 From: marctalcott Date: Wed, 17 Jul 2024 21:28:13 -0400 Subject: [PATCH] updating obsidian --- lua/plugins/obsidian.lua | 71 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/lua/plugins/obsidian.lua b/lua/plugins/obsidian.lua index 27f1f1f6..86c3eeb9 100644 --- a/lua/plugins/obsidian.lua +++ b/lua/plugins/obsidian.lua @@ -32,7 +32,7 @@ return { path = '~/Library/Mobile Documents/iCloud~md~obsidian/Documents/ArchivedTalcottUniverse', }, }, - notes_subdir = 'notes', + notes_subdir = 'inbox', log_level = vim.log.levels.INFO, daily_notes = { -- Optional, if you keep daily notes in a separate directory. @@ -44,7 +44,7 @@ return { -- Optional, default tags to add to each new daily note created. default_tags = { 'daily-notes' }, -- Optional, if you want to automatically insert a template from your template directory like 'daily.md' - template = nil, + template = 'daily-note-template.md', }, -- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp. completion = { @@ -141,7 +141,7 @@ return { -- Optional, boolean or a function that takes a filename and returns a boolean. -- `true` indicates that you don't want obsidian.nvim to manage frontmatter. - disable_frontmatter = false, + disable_frontmatter = true, -- Optional, alternatively you can customize the frontmatter data. ---@return table @@ -307,5 +307,70 @@ return { end, }, } + + -------------- + -- obsidian -- + -------------- + -- + -- >>> oo # from shell, navigate to vault (optional) + -- + -- # NEW NOTE + -- >>> on "Note Name" # call my "obsidian new note" shell script (~/bin/on) + -- >>> + -- >>> ))) on # inside vim now, format note as template + -- >>> ))) # add tag, e.g. fact / blog / video / etc.. + -- >>> ))) # add hubs, e.g. [[python]], [[machine-learning]], etc... + -- >>> ))) of # format title + -- + -- # END OF DAY/WEEK REVIEW + -- >>> or # review notes in inbox + -- >>> + -- >>> ))) ok # inside vim now, move to zettelkasten + -- >>> ))) odd # or delete + -- >>> + -- >>> og # organize saved notes from zettelkasten into notes/[tag] folders + -- >>> ou # sync local with Notion + -- + -- navigate to vault + vim.keymap.set('n', 'od', ':cd /Users/marctalcott/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/MarcsDailyNotes') + -- + -- convert note to template and remove leading white space + vim.keymap.set('n', 'on', ':ObsidianTemplate note :lua vim.cmd([[1,/^\\S/s/^\\n\\{1,}//]])', { desc = 'Obsidian note template' }) + vim.keymap.set('n', 'o1', ':ObsidianTemplate 1-1-template :lua vim.cmd([[1,/^\\S/s/^\\n\\{1,}//]])', { desc = 'Obsidian 1 on 1 template' }) + vim.keymap.set( + 'n', + 'ol', + ':ObsidianTemplate log-template :lua vim.cmd([[1,/^\\S/s/^\\n\\{1,}//]])', + { desc = 'Obsidian Log entry template' } + ) + -- strip date from note title and replace dashes with spaces + -- must have cursor on title + vim.keymap.set('n', 'of', ':s/\\(# \\)[^_]*_/\\1/ | s/-/ /g') + -- + -- search for files in full vault + vim.keymap.set( + 'n', + 'os', + ':Telescope find_files search_dirs={"/Users/marctalcott/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/MarcsDailyNotes/notes"}' + ) + vim.keymap.set( + 'n', + 'oz', + ':Telescope live_grep search_dirs={"/Users/marctalcott/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/MarcsDailyNotes/notes"}' + ) + -- + -- search for files in notes (ignore zettelkasten) + -- vim.keymap.set("n", "ois", ":Telescope find_files search_dirs={\"/Users/alex/library/Mobile\\ Documents/iCloud~md~obsidian/Documents/ZazenCodes/notes\"}") + -- vim.keymap.set("n", "oiz", ":Telescope live_grep search_dirs={\"/Users/alex/library/Mobile\\ Documents/iCloud~md~obsidian/Documents/ZazenCodes/notes\"}") + -- + -- for review workflow + -- move file in current buffer to zettelkasten folder + vim.keymap.set( + 'n', + 'ok', + ":!mv '%:p' /Users/marctalcott/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/MarcsDailyNotes/zettelkasten:bd" + ) + -- delete file in current buffer + vim.keymap.set('n', 'odd', ":!rm '%:p':bd") end, }