From 57608dd23b6be224c74a03f2d27112b9b08f4816 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 29 Dec 2018 22:03:42 +1300 Subject: First version --- doc/regex_escape.txt | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 doc/regex_escape.txt (limited to 'doc') diff --git a/doc/regex_escape.txt b/doc/regex_escape.txt new file mode 100644 index 0000000..1377fcd --- /dev/null +++ b/doc/regex_escape.txt @@ -0,0 +1,63 @@ +*regex_escape.txt* For Vim version 7.0 Last change: 2018 Dec 29 + +DESCRIPTION *regex_escape* + +This plugin provides normal and visual mode mapping targets to insert escaping +backslash characters before regular expression metacharacters for text +selected by a motion, as a quick way to put a literal string into a regular +expression context. + +It's useful generally as a shortcut, but the author particularly likes it for +keeping track of backslash-heavy expressions where counting gets tiresome. + +For example, in the default BRE mode, this string: > + foo * ^bar $\ baz \ quux +Becomes: > + foo \* \^bar \$\\ baz \\ quux + +OPTIONS *regex_escape-options* + + *b:regex_escape_flavor* +Set `b:regex_escape_flavor` to one of "bre", "ere", or "vim", to choose a +regex flavor for a particular buffer. It might be a good idea to set (and +clear) this in filetype plugins. + + *g:regex_escape_flavor* +Set `g:regex_escape_flavor` to one of "bre", "ere", or "vim", to choose a +default global regex flavor for any buffer where `b:regex_escape_flavor` is +not set. + +If neither of these options are set, "bre" is used. + +The ERE class includes / as a character, just because it's always the +delimiter in AWK, and so often (but not always) the delimiter in Perl. This +may mean that slash gets escaped unnecessarily in Perl patterns, and possibly +anywhere you use ERE outside of AWK. + +The Vim set assumes 'magic', just because the author never messes with that. +You might like to add e.g. "vim_magic", "vim_nomagic" etc classes if that +matters to you. + +REQUIREMENTS *regex_escape-requirements* + +This plugin only loads if 'compatible' is not set. + +MAPPINGS *regex_escape-mappings* + + *(RegexEscape)* +The normal and visual mode mapping targets are both named +|(RegexEscape)|. There are no default key mappings; you should define +one yourself in your |vimrc|. For example: +> + nmap \ (ReplaceOperator) + xmap \ (ReplaceOperator) +< +AUTHOR *regex_escape-author* + +Written and maintained by Tom Ryder . + +LICENSE *regex_escape-license* + +Licensed for distribution under the same terms as Vim itself (see |license|). + + vim:tw=78:ts=8:ft=help:norl: -- cgit v1.2.3