I want to save selected text in vim. I use command
How to write a short command instead of it, or mapping it to key mappings.
Here you go:
vnoremap <Leader>s :w! ~/save.txt <CR>
Just paste this into your
init.vim. This assumes you have the text highlighted and are currently in visual mode. Just hit
s and it will save the selection for you.