Sublime Forum

Tabs and Spaces In Strings For Clean Formatting

#1

Hi,

I am doing some python coding in ST with a lot of dictionaries that have a lot of long strings. Is there a way to get the strings to line up nicely in sublime text for easy reading so that the tabs and spaces in the sublime text editor are not actually inserted into the strings. Here is an example:

cont_dict =
{
‘betaperp’ : {‘default’: None, ‘desc’: ‘® beta value to use in calculating amplitude variable A^2’, ‘type’:‘Real’},

            'bgen'          : {'default': True, 'desc': '''(L) if
             .true.=>generate initial beam particles, otherwise read input
             from FOR003.DAT (true)''', 'type': 'Logical'},
            
            'bunchcut'      : {'default': 1E6, 'desc': '(R) maximum time difference allowed between a particle and the reference particle [s] (1E6)', 'type': 'Real'},

            'bzfldprd'      : {'default': None,  'desc': '(R) Bz for solenoid at location of production plane (0.) This is used for output to file\
                                           for009.dat and for canonical angular momentum correction.', 'type': 'Real'},
            'dectrk'        : {False, '(L) if .true. => continue tracking daughter particle following decay', 'Logical'},
            'diagref'       : {False, '(L) if .true. => continue tracking daughter particle following decay'},
            'epsf'          : {0.05,  '(R) desired tolerance on fractional field variation, energy loss, and\
                                           multiple scattering per step', 'Real'},
0 Likes