Created
February 3, 2022 16:13
-
-
Save PeterRincker/7aba145d3c93b94ce97862ec2bcbd7ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" keep star from jumping | |
nnoremap <script> <silent> <expr> * <SID>JustHighlight('*') | |
function! s:JustHighlight(cmd) | |
" still messes up ' mark | |
let s:JustHighlight_view = winsaveview() | |
augroup just_hightlight | |
autocmd! | |
autocmd CursorMoved <buffer> | |
\ execute "autocmd! just_hightlight" | | |
\ keepjumps call winrestview(s:JustHighlight_view) | |
augroup END | |
call timer_start(1, {-> execute('silent doautocmd CursorMoved')}) | |
return a:cmd | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment