chiyadev / dep Goto Github PK
View Code? Open in Web Editor NEWCorrect neovim package manager
License: MIT License
Correct neovim package manager
License: MIT License
when I try to run "make" in the config function for this plugin[1], it appears the cwd is whatever cwd I have atm in nvim, how do I switch to the plugin directory?
[1] https://github.com/nvim-telescope/telescope-fzf-native.nvim
According to the readme:
-- [boolean] Prevents the package from being loaded
disable = true
This implies that marking a package as disabled only prevents it from being loaded into neovim. But it also stops the package from being installed and updated. Is this the intended behavior?
I guess vim.loop.spawn
does not kill the jobs if neovim is closed, unlike jobstart
(I am only sure about jobstart
). So when neovim exits, it would be great to clean them up.
{
-- [string] Specifies the full name of the package.
-- This is the only required field; all other fields are optional.
"user/package",
-- This should be triggered every time the package is loaded
-- [function] Code to run after the package is loaded into neovim.
function()
require "package".setup(...)
end,
-- This should be triggered after install or update
-- AFTER the loaded function is triggered
-- [function] Code to run after the package is installed or updated.
config = function()
os.execute(...)
end,
}
Currently to the best of my ability to tell it appears that config() is ran as soon as the plugin is updated, as in as soon as the new git is pulled or similar. Instead it should be called once the plugin is actually loaded.
As an example my mason spec currently looks like this:
return {
"williamboman/mason.nvim",
function()
require("mason").setup()
end,
config = function()
require("mason").setup()
vim.cmd("MasonUpdate")
end,
}
Because the config function is being executed before the 'loaded' function I need to manually load the plugin twice, once if it updates, then a second time for when it would normally be loaded.
This does appear to function fine (although running a plugins setup function twice could possible cause issues with other plugins that I haven't tried) but I feel like this is a much nicer pattern:
return {
"williamboman/mason.nvim",
function()
require("mason").setup()
end,
config = function()
vim.cmd("MasonUpdate")
end,
}
require "SetupDep.bootstrap"
require "dep"{
'echasnovski/mini.nvim',
function()
require 'mini.starter'.setup({})
end,
}
--require 'mini.starter'.setup({})
when I run the first part I get ..
[dep] ...pData\Local\nvim-data\site\pack\deps\opt\dep/lua/dep.lua:120: ...pData\Local\nvim-data\site\pack\deps\opt\dep/lua/dep.lua:16: attempt to index local 'id' (a function value) (spec=<function 1>)
When I comment out the function and use require 'mini.starter'.setup({})
everything runs fine.
Am I missing something?
Thx
Problem:
I have some use cases where I want to customize git behavior through either user configuration file or environment variables. Then I found git command spawned by "dep" (through vim.loop.spawn
) is not affected by any of those methods. After some digging, I found the environment of the git command is basically empty (by looking at /proc/[pid of git command]/environ
file). Thus it's ignoring environment variables, and also ignoring user configuration due to lack of $HOME
definition.
(The use case is that I would like to use proxy for git, through http.proxy
setting or external commands like proxychains
)
Expected:
Git command inherits whatever environment variables Neovim has.
I hope this does not require too much extra work for you, possibly is there another API to do this automatically?
Any plans on allowing something like this?
require "dep" {
"https://github.com/user/package",
"/some/absolute/path/package",
}
Very interesting design!
Would it be possible to implement lazy loading?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.