Giter Site home page Giter Site logo

installer.nvim's Introduction

installer.nvim

installer.nvim is a plugin that allows you to install external dependencies from neovim.

Features

  • Many builtin installers.
  • Most of builtin installers support windows.
  • Able to create custom installers.
  • Configurable.

You can find the built-in modules here

Install

This plugin requires plenary.nvim.

With packer.nvim

use { "nazo6/installer.nvim",
  requires = {"nvim-lua/plenary.nvim"}
}

Usage

You can install module using :Install <category> <name> and uninstall using :Uninstall <category> <name>. You can also use :Update to update modules at once.

This plugin does not make much sense on its own. It is more powerful when used in combination with various plugins using the integrations.

Configs

There is a setup function. This plugin works even if you don't call it, but if you do, call it before any other integration.

This is example of config.

require("installer").setup({
  -- Automatically installs modules that are not installed at startup
  ensure_installed = {
    tools = {"ripgrep"}
  }
   -- User defined modules(installers). See the "Custom module" section below for more information.
  custom_modules = {
  },
  -- Hooks
  hooks = {
    install = {
      pre = {
        function (category, name)
        end
      }
    }
  }
  debug = false,
})

null-ls

require("installer.integrations.null_ls").setup {
  configs = {
    debug = true,
    capabilities = {},
    on_attach = {},
  },
  enable_hook = true,
}

tools

Modules belonging to the tools category have information about the own path, which can be retrieved with the following code.

require("installer.integrations.tools").get "ripgrep",

โš ๏ธNote that it will return the path whether it is actually installed or not. Use ensure_installed if you want to be sure that it is installed.

This will make any external dependencies of the plugin portable. This is an example of the configuration in telescope.nvim.

require("telescope").setup {
  defaults = {
    vimgrep_arguments = {
      require("installer.integrations.tools").get "ripgrep",
      "--color=never",
      "--no-heading",
      "--with-filename",
      "--line-number",
      "--column",
      "--smart-case",
    },
  },
}

Reference

Commands

  • :Install <category> <name>: Install module. For example: :Install null_ls stylua
  • :Reinstall <category> <name>: Reinstall module.
  • :Uninstall <category> <name>: Uninstall module.
  • :Update [<category> <name>]: Update module. If args are omitted, all plugins will be updated.

APIs

installer

  • setup(config) Set config and install modules specified by ensure_installed
  • register(category, name, module)
  • install(category, name)
  • uninstall(category, name)
  • reinstall(category, name)
  • module_path(category, name) Get installation path of module. This function returns the path regardless of whether the module is actually installed or not.

installer/status

  • get_module(category, name) Get module content

installer/status/{available, installed}

  • get_modules() Get all module name table
  • get_categories() Get all categories name
  • get_category_modules(category) Get all modules of category

installer/integrations/null_ls

  • setup(opts)
  • get(module_name)
  • get_all()

installer/integrations/tools

  • get(module_name)
  • get_all()

Custom modules

You can create custom modules and register it by setup or register function. All modules must have install_script field, which is function that return install script. You should determine the os in your function and return the appropriate script for it. On Windows, the script will run in powershell.exe, otherwise it will run in /bin/bash.

Credits

installer.nvim's People

Contributors

borwe avatar nazo6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

borwe

installer.nvim's Issues

Which to use?

Is it recommended to use main or v2 branch?
Also when contributing should people contribute to main or v2 branch?

All language server stopped working after latest upgrade

All my language server are gone ( not detected ) after I updated the plugin address to nazo6/installer.nvim

How can I revert back earlier version of the plugin ???

all my workflow is disturbed ๐Ÿ˜ข

I guess , changing the name caused some issue with lspconfig

Git authentication error

I am trying to install your plugin,
but getting this error

image

I tried both way, but it fails , even after proper authentication

image

Error

image

I am hoping to install Language Server properly on my Windows Machine with this plugin

Add emmet

@barungh It seems like emmet doesn't have cli. What kind of use do you envision for it? If you just want to use emmet with nvim, I think you should use something like emmet-vim.

The latest changes broke the possibility to inject custom installers

Maybe there is already a new way to approach this situation but I couldn't find it out.
In particular I'm referring to this (example from the readme):

-- 1. get the default config from nvim-lspconfig
local config = require"lspinstall/util".extract_config("bashls")
-- 2. update the cmd. relative paths are allowed, lspinstall automatically adjusts the cmd and cmd_cwd for us!
config.default_config.cmd[1] = "./node_modules/.bin/bash-language-server"

-- 3. extend the config with an install_script and (optionally) uninstall_script
require'lspinstall/servers'.bash = vim.tbl_extend('error', config, {
  -- lspinstall will automatically create/delete the install directory for every server
  install_script = [[
  ! test -f package.json && npm init -y --scope=lspinstall || true
  npm install bash-language-server@latest
  ]],
  uninstall_script = nil -- can be omitted
})

The problem should be caused by the recent changes in the structure.

Omnisharp C# server not working

image

Can you fix this ?

After installing omnisharp language server I fell hook command to attach client is not being executed.

How do I solve this problem ? any suggestion ?

Thank You

Help Wanted

This is my configuration ( please see left side )

at first it worked , but then stopped working

image

this is configuration file / module

image

BUG: Error at start the module lspconfig/configs not exists

Hi thanks for make this amazing plugin but i have a Bug when i trying use this

image

Not found the module lspconfig/configs here are my packer installation:

use {
  'neovim/nvim-lspconfig',
  config = function()
    require 'lsp.lsp-servers'
  end,
  --event = 'BufReadPre',
}

use {
  'nazo6/lspinstall.nvim',
  config = function()
    require('lsp.installer')
  end,
}

Any idea for fix that?

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.