Skip to content
Rizwanelansyah edited this page May 19, 2024 · 8 revisions

Configuration Option

this the avaible option on the setup function opts

border: table

this field determines how the border style of file explorer is the border table avaible fields is up, left, main, right with the value is border style like nvim_open_win() border config

default value:

{
    main = "double",
    left = "rounded",
    right = "rounded",
    up = { "", "", "", ":", "", "", "", ":" },
}

example:

require("simplyfile").setup {
    border = {
        up = { "", "", "", "|", "/", "_", "\\", "|" },
        main = {
            { "#", "MyMainCorner" },
            { "+", "MyMainBorder" },
        },
    },
}

default_keymaps: boolean

determine the plugin should use default keymaps or not, see default keymaps, default true.

keymaps: table

key maps for the file explorer, this keymaps override default_keymaps field. default is empty table {},

example keymap: map d to remove file/folder using trash-cli:

require("simplyfile").setup {
    keymaps = {
        d = function(dir)
            os.execute("trash " .. dir.absolute)
        end,
    }
}

open_on_enter: boolean

open file explorer on enter neovim

preview: table

preview have this fields

  • show: determine if the file is can show on the preview window(right window) on explorer or not, show must be boolean or function that return boolean and passed one selected dir, default true.

    Example:

    require("simplyfile").setup {
        preview = {
            show = function(dir)
                if dir.is_folder then
                    -- don't show node_mopdules and .git
                    -- folder on preview window
                    if dir.name == "node_modules" then
                        return false
                    elseif dir.name == ".git" then
                        return false
                    else
                        return true
                    end
                else
                    -- don't preview image on preview window
                    if dir.name:match("%.png$") then
                        return false
                    else
                        return true
                    end
                end,
            end
        },
    }
  • max_lines: max lines that can be shown on the preview the value can be a integer or function that not take any argument and return an integer.

    default:

    function()
        return vim.o.lines
    end

    example:

    require("simplyfile").setup {
        preview = {
            max_lines = 1,
        },
    }

Clone this wiki locally