LnL7 / vim-nix

Vim configuration files for Nix http://nixos.org/nix
MIT License
287 stars 26 forks source link

Add command :NixShell #48

Open Julow opened 1 year ago

Julow commented 1 year ago

Add a command to call 'nix-shell' and then update the editor's environment as if it was inside the new shell.

It's sometimes useful to fire up a nix-shell just to download a package for using it once. It's annoying however when it's a library or any other dependency of ':make', which can't be called from inside the shell.

Example:

:NixShell -p hello
:term hello

There's no rollback command but it could be written if it's ever needed. Calling the commande several times will nest environments the same way as opening a shell inside a shell.

Ma27 commented 11 months ago

Isn't this effectively what https://github.com/figsoda/nix-develop.nvim does?

Julow commented 11 months ago

It's similar with a different API. That other plugin doesn't work with Vim.