Home

Awesome

neofs

A file manager for neovim written in lua

Mappings

KeyDescription
<CR> or lOpen folder or open file in the previous window
0Open the CWD
hOpen the parent folder of the current path
fCreate a new file
dCreate a new directory
<c-r>Rename current item
<c-d>Delete current item
<m-c-d>Recursively delete current item
qQuit

Custom Mappings

If you want to have some custom mappings defined whenever the file browser is open you can set them using the setup function.

Each callback receives the file manager as its first argument.

To see what you can do with the file manager look at this section

local neofs = require('neofs')

neofs.setup {
  mappings = {
    ["<c-e>w"] = function(fm)
      fm.path = vim.fn.expand("~/Desktop/workspace")
      fm.refresh()
    end
  }
}

Devicons

Neofs supports devicons if you set devicons to true.

local neofs = require('neofs')

neofs.setup {
  devicons = true
}

This requires you to have kyazdani42/nvim-web-devicons installed.

File Manager

Fields

To see more details about each field you can use print(vim.inspect(...))

Functions

open()

Takes an optional path parameter. If this is empty, the current working directory is opened.

This function should be bound to a keymap like

vim.keymap.set("n", "<leader>fs", function()
  require("neofs").open()
end, {noremap = true})

It can also be invoked by pressing :lua require("neofs").open("~/proj").

navigator.item()

Returns the item under the cursor.

An item has the following fields:

refresh()

Refreshes the content of the navigator window using the path field and reloads the preview window.

refresh_preview()

Reloads the preview window using the item under the cursor.

parent()

Returns the parent folder of the current path.