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

前端 未结 6 1014
眼角桃花
眼角桃花 2021-02-06 21:32

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

相关标签:
6条回答
  • 2021-02-06 21:40

    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".

    0 讨论(0)
  • 2021-02-06 21:43

    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.

    0 讨论(0)
  • 2021-02-06 21:46

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

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

    0 讨论(0)
  • 2021-02-06 21:53

    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.

    0 讨论(0)
  • 2021-02-06 21:58

    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.

    0 讨论(0)
  • 2021-02-06 22:02

    To take effect on opened documents has to go to:

    • Document-> indent_type -> spaces.

    The document configuration has prevalence over the global.

    0 讨论(0)
提交回复
热议问题