zk-org / zk-nvim

Neovim extension for zk
https://github.com/zk-org/zk
GNU General Public License v3.0
503 stars 41 forks source link

Make :ZkNew and :ZkIndex consistent with :ZkList #12

Closed kabouzeid closed 2 years ago

kabouzeid commented 2 years ago

ZkNewLink

There is a new ZkNewLink command. Select some text in visual mode, and then execute

:'<,'>ZkNewLink

this will create a new note and use the last visual selection as the title while replacing the selection with a link to the new note. You can also pass the usual options

:'<,'>ZkNewLink { edit = false, dir = "work", date = "yesterday" }

Changes for ZkNew

:ZkNew daily

becomes

:ZkNew { dir = "daily" }

which is a bit more verbose, but is consistent with :ZkList and allows for something like

:ZkNew { dir = "daily", date = "yesterday" }
kabouzeid commented 2 years ago

Looking good, the ZkNewLink command is a bit redundant with the LSP code actions but it's much more flexible so still very useful.

Could you elaborate on this? I'm not sure I understand what you mean 🤔

I have something in mind to make things more easily extendable by the user, similar to the alias feature of the CLI. I'll propose this soon in the architecture discussion to see what you all think about it. I think after that this plugin will be basically feature complete.

mickael-menu commented 2 years ago

Could you elaborate on this? I'm not sure I understand what you mean 🤔

See this discussion https://github.com/mickael-menu/zk/discussions/100#discussioncomment-1627700

I have something in mind to make things more easily extendable by the user, similar to the alias feature of the CLI. I'll propose this soon in the architecture discussion to see what you all think about it.

Sounds good, looking forward to your idea!

kabouzeid commented 2 years ago

Ah, I didn't know about that. A bit redundant indeed. The code range action doesn't seem to work reliably on a buffer with unwritten changes, i.e. the range seems to be off then. Not sure if that's Neovim's or zk's fault though.