In my Vim setup I'd like to add a configuration that runs a shell command with a certain mapping. Is there any possible way to do this in Vimscript?
vim
has a a system()
function:
:call system('date')
I do this with traditional vi, so I assume it would work with vim as well.
In my .exrc I have:
map ^_ !}fmt 71 72^M
(That's a ^_
entered by typing ctrl-V ctrl-_, and a ^M
entered by typing ctrl-V ctrl-M
When I hit ctrl-_ in vi, it reformats my current line to 72 characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With