diff --git a/neovim/nvim.nix b/neovim/nvim.nix index a6eeb64c..21a55d60 100644 --- a/neovim/nvim.nix +++ b/neovim/nvim.nix @@ -299,7 +299,7 @@ in rec { "%" = "[[vsplit]]"; "gh" = "[[Octo actions]]"; "\"" = ''[["+]]''; - "c" = "[[ChatGPT]]"; + "" = "[[ChatGPT]]"; "dr" = "[[RustLsp debuggables]]"; # "ee" = "[[Rest run]]"; "ee" = "[[RestNvim]]"; @@ -554,8 +554,17 @@ in rec { -- returns a table (see below) command = {"zsh"} }, - sqlite = { - + sql = { + command = function(meta) + local db = os.getenv("DATABASE_PATH") + if db == nil then + local filename = vim.api.nvim_buf_get_name(meta.current_bufnr) + return { '${pkgs.sqlite}/bin/sqlite3', ':memory:', filename} + else + return { '${pkgs.sqlite}/bin/sqlite3', db } + end + + end } }, -- How the repl window will be displayed