-
Notifications
You must be signed in to change notification settings - Fork 10
Conversation
…reate a new note, still need to determine how to get that part workign if you're not in a folder with a relative .zk folder as a root marker
cmd = string.format("zk new --title %s", title) | ||
end | ||
|
||
vim.fn.jobstart( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to have a utility to handle future jobstart usages.
lua/zk/adapter.lua
Outdated
local cmd = "zk new" | ||
|
||
if title ~= nil and title ~= "" then | ||
cmd = string.format("zk new --title %s", title) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we don't care about further arguments passed in, just a title is sufficient as an optional arg, yeah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The destination directory and/or --group
could be useful too, to generate different kind of notes. The group is actually derived from the destination directory. See this note and zk new --help
.
You can also feed some initial content to the note, which will be expanded in the template with {{content}}
. This needs to be fed through an stdin pipe. Maybe it's overkill for now, but could be nice later to create a new note from the current buffer selection, to split a big note into smaller ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The destination directory and/or
--group
could be useful too, to generate different kind of notes. The group is actually derived from the destination directory. See this note andzk new --help
.You can also feed some initial content to the note, which will be expanded in the template with
{{content}}
. This needs to be fed through an stdin pipe. Maybe it's overkill for now, but could be nice later to create a new note from the current buffer selection, to split a big note into smaller ones.
I love this idea for the note management aspect. Adding for future enhancement idea (#3).
lua/zk/adapter.lua
Outdated
print(string.format("[zk.nvim] on_exit -> j: %s, d: %s, e: %s", vim.inspect(j), vim.inspect(d), vim.inspect(e))) | ||
|
||
if d == 0 then | ||
vim.api.nvim_out_write("[zk.nvim] new zettel note created") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to be able to get the path to the newly created note and open a buffer/vsplit/split/tab to that note.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you can do this with zk new --print-path
@@ -1,29 +1,15 @@ | |||
local zk = {} | |||
_G.zk_util = require("zk.util") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this global utility? not using the more complicated way to create commands previously used.
plugin/zk.vim
Outdated
@@ -5,52 +5,14 @@ set cpo&vim | |||
|
|||
if !has('nvim') | |||
echohl Error | |||
echom "Sorry this plugin only works with versions of neovim that support lua: nightly, >=0.5.0" | |||
echom "[zk.nvim] This plug presently only supports neovim versions: nightly, >=0.5.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plug
-> plugin
Merging to main; was able to create a new note from the |
This PR adds some additional structure and arch around future command creation and usage.
It first enables a way to install
zk
into the user'sGOPATH
. Secondly it enables a way to create a newzk
note, this feature is presently broken (see #1) until we create a way to handlezk
's requirement to be run within acwd
that contains an initialized notebook using a.zk
root marker.See further discussion here: https://github.com/mickael-menu/zk/discussions/11#discussioncomment-489636