gedit FAQ

Tabs

Why not use Ctrl+PgUp/PgDown to switch among tabs? It's what gnome-terminal/Epiphany/Firefox do... What about Ctrl+Tab?

Use Ctrl+Alt+PgUp/PgDown to switch tabs. Ctrl+Tab is used to switch focus and it's fundamental for accessibility, so it isn't available. Ctrl+PgUp/PgDown is used by GtkTextView (the text display widget of gtk+ which gedit uses) to move to the start/end of the current paragraph. This whole behavior is implemented by default by GtkNotebook.

See bug 705648 for a fix.

gedit is very slow and/or crashes when opening files with very long lines. Can you fix it?

When designing GtkTextView (the text display widget of gtk+ which gedit uses) the developers had to make a design decision: trading off bad performance and memory use on corner cases like very long lines in exchange for better performance in search operations and full support for UTF-8 text. This is a known limitation of GtkTextView and cannot be fixed. On top of that Pango seems to use a lot of CPU drawing such long lines. This may be fixable, but it isn't easy... Feel free to give it a try. Crashes with long lines are usually due to out-of-memory conditions, but if that's not the case then we would like to know about it.

See bug 127731.

Is it possible to hide the tabs and just use the sidepane document list?

Yes, there is a gsetting for that:

$ gsettings set org.gnome.gedit.preferences.ui show-tabs-mode 'never'

To know the possible values:

$ gsettings range org.gnome.gedit.preferences.ui show-tabs-mode

gedit supports Python plugins, but I prefer to write in Ruby/JS/Scheme/Perl/C#/modula-2/whatever...

Currently some core gedit plugins are written in Python and we are pretty happy with it: Python is a really nice scripting language which allows fast development and it has well-tested GTK+ bindings.

If performance is critical, C plugins are still possible. Vala plugins are possible too since they are equivalent to C. While GObject allows you to use many other languages using more than one interpreter in the same process is not possible, not only because of bloat and performance, but also because different interpreted languages cannot manage garbage collections of gobject at the same time: see https://mail.gnome.org/archives/desktop-devel-list/2010-August/msg00036.html

How to set the default highlight mode for new files?

There's no way to directly do so, but there are some alternatives. To illustrate them, consider the following use case: someone creates personal notes using all or part of the Makefile syntax. So to have gedit using Makefile highlight mode by default:

  1. The easiest way is to create new files with an extension recognized as a Makefile file, for example .mk. To get the list of extensions for a specific language, open the corresponding language definition file, for example /usr/share/gtksourceview-3.0/language-specs/makefile.lang (path may vary; see Projects/GtkSourceView/LanguageDefinitions for more information) and find the tag <property name="globs">. Example:

    • <property name="globs">[Mm]akefile;GNUmakefile;[Mm]akefile.*;*.make;*.mk</property>

      In this example, possible names are Makefile, makefile, GNUmakefile, Makefile.something, makefile.something, something.make and something.mk.

  2. Another way is to use a custom extension (say .note) and associate it with Makefile:

    1. Not recommended way: by directly modifying the language definition file. However, each GtkSourceView update will override this change.

    2. Better way: by creating a custom language definition file. For example, copy the Makefile language definition file and paste it in your user-wide folder, for example ~/.local/share/gtksourceview-3.0/language-specs (path may vary). Then, add .note to the list of extensions:

      <property name="globs">*.note;[Mm]akefile;GNUmakefile;[Mm]akefile.*;*.make;*.mk</property>

  3. Another way is to use modelines. It's a gedit plugin allowing to set some preferences on a per-file basis. After having enabled the plugin, any file containing the following code on the first or one of the last three lines will be highlighted as a Makefile file (see the plugin documentation for more information):

    • # vim:set filetype=makefile:

Apps/Gedit/FAQ (last edited 2015-08-23 11:15:41 by SébastienWilmet)