How can I stay tab-free in Geany on Ubuntu?

Question:

How can I stay tab free in Geany on Ubuntu?

When I am coding in Python, tabs have always annoyed me. And the TAB is invisible. So strange.

When I open my code by gedit, those TABs are visible.

Asked By: Josh Morrison

||

Answers:

You are looking for ‘soft tabs’

http://www.geany.org/manual/dev/index.html#editor-indentation-preferences

Edit > Preferences > Editor > Indentation > Type > Spaces

After changing the setting, close and reopen the file.

To apply the tab settings to every document in the current session, also click:
Project->Apply Default.

Answered By: dting

DTing is right but on thing to remember:
You have to close all files (tabs) in Geany and open them up again to have the new settings work in each file. It took me days to figure out that I not only have to close geany and open it up again but that I also have to re-open each file seperately.

Answered By: Martin Fake

I know I’m a bit late on this, but hopefully this answer might help someone else. With Geany closed, edit ~/.config/geany/geany.conf with some other editor, changing the lines:

use_tab_to_indent=true
indent_type=1

to:

use_tab_to_indent=false
indent_type=0

and the settings will “take”.

Answered By: Emmet

To take effect on opened documents has to go to:

  • Document-> indent_type -> spaces.

The document configuration has prevalence over the global.

Here’s another tip I like that works in almost any editor. Enable view whitespace, and never get confused again about what’s in the file:

Preferences > Editor > Display > ✔ Show Whitespace

Then restart Geany.

I use the the syntax highlighting features to make these symbols very subtle, a low contrast greyscale, so one has to look to see them. The tab is still somewhat easy to see in scintilla editors because it it will be a multi-character long arrow.

Answered By: Gringo Suave

I faced the same problem, but documents opened as part of project.

In this case the tab/spaces setting is overriden by project->preferences

Answered By: Kapitan
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.