aboutsummaryrefslogtreecommitdiff
path: root/doc/regex_escape.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/regex_escape.txt')
-rw-r--r--doc/regex_escape.txt63
1 files changed, 63 insertions, 0 deletions
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*
+
+ *<Plug>(RegexEscape)*
+The normal and visual mode mapping targets are both named
+|<Plug>(RegexEscape)|. There are no default key mappings; you should define
+one yourself in your |vimrc|. For example:
+>
+ nmap <Leader>\ <Plug>(ReplaceOperator)
+ xmap <Leader>\ <Plug>(ReplaceOperator)
+<
+AUTHOR *regex_escape-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *regex_escape-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+ vim:tw=78:ts=8:ft=help:norl: