vimPlugins.openscad-nvim: init at 2022-04-15

This commit is contained in:
traxys 2023-03-20 11:51:22 +01:00
parent e32f3c7ea9
commit f58a0dc2d4
4 changed files with 76 additions and 0 deletions

View File

@ -6873,6 +6873,18 @@ final: prev:
meta.homepage = "https://github.com/tyru/open-browser.vim/";
};
openscad-nvim = buildVimPluginFrom2Nix {
pname = "openscad.nvim";
version = "2022-04-15";
src = fetchFromGitHub {
owner = "salkin-mada";
repo = "openscad.nvim";
rev = "197ca5ea7ca53702c453f862e7f4734b51c7023e";
sha256 = "1f0xd9gaacg7avrnsyigal4iz8645z50fgpwjfxis9nrjlia7h73";
};
meta.homepage = "https://github.com/salkin-mada/openscad.nvim/";
};
orgmode = buildVimPluginFrom2Nix {
pname = "orgmode";
version = "2023-03-17";

View File

@ -24,6 +24,7 @@
, git
, gnome
, himalaya
, htop
, jq
, khard
, languagetool
@ -31,6 +32,7 @@
, meson
, nim
, nodePackages
, openscad
, pandoc
, parinfer-rust
, ripgrep
@ -50,6 +52,7 @@
, nodejs
, xdotool
, xorg
, zathura
, zsh
# command-t dependencies
@ -729,6 +732,22 @@ self: super: {
configurePhase = "cd vim";
});
# The plugin depends on either skim-vim or fzf-vim, but we don't want to force the user so we
# avoid choosing one of them and leave it to the user
openscad-nvim = super.openscad-nvim.overrideAttrs (old: {
buildInputs = [ zathura htop openscad ];
patches = [ ./patches/openscad.nvim/program_paths.patch ];
postPatch = ''
substituteInPlace lua/openscad.lua --replace '@zathura-path@' ${zathura}/bin/zathura
substituteInPlace autoload/health/openscad_nvim.vim --replace '@zathura-path@' ${zathura}/bin/zathura
substituteInPlace lua/openscad/terminal.lua --replace '@htop-path@' ${htop}/bin/htop
substituteInPlace autoload/health/openscad_nvim.vim --replace '@htop-path@' ${htop}/bin/htop
substituteInPlace lua/openscad.lua --replace '@openscad-path@' ${openscad}/bin/openscad
'';
});
orgmode = super.orgmode.overrideAttrs (old: {
dependencies = with self; [ (nvim-treesitter.withPlugins (p: [ p.org ])) ];
});

View File

@ -0,0 +1,44 @@
diff --git a/autoload/health/openscad_nvim.vim b/autoload/health/openscad_nvim.vim
index 9022d55..30ef53f 100644
--- a/autoload/health/openscad_nvim.vim
+++ b/autoload/health/openscad_nvim.vim
@@ -7,7 +7,7 @@ function! s:check_nvim_version_minimum() abort
endfunction
function! s:check_zathura_installed() abort
- if !executable('zathura')
+ if !executable('@zathura-path@')
call health#report_error('has(zathura)','install zathura')
else
call health#report_ok("zathura is installed")
@@ -15,7 +15,7 @@ function! s:check_zathura_installed() abort
endfunction
function! s:check_htop_installed() abort
- if !executable('htop')
+ if !executable('@htop-path@')
call health#report_error('has(htop)','install htop')
else
call health#report_ok("htop is installed")
diff --git a/lua/openscad.lua b/lua/openscad.lua
index 7dff2fb..4382003 100644
--- a/lua/openscad.lua
+++ b/lua/openscad.lua
@@ -101,7 +101,7 @@ end
function M.manual()
local path = U.openscad_nvim_root_dir .. U.path_sep .. "help_source" .. U.path_sep .. "openscad-manual.pdf"
- api.nvim_command('silent !zathura --fork ' .. path)
+ api.nvim_command('silent !@zathura-path@ --fork ' .. path)
end
function M.help()
@@ -119,7 +119,7 @@ end
function M.exec_openscad()
-- maybe just use api.jobstart .. instead
- api.nvim_command[[ call jobstart('openscad ' . shellescape(expand('%:p')), {'detach':1}) ]]
+ api.nvim_command[[ call jobstart('@openscad-path@ ' . shellescape(expand('%:p')), {'detach':1}) ]]
end
function M.default_mappings()

View File

@ -578,6 +578,7 @@ https://github.com/sonph/onehalf/,,
https://github.com/rmehri01/onenord.nvim/,main,
https://github.com/tyru/open-browser-github.vim/,,
https://github.com/tyru/open-browser.vim/,,
https://github.com/salkin-mada/openscad.nvim/,HEAD,
https://github.com/nvim-orgmode/orgmode/,,
https://github.com/nyoom-engineering/oxocarbon.nvim/,HEAD,
https://github.com/vuki656/package-info.nvim/,,