Skip to content

Open file without lost nvimtree focus #2505

Answered by alex-courtis
sajadspeed asked this question in Q&A
Discussion options

You must be logged in to vote

Try this custom mapped function. It will behave a bit like preview:

local function nt_open_no_focus()
  api.node.open.edit()
  api.tree.focus()
end

In your on_attach:

  vim.keymap.set("n", "N", nt_open_no_focus, opts("Open: No Focus"))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sajadspeed
Comment options

Answer selected by sajadspeed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2504 on October 31, 2023 16:47.