Skip to content

Instantly share code, notes, and snippets.

@irizwaririz
Created March 30, 2022 18:38
Show Gist options
  • Save irizwaririz/f78790471481b184b1e348e77226067d to your computer and use it in GitHub Desktop.
Save irizwaririz/f78790471481b184b1e348e77226067d to your computer and use it in GitHub Desktop.
Execute macro over visual range
xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>

function! ExecuteMacroOverVisualRange()
  echo "@".getcmdline()
  execute ":'<,'>normal @".nr2char(getchar())
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment