Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

How to change root directory with lua script using api #2649

fcacicAi started this conversation in General
Discussion options

openNewRoot = function (root)
local api = require("nvim-tree.api")

api.tree.open({
  path=root
  current_window=true
})

I would like to have function that can change the root of current nvim-tree view.

So i can easily shift between projects.
But this does not change the view in nvim-tree.

You must be logged in to vote

Replies: 1 comment

Comment options

Is :h sync_root_with_cwd what you re after?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.