Skip to content

NvimTree opens on wrong side when opening file for first time #1072

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

Closed
SethGunnells opened this issue Mar 11, 2022 · 3 comments
Closed

NvimTree opens on wrong side when opening file for first time #1072

SethGunnells opened this issue Mar 11, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@SethGunnells
Copy link

Description

When opening a directory like so: nvim . and hitting Enter on some file, NvimTree ends up on the right side of the screen instead of the left. Upon closing and reopening it, it appears on the left as intended.

If important, it is also showing on 50% of the screen as described in #1071.

Neovim version

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3

Operating system and version

macOS Monterey, 12.1

nvim-tree version

2457e14

Steps to reproduce

  1. nvim .
  2. Enter on any file

Expected behavior

NvimTree remains open on left size, sized correctly

Actual behavior

NvimTree remains open on right size, taking up 50% of screen

Minimal config

require'paq' {
  'kyazdani42/nvim-tree.lua';
}

require'nvim-tree'.setup()
@SethGunnells SethGunnells added the bug Something isn't working label Mar 11, 2022
@freitagfelipe
Copy link

freitagfelipe commented Mar 11, 2022

I had this same issue this morning. I solved with this line in my nvim settings:
vim.opt.splitright = true
I'm assuming you are using a .lua file for your settings. But if you are using a .vim file maybe you can use this:
set splitright

For the 50% screen problem I solved with this options in my nvim-tree setup:

actions = {
    open_file = {
        resize_window = true
    }
}

I hope I was able to help you!

@kyazdani42
Copy link
Member

indeed this is unrelated to the tree, as the option is global. Setting resize_window to true will fix the issue as the tree will be moved and resized when opening the file.

@SethGunnells
Copy link
Author

Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants