Git Product home page Git Product logo

xpm.xplr's Introduction

xplr plugin manager

NOTE: as of a194ce5 the minimum xplr version is 0.20 due to the usage of xplr.util

Requirements

  • Bash
  • Git

Installation

  • Add the following line in ~/.config/xplr/init.lua
local home = os.getenv("HOME")
local xpm_path = home .. "/.local/share/xplr/dtomvan/xpm.xplr"
local xpm_url = "https://github.com/dtomvan/xpm.xplr"

package.path = package.path
  .. ";"
  .. xpm_path
  .. "/?.lua;"
  .. xpm_path
  .. "/?/init.lua"

os.execute(
  string.format(
    "[ -e '%s' ] || git clone '%s' '%s'",
    xpm_path,
    xpm_url,
    xpm_path
  )
)
  • Require the module in ~/.config/xplr/init.lua
require("xpm").setup({

    -- This works
    'dtomvan/xpm.xplr',

    -- Or this
    'github:dtomvan/xpm.xplr',

    -- Or this
    'https://github.com/dtomvan/xpm.xplr',

    -- You can also use a field
    { name = "dtomvan/xpm.xplr" },
})

-- Or

require("xpm").setup({
  plugins = {
    -- Let xpm manage itself
    'dtomvan/xpm.xplr',
    { name = 'sayanarijit/fzf.xplr' },
  },
  auto_install = true,
  auto_cleanup = true,
})
  • (optional) Setup key binding for manually managing plugins
xplr.config.modes.builtin.default.key_bindings.on_key.x = {
  help = "xpm",
  messages = {
    "PopMode",
    { SwitchModeCustom = "xpm" },
  },
}

WARNING: a current limitation is that any repo not ending in .xplr isn't picked up correctly, but by convention the repo's name should end in .xplr

Features

  • Automatically downloads and installs plugins
  • Pre/post load hooks
  • Automatically calls setup() if possible
  • Grabs from any git repository

Setup arguments

{
  -- Default: {}
  plugins = { "dtomvan/xpm.xplr" },

  -- Default: true
  auto_install = true

  -- Default: false
  auto_cleanup = false
}

Plugin arguments

All available arguments for a plugin are:

-- <in xpm.setup>
{
    -- Default: Skip if empty
    "<name>",

    -- Default: Skip if empty
    name = "<name>",

    -- Branch, commit or tag to pin
    -- Default: "origin"
    rev = "<revision>"

    -- Default: empty
    after = function() end,

    -- Default: empty
    before = function() end,

    -- Default: require("<name>").setup()
    setup = function() end,

    -- Default: empty
    -- WARNING: if any of the dependencies fail to download, the plugin won't
    -- load to prevent from any damage being done
    deps = { "dtomvan/xpm.xplr" }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.