• Stars
    star
    189
  • Rank 199,888 (Top 5 %)
  • Language
    Lua
  • License
    MIT License
  • Created over 1 year ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

It's not because we use netrw that we cannot have nice things!

netrw.nvim

It's not because we use netrw that we cannot have nice things! This plugin adds a layer of ✨bling✨ and configuration to your favorite file explorer.

Features

  • Print file icons in the sign column
  • Configure custom actions with keybinds

Requirements

Installing

Install the plugin with your preferred package manager:

vim-plug

Plug 'prichrd/netrw.nvim'

packer

use 'prichrd/netrw.nvim'

Usage

Enable the plugin:

require'netrw'.setup{
  -- Put your configuration here, or leave the object empty to take the default
  -- configuration.
  icons = {
    symlink = '', -- Symlink icon (directory and file)
    directory = '', -- Directory icon
    file = 'ο…›', -- File icon
  },
  use_devicons = true, -- Uses nvim-web-devicons if true, otherwise use the file icon specified above
  mappings = {}, -- Custom key mappings
}

Custom key mappings:

require'netrw'.setup{
  -- your config ...

  -- Define normal mode mapping
  mappings = {
    -- Function mappings
    ['p'] = function(payload)
      -- Payload is an object describing the node under the cursor, the object
      -- has the following keys:
      -- - dir: the current netrw directory (vim.b.netrw_curdir)
      -- - node: the name of the file or directory under the cursor
      -- - link: the referenced file if the node under the cursor is a symlink
      -- - extension: the file extension if the node under the cursor is a file
      -- - type: the type of node under the cursor (0 = dir, 1 = file, 2 = symlink)
      print(vim.inspect(payload))
    end,
    -- String command mappings
    ['<Leader><Tab>'] = ":echo 'string command'<CR>",
    -- more mappings ...
  }
  -- your config ...
}

The plugin documentation can be found at doc/netrw.nvim.txt. You can also use the :help netrw.nvim command inside of Neovim.

Contributing

This project accepts contributions. Feel free to open issues for questions, feature ideas, bugs, etc. Before submitting a PR, make sure you run make lint with stylua and luacheck installed.