5 comments

[ 3.4 ms ] story [ 12.8 ms ] thread
sed 's/\s*$//g'
Funnily, that doesn't work as expected on OS X due to a rather old version of sed installed by default that doesn't support \s. Try the following instead:

  sed 's/[[:blank:]]*$//g'
I use the following two lines to highlight extra white spaces and clean them with a leader shortcut on vim.

    highlight ExtraWhitespace ctermbg=red guibg=red
    noremap <Leader>c :%s/\s\+$//g<CR>
Delete all trailing whitespace in vim:

  :%s/\s\+$//
Zero dependencies... Except nodejs, which on Debian has about 60 dependencies from memory.

this is the problem I have with the nodejs community.

I first learnt to write code using php. I still use php but that doesn't mean I don't also use shell scripts, lua, JavaScript, hell sometimes even Java.

Just because you can do something in nodejs, doesn't mean you should