Tags: apiedit, Visual edit
Tags: apiedit, sourceedit, Visual edit
 
Line 8: Line 8:
   
 
<nowiki>%g/\<\w\+\>/ y A | exe 'silent !mkdir '. shellescape(substitute(substitute(@a, '\n\+\s*', '', ''), '\s*\n\+', '', '')) | let @a ="" </nowiki>
 
<nowiki>%g/\<\w\+\>/ y A | exe 'silent !mkdir '. shellescape(substitute(substitute(@a, '\n\+\s*', '', ''), '\s*\n\+', '', '')) | let @a ="" </nowiki>
  +
  +
==Comments==
  +
This is not much use without a short example and a reason why Vim should be used to create directories. Why not edit a script to do the work and run it from the shell? [[User:JohnBeckett|JohnBeckett]] ([[User talk:JohnBeckett|talk]]) 00:00, June 6, 2016 (UTC)

Latest revision as of 00:00, 6 June 2016

You may need to create directories from a text file wherein each line defines a category from which a directory should be created.

So here is the command to use :

%g/\<\w\+\>/ y A | exe ' !mkdir '. shellescape(substitute(substitute(@a, '\n\+\s*', '', ''), '\s*\n\+', '', '')) | let @a =""

and the silent version :

%g/\<\w\+\>/ y A | exe 'silent !mkdir '. shellescape(substitute(substitute(@a, '\n\+\s*', '', ''), '\s*\n\+', '', '')) | let @a =""

Comments[edit | edit source]

This is not much use without a short example and a reason why Vim should be used to create directories. Why not edit a script to do the work and run it from the shell? JohnBeckett (talk) 00:00, June 6, 2016 (UTC)

Community content is available under CC-BY-SA unless otherwise noted.