Add function to toggle between spaces and tabs