Skip to content

Commit

Permalink
document bashs globstar setting
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Sep 22, 2023
1 parent 97ac19d commit 84309ec
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion runtime/doc/editing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
is to use "path\[[]abc]", this matches the file "path\[abc]".

*starstar-wildcard*
Expanding "**" is possible on Unix, Win32, macOS and a few other systems.
Expanding "**" is possible on Unix, Win32, macOS and a few other systems (but it
may depend on your shell setting. It's known to work correctly for zsh, for
bash you need to configure it specifically |bash-starstar-wildcard|)
This allows searching a directory tree. This goes up to 100 directories deep.
Note there are some commands where this works slightly differently, see
|file-searching|.
Expand All @@ -407,6 +409,18 @@ Note that the path with "/sys" is included because it does not need to match
"/inc". Thus it's like matching "/usr/inc*/*/*...", not
"/usr/inc*/inc*/inc*".

*bash-starstar-wildcard*
Bash supports expansion of the "**" pattern only, when the globstar setting
is enabled in your bash configuration file (typically .bashrc). But this
requires at least bash version 4. To make filename expansion in Vim using the
"**" pattern work when you are using the bash shell, add the following setting
to your .bashrc file: >
shopt -s globstar
Now that bash is prepared to expand the ** pattern, we need to tell Vim to use
and interactive shell, whenever it needs to expand the ** pattern, so that it
will source your bashrc file. To do set, set the following: >
set shellcmdflag=-ic
<
*backtick-expansion* *`-expansion*
On Unix and a few other systems you can also use backticks for the file name
argument, for example: >
Expand Down

0 comments on commit 84309ec

Please sign in to comment.