-
In most cases the VirtualText is enough for me but in some cases when I need to copy things I like using Terminal. Is there a way I can create two different keymaps to use the two different display modes? What I'm picturing: vim.keymap.set('n', '<Leader>r', function() require'sniprun'.run(display_mode='VirtualText') end)
vim.keymap.set('n', '<Leader>R', function() require'sniprun'.run(display_mode='Terminal') end) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You have the right idea, just not the right syntax. the 'run()' api can take a 'config' table that updates the sniprun configuration, including (but not limited to) display modes I'll get back to you with the precise answer when I have some time in front of the computer. EDIT: the run() command takes no such argument, but the api.run_range() does:
and you get the idea. Getting start/end of selection in visual mode should not be a lot harder. Documentation for the sniprun API: https://michaelb.github.io/sniprun/sources/README.html#api |
Beta Was this translation helpful? Give feedback.
You have the right idea, just not the right syntax. the 'run()' api can take a 'config' table that updates the sniprun configuration, including (but not limited to) display modes
I'll get back to you with the precise answer when I have some time in front of the computer.
EDIT: the run() command takes no such argument, but the api.run_range() does:
lua vim.keymap.set('n', '<Leader>R', function() require'sniprun.api'.run_range(vim.api.nvim_win_get_cursor(0)[1], vim.api.nvim_win_get_cursor(0)[1], vim.bo.filetype, {display= {"Terminal"}}) end)
and you get the idea. Getting start/end of selection in visual mode should not be a lot harder.
Documentation for the sniprun API: https://michaelb.git…