nvim-tree / nvim-tree/nvim-tree.lua

Allow `api.fs...` to take a path as input

Open
#1,605 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API feature request PR please
Dominant language
Lua
Stars
8.6k
Forks
639
Avg merge
1d 14h
Merged PRs (30d)
2

Description

Instead of having to prompt the user to enter a filename after invoking api.fs.create, it would be nice if we could do something like this:

require('nvim-tree.api').fs.create('/path/to/file')

(If no input is passed, then prompt to enter filename.)

And the same for api.fs.paste.

A really good use case for this would be a user-friendly action for file duplication, which is a pretty common action.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Lua implementations of nvim-tree.api.fs.create and api.fs.paste. Read how each currently prompts for a filename, then verify the behavior for an explicit path and for no input. Done means both APIs accept a path while preserving the existing prompt behavior when no path is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.