set listchar and trim trailing spaces