This post is divided into two parts, first the basics: static code check, and then the main course: autocomplete for Python.
Static code check
Last night after programming a little in Sunshine I started playing with the plugin to extend geany with Moon, then in 5 minutes I already had a plugin written that made me static check of the code in Python and CoffeeScript, pointing out unused errors and imports, which is very useful when you're working in a hurry to find silly errors that are hiding in plain sight.
To achieve this, it is installed pyflakes, the static checker for Python, coffeescript, the compiler of that language, and the plugin to extend geany en Moon.
$ sudo aptitude install pyflakes coffeescript geany-plugin-lua
A file of Python and we are going to "Build" »" Set build commands "; is put in the first option, where it says "Compile" is written:
pyflakes "%f"
and in the regular expression to detect errors you put:
(.+):([0-9]+):(.+)
Remaining like this:
So when you have a file open Python and is pressed F8 the static check is executed, indicating the errors in it.
To achieve the same with CoffeeScript, static check and compilation, a file opens .coffee and is put in the build commands:
coffee -c "%f"
With the regex for errors:
Error: In (.+), .* ([0-9]+): (.+)
To automatically execute these compilation commands every time a file is saved and forget about pressing F8, copy the file contained here in your personal folder "~ / .config / geany / plugins / geanylua / events", if that directory structure does not exist: create it.
So every time I save a file in Python o CoffeeScript this is checked statically.
Autocomplete for Python
The other toy I made was this plugin that allows to have an autocompletion comparable to that of the Eclipse PyDev plugin, but with the speed and lightness of Geany.
Install Rope, a library for code refactoring and analysis:
$ sudo aptitude install python-rope
Unzip the contained files here in the folder "~ / .config / geany / plugins /" and open the keyboard shortcut preferences "Edit" »" Preferences "» "Combinations" and look for the entry "Python completion ”and give it the autocomplete key combination " space ", do not fear if it collides with the default autocomplete, overwrite the combination without fear, if the file in which the autocompletion is being executed is not from Python the editor's default completion action will be executed.
This way you should already have a decent autocomplete in Geany.
Concluding
I honestly think this plugin is great for light environments and goodbye to Eclipse, NetBeans, KomodoEdit, and nice SublimeText. With this plugin you can have the power of the great editors in the small and simple Geany.
In case the "configuradera" is very complicated or heavy, simply use my Geany setup. Save your folder "~ .config / geany", just in case, and unzip the new configuration there; install:
$ sudo aptitude install pyflakes coffeescript python-rope geany-plugin-lua
and you will have your editor ready to go.
I hope you enjoy it a lot and let me know your impressions of the invention this… hehehe….
Very good! I'm going to «bookmark» to test it later 🙂
Thanks for the contribution and with Cuban quality 😉
@Titotatin
I am the author of the original post and the one who made the plugin.
That theme is oblivion for geany.
Currently, communities.uci.cu is down but there in the git repositories a repo is hosted that has my geany configuration as I use it.
Greetings, Ed.
Thank you very much, the truth is that I like it more than the theme that comes by default.
Greetings.
Very good contribution. By the way, what theme is the one seen in the geany images?
I don't see the python completion entry in Combinations, I copied the entire configuration folder and installed the packages as the Concluding section of the post says 😮
I already found what I was missing to do, in Plugin Preferences, you have to enable the Lua plugin and that's it 😛
I forgot to mention that Lua has to be enabled in Tools, Plugin Manager, and if there is it doesn't work, check Edit, Plugin Preferences 🙂
I need to learn and a teacher like you I need Cuban
Almost 10 years after publication and guidance and help still has value
Thanks a lot! It helped me a lot