Skip to content

Instantly share code, notes, and snippets.

@mattn
Last active December 14, 2015 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/5079965 to your computer and use it in GitHub Desktop.
Save mattn/5079965 to your computer and use it in GitHub Desktop.
diff -r ad7bbe9ea65b runtime/doc/various.txt
--- a/runtime/doc/various.txt Tue Feb 26 22:54:11 2013 +0100
+++ b/runtime/doc/various.txt Mon Mar 04 13:46:06 2013 +0900
@@ -220,7 +220,16 @@
{not in Vi}
{not available when |+ex_extra| feature was disabled
at compile time}
+ *:now* *:nowild*
+:now[ild] {command}
+ Execute {command} with 'wildignore' option disabled.
+ This will be useful to ignore 'wildignroe' option
+ raise error. For example, it can avoid to escape
+ filenames to open with |`=| : >
+ :set wildignore=*.tmp
+ :nowild e `=tempname()`
+<
*:sh* *:shell* *E371*
:sh[ell] This command starts a shell. When the shell exits
(after the "exit" command) you return to Vim. The
diff -r ad7bbe9ea65b src/ex_cmds.h
--- a/src/ex_cmds.h Tue Feb 26 22:54:11 2013 +0100
+++ b/src/ex_cmds.h Mon Mar 04 13:46:06 2013 +0900
@@ -655,6 +655,8 @@
RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_normal, "normal", ex_normal,
RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN),
+EX(CMD_nowild, "nowild", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_number, "number", ex_print,
RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
EX(CMD_nunmap, "nunmap", ex_unmap,
diff -r ad7bbe9ea65b src/ex_docmd.c
--- a/src/ex_docmd.c Tue Feb 26 22:54:11 2013 +0100
+++ b/src/ex_docmd.c Mon Mar 04 13:46:06 2013 +0900
@@ -1864,7 +1864,13 @@
#endif
continue;
- case 'n': if (!checkforcmd(&ea.cmd, "noautocmd", 3))
+ case 'n': if (checkforcmd(&ea.cmd, "nowild", 3))
+ {
+ cmdmod.nowild = TRUE;
+ continue;
+ }
+
+ if (!checkforcmd(&ea.cmd, "noautocmd", 3))
break;
#ifdef FEAT_AUTOCMD
if (cmdmod.save_ei == NULL)
@@ -1876,6 +1882,7 @@
(char_u *)"all", OPT_FREE, SID_NONE);
}
#endif
+ cmdmod.nowild = FALSE;
continue;
case 'r': if (!checkforcmd(&ea.cmd, "rightbelow", 6))
@@ -3086,6 +3093,7 @@
{"leftabove", 5, FALSE},
{"lockmarks", 3, FALSE},
{"noautocmd", 3, FALSE},
+ {"nowild", 3, FALSE},
{"rightbelow", 6, FALSE},
{"sandbox", 3, FALSE},
{"silent", 3, FALSE},
diff -r ad7bbe9ea65b src/misc1.c
--- a/src/misc1.c Tue Feb 26 22:54:11 2013 +0100
+++ b/src/misc1.c Mon Mar 04 13:46:06 2013 +0900
@@ -9268,7 +9268,7 @@
/*
* Remove names that match 'wildignore'.
*/
- if (*p_wig)
+ if (*p_wig && !cmdmod.nowild)
{
char_u *ffname;
diff -r ad7bbe9ea65b src/structs.h
--- a/src/structs.h Tue Feb 26 22:54:11 2013 +0100
+++ b/src/structs.h Mon Mar 04 13:46:06 2013 +0900
@@ -517,6 +517,7 @@
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
int confirm; /* TRUE to invoke yes/no dialog */
# endif
+ int nowild; /* TRUE when ":nowild" was used */
int keepalt; /* TRUE when ":keepalt" was used */
int keepmarks; /* TRUE when ":keepmarks" was used */
int keepjumps; /* TRUE when ":keepjumps" was used */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment