Skip to content

Move a file into a different directory. This lua script will eventually look to get merged into obsidian.nvim. I want the ability to move a fleeting note to permanent notes without leaving the editor and going to the cli.

License

Notifications You must be signed in to change notification settings

austinwilcox/ZKMoveFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Why?

I prefer to use neovim for all of my note taking, but I have recently stumbled into obsidian and i've been amazed at how powerful of a note taking application it is so I've started assembling my Zettelkasten in it. Then I stumbled onto Obsidian.nvim, and realized it had everything I wanted, except for the ability to move files to a separate folder while editing it. The end goal of this repo is that the code here gets merged into the Obsidian.nvim project.

Setup

There are 3 options you can supply to ZKMoveFile. Those are dir, title, and layers. dir is the only required one, whereas layers will determine how many folders deep to travel, and title is the title of the plenary popup window.

layers: Default is 0. 0 will be just the current level that you supply with dir, 1 will go 1 layer deeper than that, etc. If you want to recursively search all subdirectories supply -1.

title: Default is "ZK Move Current Buffer", but you can supply whatever you would like.

dir: The root directory of your Zettelkasten.

Lazy

{
    "austinwilcox/ZKMoveFile",
    dependencies = {
      "nvim-lua/plenary.nvim"
    },
    config=function()
      require("ZKMoveFile").setup{
        dir=/full/path/to/zettelkasten,
        title='ZK Directories',
        layers=0
      }
    end
}

Instruction

Once the package is loaded with lazy, you can now use the command ZKMoveCurrentBuffer. Use this command in command mode when you are editing a file that you want to move to a different location within your Zettelkasten.

TODO

    • Recursively load all directories within the obsidianZettelkasten vault - currently only loads surface level folders
    • Fix output when moving a file to the selected directory
    • Use Plenary instead of vim.input
    • Add exclude_dirs option in the opts for setup. This will allow users to ignore certain folders for options to move to
    • Change layers to depth, depth makes much more sense when traversing folders.
    • Change name of the permanent notes option.
    • Add option to add hidden folders, I currently have that disabled by default

About

Move a file into a different directory. This lua script will eventually look to get merged into obsidian.nvim. I want the ability to move a fleeting note to permanent notes without leaving the editor and going to the cli.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages