Skip to content

Latest commit

 

History

History
87 lines (68 loc) · 1.92 KB

explorer.md

File metadata and controls

87 lines (68 loc) · 1.92 KB

🍿 explorer

A file explorer for snacks. This is actually a picker in disguise.

This module provide a shortcut to open the explorer picker and a setup function to replace netrw with the explorer.

When the explorer and replace_netrw is enabled, the explorer will be opened:

  • when you start nvim with a directory
  • when you open a directory in vim

Configuring the explorer picker is done with the picker options.

-- lazy.nvim
{
  "folke/snacks.nvim",
  ---@type snacks.Config
  opts = {
    explorer = {
      -- your explorer configuration comes here
      -- or leave it empty to use the default settings
      -- refer to the configuration section below
    },
    picker = {
      sources = {
        explorer = {
          -- your explorer picker configuration comes here
          -- or leave it empty to use the default settings
        }
      }
    }
  }
}

image

📦 Setup

-- lazy.nvim
{
  "folke/snacks.nvim",
  ---@type snacks.Config
  opts = {
    explorer = {
      -- your explorer configuration comes here
      -- or leave it empty to use the default settings
      -- refer to the configuration section below
    }
  }
}

⚙️ Config

These are just the general explorer settings. To configure the explorer picker, see snacks.picker.explorer.Config

---@class snacks.explorer.Config
{
  replace_netrw = true, -- Replace netrw with the snacks explorer
}

📦 Module

Snacks.explorer()

---@type fun(opts?: snacks.picker.explorer.Config): snacks.Picker
Snacks.explorer()

Snacks.explorer.open()

Shortcut to open the explorer picker

---@param opts? snacks.picker.explorer.Config|{}
Snacks.explorer.open(opts)