epwalsh / epwalsh/obsidian.nvim

Automatically run :ObsidianRename when a file change is detected 🙈

Open
#376 1 comment 2 reactions 0 assignees View on GitHub
feature request
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.