Skip to content

Open file without losing sidebar focus #249

Answered by cseickel
krmbzds asked this question in Q&A
Discussion options

You must be logged in to vote

The easiest way to do that is to create a custom mapping to your own function that calls a built-in open command, then toggles back to the tree:

  require("neo-tree").setup({
    window = {
      mappings = {
        ["O"] = function (state)
          state.commands["open"](state)
          vim.cmd("Neotree reveal")
        end,

...

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
8 replies
@cseickel
Comment options

@gegoune
Comment options

@cseickel
Comment options

@nyngwang
Comment options

@krmbzds
Comment options

Answer selected by krmbzds
Comment options

You must be logged in to vote
0 replies
Comment options

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

Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants