Sublime Forum

Tab to space behavior on copy-paste

#1

Hi, all.
I’ve the following problem. Usually it’s very convenient to replace tabs with spaces, so I keep according option enabled. But when I do some work with tabular formats an editor spoils markup. On copy-paste operations, paste step completely removes tabs and replaces it with spaces – and columns become shifted. Moreover changing line order with ctrl+shift+(up|down) also works the same way, which made me crazy: I’ve just reordered lines and my csv-processing script broke. It took me some time to understand that line reordeing swallowed all tabs.

p.s. Pleas, don’t tell me that csv-processing should be made with excel. It is not possible to make each such operations in excel: lines are just too long to load them into table processor, and of course sublime is more convenient than excel for some table operations regarding regexps.

1 Like

How to replace spaces with tabs when pasting on a view with translate_tabs_to_spaces set to false?
#2

It is just a problem of settings your preference: in the status bar, you can see Tab size: click on it and uncheck “indent using space”.

It should also be possible to have settings specific to a type of file so that you always have the correct behavior when you open a csv file: in a csv.sublime-settings you should be able to add settings like “translate_tabs_to_spaces”: false , but maybe you also need a csv.tmLanguage to have the settings correctly associted with the type of file.

1 Like