I am using the Sublime Text 3 beta on Mac OS X 10.8.4. I copied some text from somewhere and I want to paste it into Sublime exactly as it is but Sublime seems to be converting tab characters to spaces. What can I do to prevent it from doing this?

Yes, I am sure that the text I copied has actual tab characters. I can see them if I inspect the text in hexdump or TextEdit.


I did some experimenting and found out that I can paste the text verbatim by disabling the "Indent Using Spaces" command under View -> Indentation.

This solves my problem but I don't like to have that feature disabled all the time. What I am trying to do is somewhat unusual. Usually, I like to have it enabled to prevent me from accidentally inserting tab characters into what I am working on.

For that reason, I will see if anyone here comes up with a better solution, and only accept my answer if I don't find anything within a week or so. I am looking for a way to paste text verbatim just one time, without having to change a setting that affects how my tab key works.

| improve this answer | |

If you go into Preferences -> Key Bindings -> User,

I believe that you have to switch the paste and paste_and_indent, like this:

    { "keys": ["command+v"], "command": "paste_and_indent" },
    { "keys": ["command+shift+v"], "command": "paste" }
| improve this answer | |
  • I tried that and it didn't help. Even with the key bindings all set to their defaults, the paste_and_indent command pastes the text, possibly indented, but still with tab characters replaced with spaces. – Elias Zamaria Aug 5 '13 at 18:13
  • Would the Convert Indentation to Tabs button, as seen in this answer solve your issue? – sameetandpotatoes Aug 5 '13 at 18:19
  • I tried that and it didn't do anything. AFAIK, that button just converts spaces at the beginning of a line to tabs. I am trying to paste some CSV-like data with some tabs in the middle of a line. – Elias Zamaria Aug 5 '13 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.