Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion -- add a preview key #35

Closed
ms-jpq opened this issue Jun 7, 2020 · 0 comments · Fixed by #36
Closed

Suggestion -- add a preview key #35

ms-jpq opened this issue Jun 7, 2020 · 0 comments · Fixed by #36

Comments

@ms-jpq
Copy link

ms-jpq commented Jun 7, 2020

Hi there,

I love your plugin, and I noticed that you don't have a key that opens files without leaving the tree's window.

It's a simple thing to add, and I have attached a snippet below of how I have it in my config.

I think this is a common enough usecase to include in the plugin though.

    lv.tree_preview = function ()
      local pos = api.nvim_win_get_cursor(0)
      local tree = require "tree"
      tree.on_keypress("edit")
      bindings.exec[[LuaTreeClose]]
      bindings.exec[[LuaTreeOpen]]
      api.nvim_win_set_cursor(0, pos)
    end

    bindings.map.normal("<Tab>", ":lua lv.tree_preview()<CR>")

*I wrote some config wrappers in my code, but you get the idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant