Repository navigation
Renaming and moving notes #614
Replies: 7 comments 1 reply
|
Here's a spec, feel free to review and comment. We're talking about two separate features using the same renaming process under the hood:
In both cases, the path of the note, its title and all the inbound or outbound links might need to be updated in a single atomic operation. The actual FS changes will be handled by POSIX New commandsWe'll need one new
|
|
@mickael-menu Look like some logic missing in moving process logic. The links inside the moved file should be updated too. For example, file |
|
I believe this should be in scope for The renaming features suggested by @mickael-menu are quite comprehensive; personally I would be very happy with a simple renaming command that lets me do batch renaming using templates, something like the following: Since the notes already exist, the rename command can allow metadata and all other relevant fields in the template. This could provide very powerful renaming capabilities. I am not a heavy user of the linking capabilities so I'm not sure how those would be handled. |
|
Thought I'd weigh in with my use-case, and support for a KISS solution (as much as possible/is applicable). I've been using a PARA/Zettelkasten approach, with a directory structure such as the following. I'd generally work within a project directory in "1 Projects" - e.g. writing up a design - then I'd move that into "4 Archives", the links within would probably be relative - so should resolve fine - however, it'd be great to have the peace-of-mind that these links get fixed up (especially if they link into "2 Areas" for example). I personally use unique file-names, so appreciate the problem space there's far easier and that's not the case for everyone. I'm also quite happy to get involved implementing a solution, when we land on one. |
|
For the benefit of others, the workflow I've highlighted above appears to work well with Wiki style links. diff --git a/config.toml b/config.toml
index ee299df..002eb4f 100644
--- a/config.toml
+++ b/config.toml
@@ -81,13 +81,13 @@ template = "fleeting.md"
# Format used to generate links between notes.
# Either "wiki", "markdown" or a custom template. Default is "markdown".
-#link-format = "wiki"
+link-format = "wiki"
# Indicates whether a link's path will be percent-encoded.
# Defaults to true for "markdown" format and false for "wiki" format.
-#link-encode-path = true
+link-encode-path = false
# Indicates whether a link's path file extension will be removed.
# Defaults to true.
-#link-drop-extension = true
+link-drop-extension = true
# Enable support for #hashtags.
hashtags = true
@@ -128,7 +128,7 @@ multiword-tags = false
# Each diagnostic can have for value: none, hint, info, warning, error
# Report titles of wiki-links as hints.
-#wiki-title = "hint"
+wiki-title = "hint"
# Warn for dead links between notes.
dead-link = "error"With this setup, you can use links such as The TIL: You don't really need re-naming for the workflow shared above, although appreciate that won't be the case for everyone. |
|
I use zk almost exclusively from within neovim so if rename where to finally be implemented it would be quite helpful if it was expose to the LSP so that renaming can happened from within the editor |
@jamesl33 thats not a bad idea. maybe the rename command should be more of a migration command where it goes ahead and add the id to to the file name and rewrites links to be |
Uh oh!
There was an error while loading. Please reload this page.
Discussed in #199
Originally posted by srid April 27, 2022
Would this be in scope for
zk? Basically:will rename
Foo.mdtoBar Qux.mdwhile taking care of references. By which I mean it will replace all occurrences of[[Foo]]with[[Bar Qux]]in the notebook. As well as[[Foo|...]]with[[Bar Qux|..]]. This is exactly what the vscode-memo extension does.The replacement can be delegated to
sd.EDIT: It should probably take directory and relative wiki links too into consideration? eg:
[[Parent/Foo]]->[[Parent/Bar Qux]]. Might have to disambiguate multipleFoo.mdas well (in different parents).All reactions