mappings.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. local mappings_utils = require('utils.mappings_utils')
  2. local map = mappings_utils.map
  3. local cmd = vim.cmd
  4. -- function _G.set_js_runner(runner)
  5. -- cmd[[
  6. -- let test#javascript#runner=
  7. -- ]]
  8. -- vim.g['test#javascript#runner'] = runner
  9. -- end
  10. -- map('n', 't<C-n>', ':TestNearest<CR>', { noremap = false })
  11. -- map('n', 't<C-f>', ':TestFile<CR>', { noremap = false })
  12. -- map('n', 't<C-l>', ':TestLast<CR>', { noremap = false })
  13. -- map('n', 't<C-d>', ':call DebugNearest<CR>', { noremap = false })
  14. -- map('n', 't<C-s>', ':TestSuite<CR>', { noremap = false })
  15. -- map('n', 't<C-g>', ':TestVisit<CR>', { noremap = false })
  16. ncvim.add_mappings {
  17. {
  18. mode = 'n',
  19. key_string = 'tn',
  20. command = ':TestNearest<CR>',
  21. options = { noremap = false },
  22. },
  23. {
  24. mode = 'n',
  25. key_string = 'tf',
  26. command = ':TestFile<CR>',
  27. options = { noremap = false },
  28. },
  29. {
  30. mode = 'n',
  31. key_string = 'tl',
  32. command = ':TestLast<CR>',
  33. options = { noremap = false },
  34. },
  35. {
  36. mode = 'n',
  37. key_string = 'tdn',
  38. command = ':call DebugNearest()<CR>',
  39. options = { noremap = false },
  40. },
  41. {
  42. mode = 'n',
  43. key_string = 'tdl',
  44. command = ':call DebugLast()<CR>',
  45. options = { noremap = false },
  46. },
  47. {
  48. mode = 'n',
  49. key_string = 'ts',
  50. command = ':TestSuite<CR>',
  51. options = { noremap = false },
  52. },
  53. {
  54. mode = 'n',
  55. key_string = 'tg',
  56. command = ':TestVisit<CR>',
  57. options = { noremap = false },
  58. },
  59. {
  60. mode = 'n',
  61. key_string = 'tcjw',
  62. command = ':let g:test#javascript#runner="webdriverio"<CR>',
  63. options = { noremap = false },
  64. },
  65. {
  66. mode = 'n',
  67. key_string = 'tcjm',
  68. command = ':let g:test#javascript#runner="mocha"<CR>',
  69. options = { noremap = false },
  70. },
  71. {
  72. mode = 'n',
  73. key_string = 'tcjj',
  74. command = ':let g:test#javascript#runner="jest"<CR>',
  75. options = { noremap = false },
  76. },
  77. {
  78. mode = 'n',
  79. key_string = 'tsj',
  80. command = ':echo g:test#javascript#runner<CR>',
  81. options = { noremap = false },
  82. },
  83. }
  84. -- map('n', 'tcjw', ":lua set_js_runner('webdriverio')<CR>", { noremap = false })
  85. -- map('n', 'tcjm', ":lua set_js_runner('mocha')<CR>", { noremap = false })
  86. -- map('n', 't<C-n>', ':lua require("neotest").run.run()<CR>', { noremap = false })
  87. -- map('n', 't<C-f>', ':lua require("neotest").run.run(vim.fn.expand("%"))<CR>', { noremap = false })
  88. -- map('n', 't<C-d>', ':lua require("neotest").run.run({ strategy = "dap" })<CR>', { noremap = false })
  89. -- map('n', 't<C-l>', ':lua require("neotest").run.run_last()<CR>', { noremap = false })
  90. -- map('n', 't<C-s>', ':lua require("neotest").summary.toggle()<CR>', { noremap = false })
  91. -- map('n', 't<C-t>', ':lua require("neotest").output_panel.toggle()<CR>', { noremap = false })