gedit: how to increase spaces between lines?

I am using gedit with a strange font that the lines sometimes overwrite on each other. can I change the spacing between lines?

3

2 Answers

The External Tools plugin can help change the spacing between lines.

Specifically, it extends gedit by helping you to run scripts on your working files, and by allowing gedit to interact with other programs on your computer.

To enable the External Tools plugin, select:

Gedit ---- Preferences ---- Plugins ---- External Tools.

Once you have enabled the plugin, you will need to configure it to suit your needs.

The configuration options are available by selecting:

Tools ---- Manage External Tools.

Requires knowledge of scripting to be used effectively.

A dialog will appear and you can start adding tools.

To run tools, go to:

Tools ---- External Tools or use if applicable associated shortcut keys.

Storage and hand-editing of tools: /usr/share/gedit/plugins/externaltools/tools.

An example of LineSpacing plugin for Gedit in:

And consists of two files:

linespacing.plugin:

[Plugin]
Loader=python
Module=linespacing
IAge=3
Name=Line-spacing
Description=Increase or decrease space between lines
Authors=
Copyright=
Website= 

linespacing.py:

from gi.repository import GObject, Gtk, Gedit
UI_XML = """<ui>
<menubar name="MenuBar"> <menu name="ToolsMenu" action="Tools"> <placeholder name="ToolsOps_3"> <menuitem name="LineSpacingAction0" action="LineSpacingAction0"/> <menuitem name="LineSpacingAction1" action="LineSpacingAction1"/> <menuitem name="LineSpacingAction2" action="LineSpacingAction2"/> </placeholder> </menu>
</menubar>
</ui>"""
class LineSpacing(GObject.Object, Gedit.WindowActivatable): __gtype_name__ = "LineSpacing" window = GObject.property(type=Gedit.Window) def __init__(self): GObject.Object.__init__(self) def _add_ui(self): manager = self.window.get_ui_manager() self._actions = Gtk.ActionGroup("LineSpacingActions") self._actions.add_actions([ ('LineSpacingAction0', Gtk.STOCK_INFO, "Reset Line spacing", "<Control><Alt>0", "Reset Line spacing", self.on_linespacing_action_activate0), ('LineSpacingAction1', Gtk.STOCK_INFO, "Decrease Line spacing", "<Control><Alt>8", "Decrease Line spacing", self.on_linespacing_action_activate1), ('LineSpacingAction2', Gtk.STOCK_INFO, "Increase Line spacing", "<Control><Alt>9", "Increase Line spacing", self.on_linespacing_action_activate2), ]) manager.insert_action_group(self._actions) self._ui_merge_id = manager.add_ui_from_string(UI_XML) manager.ensure_update() def do_activate(self): self._add_ui() def do_deactivate(self): self._remove_ui() def do_update_state(self): pass def on_linespacing_action_activate0(self, action, data=None): view = self.window.get_active_view() if view: view.set_pixels_below_lines(0) view.set_pixels_inside_wrap(0) def on_linespacing_action_activate1(self, action, data=None): view = self.window.get_active_view() if view: if view.get_pixels_below_lines() >= 0: view.set_pixels_below_lines(view.get_pixels_below_lines() - 1) if view.get_pixels_inside_wrap() >= 0: view.set_pixels_inside_wrap(view.get_pixels_inside_wrap() - 1) def on_linespacing_action_activate2(self, action, data=None): view = self.window.get_active_view() if view: view.set_pixels_below_lines(view.get_pixels_below_lines() + 1) view.set_pixels_inside_wrap(view.get_pixels_inside_wrap() + 1) def _remove_ui(self): manager = self.window.get_ui_manager() manager.remove_ui(self._ui_merge_id) manager.remove_action_group(self._actions) manager.ensure_update()

Sources:

2

I have made a small plugin for line spaceing for gedit 3

gedit-plugin-linespaces

download 'linespaces.plugin' and 'linespaces.py', and move them to '~/.local/share/gedit/plugins/'

set 'pixels' in 'linespaces.py'

run gedit go to preferences -> plugins -> select Line Spacing

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like