开发者

Reuse last externally executed command in VIM

开发者 https://www.devze.com 2023-01-12 06:53 出处:网络
In VIM, I want to execute a command (like :!mkdir src/main/scala/xxx) Then, I want to also make a sub开发者_运维问答directory of the just created directory.

In VIM, I want to execute a command (like :!mkdir src/main/scala/xxx) Then, I want to also make a sub开发者_运维问答directory 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).


Can't you just hit : then the up arrow to go through your command history?


:!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.

0

精彩评论

暂无评论...
验证码 换一张
取 消