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.)
相关问题
- Vim Wrong Indent When There Is Dash - in Html Tag
- gedit plugin error - plugin loader 'python3
- Sublime Text (v 2.0) - how do I stop auto indentat
- Brackets.io: Is there a way to auto indent / forma
- Indentation Error with Sublime Text
相关文章
- Sublime Text (v 2.0) - how do I stop auto indentat
- Brackets.io: Is there a way to auto indent / forma
- Indentation Error with Sublime Text
- How do I change the autoindent to 2 space in IPyth
- 崇高的文本不与HTML正确缩进(Sublime Text isn't indenting p
- Eclipse的Java代码格式化(Eclipse Java code formatting)
- 如何浏览的源代码在Rails3中宝石与RVM(Linux和gedit中)(How do I brow
- 如何在VS2012自动格式代码缺口? [关闭](How to auto format code
gedit
has an auto indentation feature, go toThe 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
andintelligent_text_completion.py
to.local/share/gedit/plugins
, please do the following:Here is another workaround, you can use vim to auto indent and auto format your code from inside Gedit.
First make sure that vim is installed. Next, add an "external tool" to Gedit from the "tools" menu and use the following code:
Also make sure that:
You can also setup a hotkey, I prefer Alt+Shift+F like Netbeans. Now whenever you press the hotkey, the current file will be saved and auto formatted.
This will work on any programming/scripting language given that the file's extension is correct
If you don't get the indentation put
filetype indent on
in your~/.vimrc
file and it will work.For More details check my personal blog
Ubuntu 16.04 and Gedit
Activate External Tools Plugin
Edit → Preferences → Plugins → External Tools
Manage External Tools
Tools → Manage External Tools
Add a Tool
JSON Formatter