Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KevinLiebergen/30df96bf24581586e50a829d6c1b76b5 to your computer and use it in GitHub Desktop.
Save KevinLiebergen/30df96bf24581586e50a829d6c1b76b5 to your computer and use it in GitHub Desktop.
Sustituir desde vim varias lineas en blanco por una sola
2 modos diferentes:
Sustituye en todo el fichero (:%s`) 3 o más saltos de línea (`\n\n\n\+`) por 2 (`\r\r`) y en la línea actual (`/g`), separado por `/`.
:%s/\n\n\n\+/\r\r/g
Ejecutando el comando cat al propio fichero con el parámetro -s (Suppress repeared empty output lines)
:%!cat -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment