Search code examples
geditauto-indent

How to get gedit to auto-indent code


I'm trying to get gedit to auto-indent my code. The auto-indent check-box in preferences doesn't work. Is there a way to get gedit to auto-indent code? (By the way, I only really care about C++ indentation. I don't need indentation for any other language.)


Solution

  • The plugin 'intelligent text completion' for gedit does exactly what you describe: https://github.com/nymanjens/gedit-intelligent-text-completion

    For those who are trying to find out how to copy the files intelligent_text_completion.plugin and intelligent_text_completion.py to.local/share/gedit/plugins, please do the following:

    user@example:~/.local/share$ cd ~/.local/share/
    user@example:~/.local/share$ mkdir gedit
    user@example:~/.local/share$ cd gedit/
    user@example:~/.local/share/gedit$ mkdir plugins
    user@example:~$ cp intelligent_text_completion.plugin intelligent_text_completion.py ~/.local/share/gedit/plugins/