Skip to content

Commit

Permalink
vimPlugins.openscad-nvim: init at 2022-04-15
Browse files Browse the repository at this point in the history
  • Loading branch information
traxys committed Mar 20, 2023
1 parent e32f3c7 commit f58a0dc
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkgs/applications/editors/vim/plugins/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
19 changes: 19 additions & 0 deletions pkgs/applications/editors/vim/plugins/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
, git
, gnome
, himalaya
, htop
, jq
, khard
, languagetool
, llvmPackages
, meson
, nim
, nodePackages
, openscad
, pandoc
, parinfer-rust
, ripgrep
Expand All @@ -50,6 +52,7 @@
, nodejs
, xdotool
, xorg
, zathura
, zsh

# command-t dependencies
Expand Down Expand Up @@ -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 ])) ];
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions pkgs/applications/editors/vim/plugins/vim-plugin-names
Original file line number Diff line number Diff line change
Expand Up @@ -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/,,
Expand Down

0 comments on commit f58a0dc

Please sign in to comment.