epwalsh / epwalsh/obsidian.nvim
Automatically run :ObsidianRename when a file change is detected 🙈
- Dominant language
- Lua
- Stars
- 6.2k
- Forks
- 250
- PR merge metrics
- No merged PRs in 30d
Description
### 🚀 The feature, motivation and pitch
I use `oil.nvim` which allows users to [change file names/locations](https://github.com/stevearc/oil.nvim/blob/master/lua/oil/fs.lua#L324) by using the vim buffer alone. I would absolutely adore if file renames from `oil.nvim` would automatically trigger `:ObsidianRename`
### Alternatives
_No response_
### Additional context
I _think_ it should be possible to use [`new_fs_event()`](https://neovim.io/doc/user/luvref.html#luv-fs-event-handle) to detect file renames
I would be happy to try and contribute though I don't have any lua/vim plugin experience, so I may need some guidance (no clue how `new_fs_event` works, [this](https://github.com/luvit/luv/blob/master/examples/uvbook/onchange.lua) is the only example I found.
There should also probably be a flag to gate this feature 😂
PS. Absolutely LOVE `obsidian.nvim`, have been wishing for this my whole life since I started using obsidian so I could stop using obsidian and go back to neovim. Thank you for your hard work
Contributor guide
Research direction
Read the linked oil.nvim fs.lua implementation and Neovim's luv new_fs_event documentation first. Locate the existing file-change handling entry point in obsidian.nvim, then determine how an opt-in watcher could trigger :ObsidianRename for renames. Done means the behavior works for oil.nvim-style renames and is gated by a configuration flag.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100