Vim task
- write something "file1", "file2".... or
"uid1",
"uid2",
"uid3",
"uid4",
"uid5",
"uid6",
"uid7",
"uid8",
"uid9",
"uid10",
For such task do
:for i in range(1, 10) | put='uid'.i | endfor
//----loop logic ------|-loop-body---|--end--
/*
will write as
uid1
uid2
uid3 ....
*/
Rules The string literal in loop body has to single quoted The variable concatination (equivalent to '+' in other langs) : . (dot/period) any special symbol may need to escape like double quoutes example: to print the above in double quotes:
for i in range(1, 10) | put='\"uid'.i.'\",' | endfor
//--------------------| '\"uid'+i+''\"' ------ => "uid1",
/*
output:
"uid1",
"uid2",
"uid3",
....
*/