Skip to content

vsplit always opens to the left, can it be on the right?  #1626

Closed
@ZacharyRizer

Description

@ZacharyRizer

Description

When I'm over a file in nvim-tree and press to open it in a vsplit, I want the file to open the right of the current file I have open. But it always is placed to the left of the current file. I'm sure this is a config setting I'm missing.

Neovim version

NVIM v0.9.0-dev-5-g9353e2f7e
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by root@FM-WYN2K2JQ9D

Operating system and version

macOS 12.4

nvim-tree version

7282f7d

Minimal config

vim.opt.splitbelow = true
vim.opt.splitright = true

local tree_cb = require 'nvim-tree.config'.nvim_tree_callback
require('nvim-tree').setup({
    actions             = {
        open_file = { quit_on_open = true },
    },
    renderer            = {
        indent_markers = { enable = true }
    },
    respect_buf_cwd     = true,
    update_cwd          = true,
    update_focused_file = { enable = true, update_cwd = true },
    view                = {
        adaptive_size = true,
        mappings = {
            custom_only = false,
            list = {
                { key = "<CR>", cb = tree_cb("edit") },
                { key = "h", cb = tree_cb("close_node") },
                { key = "l", cb = tree_cb("open_node") },
                { key = "<BS>", cb = tree_cb("dir_up") },
                { key = "?", cb = tree_cb("toggle_help") },
                { key = "<C-e>", cb = tree_cb("close") },
                { key = "<C-s>", cb = tree_cb("split") },
            }
        },
        width = 35,
        side = 'right',
    },
})

Steps to reproduce

  1. have a file open in vim buffer current_file
  2. :NvimTreeOpen
  3. navigate to file
  4. <C-v> to open in vsplit

Expected behavior

File opens to the right of current_file

Actual behavior

File opens to the left of current_file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionExisting functionality broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions