Supprimer les lignes vides d’un fichier texte avec vi
.
:g/^$/d (1) (2) (3)
1 | g executes an Ex command on a pattern-matched text, search in a range (%g for instance, default to whole file). |
2 | The regex here is ^$ it matches lines that starts and ends with nothing in between. |
3 | d is the delete command |
More info about the 'power of g' here : https://vim.fandom.com/wiki/Power_of_g