From ce3c0bcc2e07f98845a925342cadaaa882d40f43 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 8 Sep 2023 02:40:58 -0500 Subject: [PATCH] feat(nvim): add run command for nix filetypes --- dots/.config/nvim/after/ftplugin/nix.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) 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, +})