Skip to content

Keeping the cursor in the current position #200

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

You must be logged in to vote

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

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@navlalli
Comment options

@rinpatch
Comment options

@navlalli
Comment options

@rinpatch
Comment options

@michaelb
Comment options

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