Skip to content

Is there a way to dynamically select the display mode? #310

Answered by michaelb
fsiraj asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fsiraj
Comment options

@fsiraj
Comment options

Answer selected by fsiraj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants