Suppose, I want to wrap a single word with braces in normal mode using keyboard map (say <F5>), I could add the following mapping
:nnoremap <F5> i{<Esc>ea}<Esc>
But, now I want to extend this for visual mode, where I can select some text and wrap it with braces the same way. How do I achieve this?