Search code examples
neovim

"press enter to continue" in neovim


i was trying to add this keybinding to neovim to integrate with zellij:

-- running go tests
vim.keymap.set("n", "<leader>rt", function()
    return ":!zellij run -d Down -n go-tests -- go test " .. vim.fn.expand("%:p:h") .. "<CR>"
end, { expr = true, silent = true })

but when i hit enter and close zellij pane i see that annoying "press enter to continue", is there any way to prevent this? any keymap options or so?


Solution

  • vim.keymap.set('n', '<leader>rt', function()
      return ':silent !zellij run -d Down -n go-tests -- go test ' .. vim.fn.expand '%:p:h' .. '<CR>'
    end, { expr = true, silent = true })
    

    I think putting silent in front of the command will work