1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-07-02 20:09:26 +00:00

[neovim] Add commands and keymaps to Neotest

This commit is contained in:
2024-02-04 17:55:49 +01:00
parent 6bd5f85550
commit b80f54b07c
3 changed files with 47 additions and 7 deletions

View File

@ -138,11 +138,25 @@ keymap(
vim.tbl_extend("force", opts, { desc = "Format the current buffer or selection" })
)
-- Neotest
keymap(
"n",
"<leader>tr",
"<cmd>RunTest<cr>",
vim.tbl_extend("force", opts, { desc = "Run test on the current function" })
)
keymap(
"n",
"<leader>tf",
"<cmd>RunTestFile<cr>",
vim.tbl_extend("force", opts, { desc = "Run tests on the current file" })
)
-- Better paste
keymap("v", "p", "P", vim.tbl_extend("force", opts, { desc = "Paste" }))
-- Press jk fast to enter
keymap("i", "jk", "<ESC>", vim.tbl_extend("force", opts, { desc = "Enter in insert mode" }))
-- Press jk fast to exit insert mode
keymap("i", "jk", "<ESC>", vim.tbl_extend("force", opts, { desc = "Exit insert mode" }))
-- Stay in indent mode
keymap("v", "<", "<gv", opts)