Can I add an interval every 4 characters in vi?

Is it possible to add an interval every 4 characters in vi? And if so, what is a good google search term to learn to do such things?

+3
source share
1 answer

To add a space every 4 characters, you can use the following command (at least in VIM):

:% s / \ (.... \) / \ 1 / g

If you use Google "VIM Substitution", you should get some useful examples.

Example:

To add a space every 4 characters you could use

becomes

To a dd a spa ce e very 4 c hara cter s yo u co uld use 
+6
source

Source: https://habr.com/ru/post/1788907/


All Articles