diff --git a/dots/.config/nvim/after/ftplugin/nix.lua b/dots/.config/nvim/after/ftplugin/nix.lua index c213fb07..e5954a58 100644 --- a/dots/.config/nvim/after/ftplugin/nix.lua +++ b/dots/.config/nvim/after/ftplugin/nix.lua @@ -4,3 +4,14 @@ opt_local.tabstop = 2 opt_local.shiftwidth = 2 vim.api.nvim_buf_set_option(0, "commentstring", "# %s") + +vim.keymap.set("n", "fr", function () + local cmd = { + "nix-instantiate", + "--eval", + vim.api.nvim_buf_get_name(0) + } + require("toggleterm").exec(table.concat(cmd, " ")) +end, { + buffer = true, +})