Gedit… for programmers

Gedit ready to use


Long ago I had talked about sublime-text, a very, very complete text editor, and its many functionalities.

I still think that sublime-text it is quite powerful and worth using, but it has major drawbacks, especially some that conflict with my ideas and principles regarding software.

First of all, it is not free, and that must be made clear. It is very creative that unlimited testing time and very beautiful that it is written in Python, but not everything is honey on flakes and to be honest, it has a fatal error: it breaks you ladies marbles with its pop-ups of "Update to the new version" every time you open the editor, it doesn't matter that you already have it updated, it always tells you. Another toothache is that every time I save or close 3 files with that editor, I get another pop-up telling me "You are using the trial license, do you want to buy the license?" or something very close to that.

Ok, ok, I understand that you need to make money and I applaud that of the unlimited trial license, but that of spamming me on my own desktop ... hmmm, I kind of don't like it, so I decided to look for something that would better suit my needs "Stallmannian" (XD).

First was Kate, the publisher of the great KDE, which in itself is very good and all that, but, well ... it is not as extensible as some say, or is it that I am really bad looking, if so, please correct me and show me extensions for Kate. Sure, extensions to program.

Then came Vim... I could not stand it, it is too powerful, but that exaggeration in its power is accompanied by an exaggeratedly high learning curve.

A genie told me about text mate, but that's just for Mac and I gave him two rods in the head for speaking nonsense.

Then came komodo edit, a very high quality IDE that I thought would be the main contender for sublime-text at the level of supported programming languages, with a lot of power and relatively customizable although it lacked (or I could not find) anywhere anything like a button to compile or execute (a la Geany) or some Build-system (a la Sublime-text ), that added to the fact that I could not install it in any way but by running a binary ... better stay still there.

In the end I had thought of Geany, but I really don't like it, it is not very minimalist or as customizable as I would like it to be, although if it is very powerful, that will never be taken away from anyone ... After reading around there, I found that they talked about Gedit, which was supposed to be the most flexible text editor of all, what a thing one finds right? Right in front of my nose I had what I was looking for.

So, let's get to work:

First of all Gedit is a plain text editor that, by itself, can half supply some basic capabilities of a programmer, but not those of someone like me, who eats programming books and articles every day and wants to be programming all the time, so, it's time to extend our dwarf to turn him into a monster:

First of all, you have to download the main accessories:

sudo apt-get install gedit-plugins

And then put the following plugins to support new tools, themes and more programming languages:

sudo apt-get install gmate:
sudo apt-add-repository ppa:ubuntu-on-rails/ppa
sudo apt-get update
sudo aptitude install gedit-gmate

Of course, many times we do not have these simple packages in our distros, I am telling you since gmate apparently it is a nuisance because it is not in the repos of anything, so it is time to turn to the dear Go.

If they don't have Go installed then look for the

paqueqte git-core

and install it.

Then you have to install the following packages:

python-webkit python-pyinotify ack-grep

And finally make the clone of the code from Go:

git clone git://github.com/gmate/gmate.git

And install it:

sh install.sh

With this we have installed everything we need to "poison" our Gedit and turn it into a beautiful, minimalist IDE.

First of all we need to start with the main thing, the marking of lines in use, the enumeration of lines and the automatic closing of brackets, braces, quotes, etc, etc. For that we just have to go to Edit »Preferences then we check the following options:

    <° Activate line numbering.
    <° Highlight current line.
              <° Highlight pairs of brackets.

Then we will go to the editor section, where we will move the following parameters:

    <° Width of the tab: it is in 8, I use it in 4 for tastes but everyone can have it at the level they like, this will delimit the size of the indentation with tabulation.
    <° Activate automatic bleeding.
              <° Create a save copy of the files before saving them and auto-save files every: “as long as you want”. This is especially important, we don't want our code to go to hell for some mistake and we don't have backups.

Now comes the accessories part. Here the thing would be very long if I talked about all of them, the good thing is that clicking on "about" gives us a very specific and direct description of what the complement is and what it is for. I am going to leave you the ones I use and the use I give them.

    <° Complete parentheses: we know well how I use it.
    <° Draw spaces: it draws points between each word, which allows me to know how many spaces there are between one and another.
    <° Console

Python

    : this tool is one of the essential tools for me and any self-respecting Pydeveloper, it is a nuisance to have to be entering the folders via terminal and executing the files manually, we better copy and paste, enter and voila, I'm working ... there are errors it will not run and will tell you what happens.

    <° File browser panel: useful, very useful. This simply allows us to see our folder tree next to the screen to be able to navigate between the files.
    <° Flush terminal: it is the same as the terminal

Python

    only this is a normal terminal that allows you to do everything.

    <° Cuts or

snippets

    - just the holy grail of this whole thing, if you did the whole installation process and don't use

snippets

    , it is better to give yourself a shot in the head, these are, to summarize and put it in another section, the completed car of

Gedit

    , But better.

Typography and Colors.

This is more than all the graphic section that, although it is not something that does not allow you to work, it is something that makes your work very comfortable for several reasons. First of all, everything in white and black letters is uncomfortable, a little blue and fuchsia to highlight and voila, Gedit It's pity and shatters your eyes at night (if you're a self-respecting programmer, then don't program during the day). And this is where gmate enters; I explain briefly:

gmate is a set of add-ons, visual styles, and languages ​​for Gedit, that simple, brings us themes, more languages ​​and plugins.

Here it is simply a matter of taste, but what they have to choose from, they have. It actually has themes that I love, like Monokai, a theme with the same colors as sublime-text o dark mate, one equal to text mate.
But here everything depends on the tastes of each person.

Snippets or Snippets.

This is the highlight of Gedit, its ability to auto-complete, but not only that but also that it is 100% configurable since it not only already brings by default the most common functions of the languages ​​it has, but also allows us to add ours and even put its complete structure with symbols and even with fields to fill.

I quickly explain what to do, because simpler impossible:

First we go to the tools section and there we click on “manage snippets” (it is always in English) and there we look for the language we want to modify.

We will see things like this:

Well, simpler impossible, to add a new snippet just click on the "+" sign at the bottom, we give it the name we want and enter. Then in the field to write (marked in the image) we type what we want to appear when calling the snippet and if we want we can add some "intelligence" to them, example:

The set method of python:

def set$1(self, ${2:newValue}): self._$1 = $2

Ignore the syntax of pythonLook at the $ signs. They indicate something similar to a constant, they simply take the value over whatever they are assigned, in this case $ 1 takes the value of self and stops right at $ {2:} since another take of values ​​begins there. The second of the $, like the first, takes values, but what it does is take a value from a text field; {2:} is the following:

    <° The {} indicate that this is where the programmer will enter a variable, value, text, etc.

    <° 2: indicates that it is the second of the parameters.

    <° newValue is simply the text that will appear as an indication that a value should be placed there.

    In the end self ._ $ 1 = $ 2 what it does is:

    <° $ 1 calls the value of the first self.

    <° $ 2 recreates a

snippet

    to enter a new value.

In the end this is the result:

It sounds complicated, but believe me, being an amateur programmer who studies at a bad university and who only has the internet as a backup could understand it, you can too. With this tool you will not only have a very powerful code editor but also extremely moldable.
Now to close and answer some questions that surely many have:

    <° Is this only valid for languages ​​interpreted as

HTML

    ,

Python

    ,

JavaCrypt

    ?

    No, in fact, if you have the compilers installed, like g ++ for example, you can compile from the embedded terminal with: g ++ filename.cpp or g ++ / filepath filename.cpp

    <° Can I add more languages ​​than I already

Gedit

    have with all this?

    Yes, but that will be explained in the community forum, it is a bit more complex.

    <° Can I create my own themes for

Gedit

    ?

    Yes, but I still don't know exactly how to do it, it will be explained in the forum

DesdeLinux

    when my knowledge on the subject is complete.

For now that's all, I hope you liked it and that it is useful to you.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   proper said

    I usually use gVim for programming and I recently installed gedit and it's actually pretty good.

  2.   lazarus said

    Excellent entry, you have made me doubt about my choice as an IDE, I am thinking of changing to something lighter and more powerful like gedit, and leaving aside the powerful but heavy Aptana Studio.

  3.   antolieztsu said

    I'm not an expert programmer, I do it as a hobby, but I like VIM better, it's the best: fast, configurable and controllable by keys, I even use it not for programming. Gedit is good, but Geany is also interesting, it is light and very powerful. If you come from Gedit, you will have to change some key combinations so as not to confuse what you have learned XD

    1.    dwarf said

      People are raving about Vim, but if I want something like that then I'll stick with Emacs xD.

      To my gedit it seems the closest to perfection, it complies with what I need and if not then I do it xD

  4.   Mauritius said

    I also use Gedit, although I program something very occasionally, as I'm just a hobbyist, but I really like its flexibility and power.

    Another thing, off topic, where did you get that wallpaper? it's very good 😀

    1.    dwarf said

      I won't tell you OO it's a secret and I'm a windows XD lover.

      Nah seriously, in a couple of days we will do a desktop contest and I will put absolutely all my configuration there =)

      1.    Courage said

        Nah seriously, in a couple of days we will do a desktop contest and I will put absolutely all my configuration there =)

        And I don't find out about anything ...

        1.    KZKG ^ Gaara said

          Don't even mention it, I just found out now too LOL !!!

          1.    Courage said

            Total, you are going to lose ...

          2.    dwarf said

            in fact it is something that I had discussed with Elav ... Then I mentioned it to the moron from the sandy but apparently he was doing something more important and he didn't even know ¬¬

  5.   dragon said

    thanks I have already configured my gedit when requesting the lyrics, I just have one question. How did you manage to pass the notification icons to the Cinnamon bar and make the Gnome 3 bar transparent? hehehe I liked it a lot and I would like to do it.

    thank you again.

  6.   Jevus said

    The window that warns that it is a trial version does NOT come out as often as you say, do not exaggerate

    1.    dwarf said

      I got them every 3 times that I saved some type of file and every time I opened SublimeText.

      Now having Gedit, SublimeText seems like a total waste of time to me and I don't get used to it

  7.   Mafuns said

    Hello, excellent post.

    Just a question. One function that forced me to look for alternatives to gedit was to compact lines. For example compact everything that is inside an if {}. In this way the space is cleaned a lot. I found geany and it complies quite well, but I would like to know if it can be achieved with gedit.

    I am an amateur programmer (I started through bioinformatics, because I study biology), I suppose that others will know much better what it is to deal with large amounts of code.

    1.    dwarf said

      I would like to know a little more about compacting lines because I have not done it, or maybe I did and I did not know ... Can you show me example code?

      1.    Mafuns said

        Maybe I have not explained myself well. It is not about the code itself, but about the visualization of it. Perhaps the word would be "fold / unfold" lines of code. So that:
        if {
        something
        anything else
        even more
        }

        Just see
        if {

        I with a button you can fold or unfold the content of if.

        1.    dwarf said

          Ahh! Now, hide the functions. No, as far as I know that cannot be done in Gedit.

          1.    Mafuns said

            🙂 It's a shame. Nothing happens for small programs, but if you have large tables or others, it bothers me a lot that I can't do it.

  8.   Edgar said

    I have a question, if in ubuntu I install new fonts, in the gedit editor can I take the typography of those new fonts that I install?

    1.    KZKG ^ Gaara said

      Yesp 😉

      1.    Edgar said

        In Ubuntu, which typeface is similar to Lucida Sans? That does not have much space between rows of code like other type of typefaces do in Windows, the typeface that I like the most in Windows is Lucida Sans, and its alternative Verdana, the The rest of the fonts are very repetitive and their style is not very pleasant, I hope that Ubuntu has more variety of fonts than in Windows and much more attractive.

        1.    Manual of the Source said

          Then install Lucida Sans:

          sudo apt-get install sun-java6-fonts

  9.   Edgar said

    Can gedit be installed on a 64-bit Windows Operating System? The official site only offers the 32-bit version for Windows.

  10.   msx said

    The post is very nice but let's get to the interesting thing: what is your wallpaper !?

  11.   Villain said

    Use Geany, simpler: 3

  12.   Abimael martell said

    Before I used Geany, but there is nothing with VIM, I think the learning curve is worth it, since it is very agile
    regards

  13.   st0rmt4il said

    Editors like Scribes or Sublimetext2 quite fill those gaps that Gedit has! .. Apart from the fact that Gedit has its merits, yes, it is like many things here a matter of taste! 😀

    Regards!

  14.   lewatoto said

    Thank you! for the information it has been very useful.

  15.   wow said

    I resuscitate this post just to tell you, thank you for the contribution! I always liked the gedit that comes from the factory, but due to the lack of "help" for programmers I ended up going to sublme ... when I finish exams I will take a look at the plugins gedit.
    PS: Vim is a great editor, the problem comes with gVim, which depending on which version you install (windows / linux) completely changes the way it treats the visual mode and the mouse, not to mention the hassle of buffers at the time to copy / paste from another program ...

  16.   desdelinuxero said

    What I don't like about Gedit:

    -When you are editing an HTML file and inside you have Javascript or CSS code, then when commenting on a block of code in javascript or CSS, you comment it with the HTML format. Gedit does not recognize the type of language where you have selected code to comment. Sublime Text yes.

    -It does not have a code autoformatador that automatically tabulates all the selected code.

    -It does not have a native manager for FTP, you have to use the unstable and famous Gnome GVFS

    -It does not have a plugin to generate file backups for each change made with a timestamp. There is a Sublime Text plugin where you can

    -It does not have a syntax error detector.

    -Does not have a refactor tool

    -In XFCE you cannot use the integrated Gedit console because Gedit works by default with gnome-terminal and not with xfce4-terminal.

    1.    desdelinuxero said

      I missed mentioning that with the new versions that appear from Gedit, some plugins lose their compatibility, as it happens with ZenCoding

  17.   edwardoyazun said

    I used Gedit to program, but later I switched to Aptana 3 (a very complete IDE), what I like about Aptana is that it autocompletes the functions for Javascript or Python (along with its parameters that it receives) and shows me the documentation of its functions, compatibility with browsers and much more.
    But lately the Aptana is getting very heavy, sometimes even commenting on a line takes about 10 seconds.
    Now I'm thinking of going back to Gedit, the only thing I miss is something that autocompletes the functions with its documentation, a highlighter with incorrect syntax and also an object map, where I can see the declared variables and functions to directly access them.
    I also like Geany, it is lighter than Gedit, but it is missing many plugins unlike Gedit and I cannot change the color theme, I do not like white backgrounds to program.

    1.    gabriel said

      You have to try sublime text or vim; light table when exiting alpha.

      1.    just-another-dl-user said

        I installed the Gmate but when I want to activate its plugins I get the following error:
        an error occurred: plugin loader "python" was not found

        PS: I already have python installed

  18.   just-another-dl-user said

    I installed the Gmate but when I want to activate its plugins I get the following error:
    an error occurred: plugin loader "python" was not found

    PS: I already have python installed

  19.   David Gómez said

    Nano, you complain more than a woman!

    I think you need to try NinjaIDE, a very popular IDE for Python that, if I'm not bad, is Open Source, multiplatform, very powerful and crybaby proof. Could you give it a try to see if it meets your expectations 😉

  20.   jc said

    Good info and congratulations on getting a note (from two years ago) to stick with comments for so long. That speaks well of the author ...

  21.   Alonso castro said

    Your comment is waiting for moderation.
    Hello, do you know of any audio player plugin for mp3 for wordpress that works in version 3.6.1 and also has the characteristics of the audio player plugin, this means simple, practical and professional at the same time, but that also works on devices mobiles such as ipad, tablet, smartphones, etc. thanks for your prompt help

  22.   yo said

    How do I open a simple text and add an image to it?

  23.   Narcissus Nunez said

    Excellent post, I have been looking for how to add an ftp plugin to my gedit, I have found several related posts that tell me to put the files in folders that are not all on my system, I add them and gedit does not detect them ...

    If you can help me I would appreciate it.

    I use: fedora 17 with gnome.

  24.   Emiliano said

    Hello, the reason for my query is to know how I can do to connect my Gedit to a SQL DB. Maybe it's an easy question, but I'm just getting started in the world of Linux. From already thank you very much.

  25.   ravencrown said

    Hey thank you very much, I want to learn python, ruby… Ruby on rails and I loved your tutorial. I was surprised to know that my gedit could do all of that. I am also using the monokai theme which looks just great.

    regards

  26.   deivis said

    friend I want to say something and I hope you help me, I have a pc at home but I do not have internet, however I from my work that if I have the internet download the ubuntu 14.04 and already install it on my home computer now my question It is the following as I do to be able to install any program for example google chrome or any other program, download it from my work and install it to my home pc, since it is not like windows that you download it is saved on a usb and on the house is double clicked and installed I hope you help me 🙂

  27.   Marcelo said

    Thanks a lot! greetings from Chile!

  28.   Ernesto slavo said

    can it be installed on ubuntu 14.04?