I want to use perl regular expressions on the vim command line. For example, to capitalize the words on the current line, you could type:
:s/(\w+)/\u$1/g
|
feedback
|
|
You can filter any line or range of lines through an external command in vim, using !. E.g., you can do:
which will filter the current line through that perl command. ( Here If you want to use vim's built in substitution patterns, the closest you'll come is to use vim's "very magic" option, \v, like so:
see | ||||
|
feedback
|
|
No, you can't use Perl regular expressions in that way. For help in learning the Vim equivalents for Perl regular expression components, see
However, you can use Perl as an external filter as explained by frabjous. You can also execute Perl commands within Vim using the Perl interface, if your Vim was compiled with the
| |||
|
feedback
|