-
Firstly, fantastic plugin @michaelb ! I have defined a keymap in a .lua file which allows me to run the whole file by pressing F5:
I've been trying to set this keymap up so that the cursor remains at the current position when I use this shortcut (right now it jumps to the top of the file and Has anyone got an example of how to achieve this in a .lua file? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Something like
|
Beta Was this translation helpful? Give feedback.
Something like
:lua vim.keymap.set('n', '<F5>', ":let b:caret=winsaveview() <CR> | :%SnipRun <CR>| :call winrestview(b:caret) <CR>", {})
should do the trick (it does for me), though there may be better ways to express that in vimscript and I'm no expert