Search code examples
vimterminalfrontendbrowser-sync

CSS file in vim buffer gets flooded with text on save when browser-sync is in use


Upon saving my index.css whilst

browser-sync --logLevel silent start --server --files index.css

is running in the background results in my vim to go from looking like this:

this

to getting flooded and looking like this:

this.

If I try selecting the text in visual mode, it disappears. Also the command :redraw! fixed it until I save it again.

Vim version 8.2.3582


Solution

  • I am not sure about the how and why but the following worked for me;

    browser-sync start --logLevel silent -b "${BROWSER-NAME}" --server --files "${FILE_NAME}" 2>/dev/null 1>/dev/null &'

    What it does is redirects the output to the /dev/null