In VIM, I want to execute a command (like :!mkdir src/main/scala/xxx
)
Then, I want to also make a subdirectory of the just created directory.
Can I have VIM retype the last used command and then I append the sub directory name to it
(So I can have :!mkdir scr/main/scala/xxx/yyy
without retyping the whole stuff).
views:
42answers:
2
+4
A:
Can't you just hit : then the up arrow to go through your command history?
GWW
2010-08-21 03:43:45
Or `:!` then up arrow to go through the commands that start with `!`
Dave Kirby
2010-08-21 20:42:58
+2
A:
:!mkdir test
:!!/test2
will do what you want, see :h :!. Citation from there:
Any '!' in {cmd} is replaced with the previous external command (see also 'cpoptions').
// Why don't you use -p
switch to mkdir
? mkdir -p test/test2/test3/...
will create directory with all its parents if they do not exist.
ZyX
2010-08-21 10:58:18