diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-24 10:29:16 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-06-24 17:02:51 +0200 |
| commit | bb02d0dc5f80c76e81da91855d49264d5c854b53 (patch) | |
| tree | 360f11ed5aab13a9087fc3bdb67e4060ed000bb9 /plugin/50-notes.lua | |
| parent | a94222cb63b7249304080842c6044c72bdd02c54 (diff) | |
| download | nvim-config-bb02d0dc5f80c76e81da91855d49264d5c854b53.tar.gz nvim-config-bb02d0dc5f80c76e81da91855d49264d5c854b53.zip | |
misc: open notes index on NotesOpen
Diffstat (limited to 'plugin/50-notes.lua')
| -rw-r--r-- | plugin/50-notes.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugin/50-notes.lua b/plugin/50-notes.lua index de66679..f128447 100644 --- a/plugin/50-notes.lua +++ b/plugin/50-notes.lua @@ -428,9 +428,16 @@ local function find_notes_by_grep() require("fzf-lua").live_grep({ cwd = notes_dir }) end +-- Enters the notes dir and opens its index, creating it with a `# Index` header on first use. local function open_notes() vim.cmd.cd(notes_dir) - vim.cmd.NotesFindTags() + local index = notes_dir .. "/index.md" + if not vim.uv.fs_stat(index) then + local f = assert(io.open(index, "w")) + f:write("# Index\n") + f:close() + end + vim.cmd.edit({ args = { index } }) end ---------------------------------------------------------------------------------------------------- |
