plugin: Codeshot.nvim
I have verified that this feature request has not been made before
- [x] I have checked the issues tab, and did not find a similar feature request. I understand that my issue will be closed if it is a duplicate.
Feature Type
New Plugin
Feature description
nvf seemingly does not have any plugin designed for screenshotting code, and amongst those I've seen codeshot.nvim seems to be the best integrated into the neovim ecosystem
Alternatives
I have used codesnap.nvim for a while now, and it also works okay.
Additional Context
The neovim plugin repository is like 40% Nix code, so I imagine integrating it wouldn't be too difficult :p
I was unable to get it working adding it manually on my Macbook
lazy.plugins."codeshot-nvim".package = inputs.codeshot-nvim.packages.${pkgs.system}.default.overrideAttrs (old: {
pname = "codeshot-nvim";
});
error: Cannot build '/nix/store/k7pk1sjbyjpwkhzzn8mzazag2si41xz3-lua5.1-codeshot.nvim-dev.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/lq7wjnfbgsjfzd29b0zdga813q6kpic8-lua5.1-codeshot.nvim-dev
Last 24 log lines:
> structuredAttrs is enabled
> Sourcing luarocks-move-data-hook.sh
> Using luarocksMoveDataHook
> Sourcing vim-command-check-hook.sh
> Using vimCommandCheckHook
> Sourcing vim-gen-doc-hook
> Sourcing neovim-require-check-hook.sh
> Using neovimRequireCheckHook
> Running phase: unpackPhase
> unpacking source archive /nix/store/y0qminabamp6hny1cadyppgyff2mkf6r-source
> source root is source
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Running phase: buildPhase
> Running phase: installPhase
>
> codeshot.nvim scm-1 depends on lua >= 5.1 (5.1-1 provided by VM)
> No existing manifest. Attempting to rebuild...
> codeshot.nvim scm-1 is now installed in /nix/store/lq7wjnfbgsjfzd29b0zdga813q6kpic8-lua5.1-codeshot.nvim-dev
>
> Running phase: fixupPhase
> Executing luarocksMoveDataHook
> cp: cannot stat '/nix/store/lq7wjnfbgsjfzd29b0zdga813q6kpic8-lua5.1-codeshot.nvim-dev/codeshot-nvim-dev-rocks/codeshot-nvim/scm-1/.': No such file or directory
For full logs, run:
nix log /nix/store/k7pk1sjbyjpwkhzzn8mzazag2si41xz3-lua5.1-codeshot.nvim-dev.drv
error: Cannot build '/nix/store/zw8qk7df26n5h944c7cydl07r89mk21v-mnw-configDir.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/yd9n06wszs9ww49ps2798fkr712liarf-mnw-configDir
error: Cannot build '/nix/store/mx8d68c9a995m4x236zgb36mcai6nr6i-mnw-0.11.3.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/ycj3gxpny2n4khd3m3lxisl7252r70ri-mnw-0.11.3
error: Cannot build '/nix/store/f2ynj7qgfcdixw60sgrysynvxkr77cji-nvf-with-helpers.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/044vrgbiqhmn8bv872f740wqv1mjp1gh-nvf-with-helpers
Codesnap I can get working, as it exists on nixpkgs
lazy.plugins."codesnap.nvim".package = pkgs.vimPlugins.codesnap-nvim;
The problem with using this plugin from an input appears to be that it depends on some Rust libraries. This is an odd but now somewhat common pattern in Neovim plugins that I've come to dislike. Currently there are two ways you can approach this:
- Use it from
pkgs.vimPluginssince it is already packaged with the appropriate libraries in Nixpkgs - PR NVF with a new module, package codesnap similar to how we package blink.cmp.
The choice is yours.
Hey there, I'm the creator of codeshot.nvim. I'm really sorry about the issue of relying on Rust libraries. Until now, it has been the best way to provide an efficient and complete solution.
On the other hand, I forgot to make the PR to officially integrate the plugin, although I think I would first have to integrate the binary separately. In the meantime, I have a cachix that can help a lot in reducing build times.
nix.settings = {
builders-use-substitutes = true;
extra-substituters = [ "https://sss.cachix.org" ];
extra-trusted-public-keys = [ "sss.cachix.org-1:YI2JMG95LEu62PC7VMz75N7bypEdUz9Z/Il1hkGH4AA=" ];
};
We have other plugins that vendor their own binaries, please see avante.nvim and blink.cmp packages. I'm happy to help guide a PR to add codeshot.