Skip to content

Maelwalser/oil-bar.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

oil-bar.nvim

An extension for stevearc/oil.nvim that provides a persistent sidebar toggle and context-aware navigation.

Features

oil-bar-demo.mp4
  • Persistent Sidebar Toggle: A simple command (e by default) to open and close oil.nvim in a persistent vertical split on the far left.

  • Context-Aware Navigation: The keymap is enhanced to be "sidebar-aware":

  • In the sidebar: Opens directories within the sidebar, and opens files in the main content window (to the right).

  • In a normal oil buffer: retains its default oil.nvim behavior.

  • Intelligent File Opening: Files opened from the sidebar are automatically opened in a window to the right, creating a new vertical split if one doesn't already exist.

  • Focus Retention: When opening a file from the sidebar, focus immediately returns to the sidebar, allowing you to continue browsing without interruption.

  • Decoupled Configuration: This plugin does not manage or override your personal oil.nvim configuration. It simply adds the toggle functionality and the smart keymap.

Requirements

  • neovim/nvim-lsp (v0.8+)

  • stevearc/oil.nvim

Installation & Configuration

Here is an example using lazy.nvim.

return {
  "maelwalser/oil-bar.nvim",
  dependencies = { "stevearc/oil.nvim" },
  opts = {
    -- keymap = "<leader>p" -- Uncomment and change to your preferred key
  },
}

Usage

Once installed, the plugin provides new behaviors.

Global

  • Press <leader>e (or your custom keymap) to toggle the oil.nvim sidebar on and off.

In the Oil Sidebar

  • Place your cursor on a directory and press to navigate into that directory within the sidebar.

  • Place your cursor on a file and press to open that file in a window to the right. Focus will remain on the sidebar.

In a Normal oil Buffer

  • Press on any entry to use the default oil.nvim "select" action (e.g., opening the file or directory in the current window).

About

Content aware sidebar for oil

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages