Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- lua preserve function to neovim
- function _G.preserve(cmd)
- local cmd = string.format('keepjumps keeppatterns execute %q', cmd)
- local original_cursor = vim.fn.winsaveview()
- vim.api.nvim_command(cmd)
- vim.fn.winrestview(original_cursor)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement