I know there are a lot of posts about this, but I couldn´t get it to work.
I use tabs for coding. Is there a way, to convert always spaces to tabs? I.e. on open and on S
You can do replace tabs with spaces in all project files by:
Ctrl+Shif+F^\A(.*)$Your dirReplace by \1
This will cause all project files to be opened, with their buffer marked as dirty. With this, you can now optionally enable these next Sublime Text settings, to trim all files trailing white space and ensure a new line at the end of every file.
You can enabled these settings by going on the menu Preferences -> Settings and adding these contents to your settings file:
"ensure_newline_at_eof_on_save": true,"trim_trailing_white_space_on_save": true,View -> Show Console (Ctrl+`) and run the command:
import threading; threading.Thread( args=(set(),), target=lambda counterset: [ (view.run_command( "expand_tabs", {"set_translate_tabs": True} ), print( "Processing {:>5} view of {:>5}, view id {} {}".format( len( counterset ) + 1, len( window.views() ), view.id(), ( "Finished converting!" if len( counterset ) > len( window.views() ) - 2 else "" ) ) ), counterset.add( len( counterset ) ) ) for view in window.views() ] ).start()File -> Save All