/
ArgsAndMore.txt
149 lines (120 loc) · 5.63 KB
/
ArgsAndMore.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
*ArgsAndMore.txt* Apply commands to multiple buffers and manage the argument list.
ARGS AND MORE by Ingo Karkat
*ArgsAndMore.vim*
description |ArgsAndMore-description|
usage |ArgsAndMore-usage|
installation |ArgsAndMore-installation|
integration |ArgsAndMore-integration|
limitations |ArgsAndMore-limitations|
known problems |ArgsAndMore-known-problems|
todo |ArgsAndMore-todo|
history |ArgsAndMore-history|
==============================================================================
DESCRIPTION *ArgsAndMore-description*
This plugin supports you with batch processing many files by extending the
built-in |:windo|, |:argdo|, etc. commands. You can filter the argument list,
add files _not_ matching a pattern, convert between arguments and quickfix
list, and apply arbitrary Ex commands (also partially) via |:Argdo|, then
analyze any errors and retry on an argument list where the successfully
processed arguments have been removed.
SEE ALSO *
RELATED WORKS *
- The :ArgsNegated command was inspired by the following Stack Overflow
question:
http://stackoverflow.com/questions/11547662/how-can-i-negate-a-glob-in-vim
==============================================================================
USAGE *ArgsAndMore-usage*
*:Windo*
:Windo {cmd} Execute {cmd} in each window, then return back to the
original one.
*:Winbufdo*
:Winbufdo {cmd} Execute {cmd} in each different buffer shown in one of
the windows in the current tab page (once per buffer),
then return back to the original one.
*:Tabdo*
:Tabdo {cmd} Execute {cmd} once in each tab page, then return back
to the original one.
*:Tabwindo*
:Tabwindo {cmd} Execute {cmd} in each open window on each tab page,
then return back to the original one.
*:Argdo*
:Argdo {cmd} Execute {cmd} for each file in the argument list, then
return back to the original file and argument.
:[range]Argdo {cmd} Execute {cmd} for the [range] of indices from the
argument list, then return back to the original file
and argument.
For example, to execute {cmd} on the remaining
arguments, use :.,$Argdo {cmd}
In contrast to |:argdo|, this also avoids the
|hit-enter| prompt (all files will be processed
without further interaction from you), and an error
summary will be printed.
To work on the errors / arguments with errors, you can
use |:ArgdoErrors| and |:ArgdoDeleteSuccessful|.
*:ArgdoErrors*
:ArgdoErrors List all error messages that occurred during the last
|:Argdo| command, and for each unique error, print the
argument number and filespec.
*:ArgdoDeleteSuccessful*
:ArgdoDeleteSuccessful Delete those arguments from the argument list that
didn't cause any error messages during the last
|:Argdo| command.
*:ArgsFilter*
:ArgsFilter {expr} Apply the |filter()| of {expr} to the argument list,
and keep only those where {expr} yields true. This
allows you to |:argdelete| multiple arguments at once
and to delete without specifying the full filename.
*:ArgsNegated*
:ArgsNegated[!] {arglist}
Define all files except {arglist} as the new argument
list and edit the first one.
*:ArgsList*
:ArgsList[!] List each argument number and filespec in a neat list
(not just one after the other as |:args|). With [!],
expand all arguments to absolute filespecs.
:ArgsList[!] {glob} List each argument number and filespec that matches
(with [!]: does not match) {glob} in a neat list.
Matching and printing is done to the full filespec.
*:ArgsToQuickfix*
:ArgsToQuickfix Show all arguments as a quickfix list.
*:CListToArgs* *:CListToArgsAdd*
:CListToArgs Convert the files in the quickfix list to arguments.
:[count]CListToArgsAdd
*:LListToArgs* *:LListToArgsAdd*
:LListToArgs Convert the files in the window's location list to
:[count]LListToArgsAdd arguments.
==============================================================================
INSTALLATION *ArgsAndMore-installation*
This script is packaged as a |vimball|. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vmb.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the |:UseVimball| command. >
vim ArgsAndMore*.vmb.gz
:so %
To uninstall, use the |:RmVimball| command.
DEPENDENCIES *ArgsAndMore-dependencies*
- Requires Vim 7.0 or higher.
==============================================================================
INTEGRATION *ArgsAndMore-integration*
==============================================================================
LIMITATIONS *ArgsAndMore-limitations*
KNOWN PROBLEMS *ArgsAndMore-known-problems*
TODO *ArgsAndMore-todo*
IDEAS *ArgsAndMore-ideas*
==============================================================================
HISTORY *ArgsAndMore-history*
1.01 27-Aug-2012
- Do not use <f-args> because of its unescaping behavior.
- FIX: "E480: No match" on :ArgsNegated with ../other/path relative argument;
need to issue a dummy :chdir to convert relative args before doing the
:argdelete.
1.00 30-Jul-2012
First published version.
0.01 26-Aug-2008
Started development.
==============================================================================
Copyright: (C) 2012 Ingo Karkat
The VIM LICENSE applies to this script; see |copyright|.
Maintainer: Ingo Karkat <ingo@karkat.de>
==============================================================================
vim:tw=78:ts=8:ft=help:norl: