9

If you create a file using gedit, which is configured to insert 4 spaces each time you press tab. Then for some reason you edit the file and some tabs get inserted (i.e. While editing on Windows). How can you replace those tabs back to spaces using gedit?

11

To do that you just need to use the replace form and search for: \t (backslash followed by t) then replace it with four spaces.

Source

  • well, not in my gedit :) – Jacob Vlijm Sep 17 '14 at 21:44
  • I think I had to change settings in three places. Edit, preferences, editor, indentation. And preferences files when saved change tabs to spaces. And under project properties, indentation. – oldfred Sep 17 '14 at 22:52
  • @oldfred I see, then I'd prefer my good old python :) – Jacob Vlijm Sep 18 '14 at 18:53
  • Those are one time changes. And if you have tabs the change on save mode converts tabs to spaces automatically. – oldfred Sep 18 '14 at 19:16
4

You can highlight, copy and paste a 'tab' from your file into the search and replace fields to achieve this in either direction tabs>spaces or spaces>tabs.

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.