{"id":15445234,"url":"https://github.com/jhermann/gedit-trim-trailing-whitespace-before-saving-plugin","last_synced_at":"2025-03-28T08:15:21.965Z","repository":{"id":10752475,"uuid":"13012607","full_name":"jhermann/gedit-trim-trailing-whitespace-before-saving-plugin","owner":"jhermann","description":"Gedit plugin that trims trailing whitespace before saving a document","archived":false,"fork":false,"pushed_at":"2015-03-09T12:12:19.000Z","size":114,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T08:45:28.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhermann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-22T11:51:26.000Z","updated_at":"2023-08-19T11:43:23.000Z","dependencies_parsed_at":"2022-08-26T12:24:01.024Z","dependency_job_id":null,"html_url":"https://github.com/jhermann/gedit-trim-trailing-whitespace-before-saving-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgedit-trim-trailing-whitespace-before-saving-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgedit-trim-trailing-whitespace-before-saving-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgedit-trim-trailing-whitespace-before-saving-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgedit-trim-trailing-whitespace-before-saving-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhermann","download_url":"https://codeload.github.com/jhermann/gedit-trim-trailing-whitespace-before-saving-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991585,"owners_count":20706129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T19:44:24.240Z","updated_at":"2025-03-28T08:15:21.945Z","avatar_url":"https://github.com/jhermann.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\nThis is a simple plugin for Gedit 3 which automatically trims trailing whitespace from documents when saving. It deletes all horizontal whitespace on the ends of lines as well as extra blank lines at the end of the file.\n\n## Installation\n 0. Make sure that you have the GtkSource-3.0 GI typelib (`/usr/lib/girepository-1.0/GtkSource-3.0.typelib`). On Ubuntu, this can be installed via:\n\n    \u003cpre\u003esudo apt-get install gir1.2-gtksource-3.0\u003c/pre\u003e\n\n 1. You may need to create some directories if you haven't installed Gedit plugins locally before:\n\n    \u003cpre\u003emkdir --parents ~/.local/share/gedit/plugins\u003c/pre\u003e\n\n 2. If running Gedit version 3.8 or higher, save the latest [`trimtrailingws.plugin`](https://raw.github.com/dtrebbien/gedit-trim-trailing-whitespace-before-saving-plugin/master-python3/src/trimtrailingws.plugin) and [`trimtrailingws.py`](https://raw.github.com/dtrebbien/gedit-trim-trailing-whitespace-before-saving-plugin/master-python3/src/trimtrailingws.py) from the master-python3 branch to `~/.local/share/gedit/plugins`.\n\n    If *not* running Gedit version 3.8 or higher, save the latest [`trimtrailingws.plugin`](https://raw.github.com/dtrebbien/gedit-trim-trailing-whitespace-before-saving-plugin/master/src/trimtrailingws.plugin) and [`trimtrailingws.py`](https://raw.github.com/dtrebbien/gedit-trim-trailing-whitespace-before-saving-plugin/master/src/trimtrailingws.py) from the master branch to `~/.local/share/gedit/plugins`\n\n 3. As root, save [`org.gnome.gedit.plugins.trimtrailingws.gschema.xml`](https://raw.github.com/dtrebbien/gedit-trim-trailing-whitespace-before-saving-plugin/master/src/org.gnome.gedit.plugins.trimtrailingws.gschema.xml) to `/usr/local/share/glib-2.0/schemas` and run:\n\n    \u003cpre\u003eglib-compile-schemas /usr/local/share/glib-2.0/schemas\u003c/pre\u003e\n\n    Alternatively, to install the GSettings schema without root access, you can change the [`XDG_DATA_DIRS` environment variable](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) to include a directory under your control, such as `~/.local/share/`:\n\n      * Add the following to your `.bashrc`:\n\n        \u003cpre\u003eif [ -z \"$XDG_DATA_DIRS\" ]; then\n            export XDG_DATA_DIRS=/usr/local/share/:/usr/share/\n        fi\n        export XDG_DATA_DIRS=~/.local/share/:\"$XDG_DATA_DIRS\"\u003c/pre\u003e\n\n      * Then run:\n\n        \u003cpre\u003emkdir --parents ~/.local/share/glib-2.0/schemas\u003c/pre\u003e\n\n      * Save [`org.gnome.gedit.plugins.trimtrailingws.gschema.xml`](https://raw.github.com/dtrebbien/gedit-trim-trailing-whitespace-before-saving-plugin/master/src/org.gnome.gedit.plugins.trimtrailingws.gschema.xml) to `~/.local/share/glib-2.0/schemas` and run:\n\n        \u003cpre\u003eglib-compile-schemas ~/.local/share/glib-2.0/schemas\u003c/pre\u003e\n\n 4. Re-start Gedit.\n 5. From the Edit menu, select \"Preferences\".\n 6. On the Plugins tab, scroll down to the entry for \"Trim Trailing Whitespace Before Saving\" and check the checkbox.\n 7. Click Close.\n\n## Uninstallation\n 0. From the Edit menu, select \"Preferences\".\n 1. On the Plugins tab, scroll down to the entry for \"Trim Trailing Whitespace Before Saving\" and uncheck the checkbox.\n 2. Close Gedit.\n 3. Delete `trimtrailingws.plugin` and `trimtrailingws.py` from `~/.local/share/gedit/plugins`.\n\n## Notes\n *  The plugin looks at the document's syntax highlighting mode. If the highlighting mode is \"Plain Text\" or \"Diff\", then the plugin does not remove trailing whitespace.\n *  The plugin source code is based on [Osmo Salomaa](https://github.com/otsaloma)'s \"Save without trailing space\" plugin for Gedit 2.x that was uploaded to `http://users.tkk.fi/~otsaloma/gedit/`. The website seems to be down now, but the Internet Archive as well as this git repo hold copies of the original source files, `trailsave.gedit-plugin` and `trailsave.py`.\n * If you see the error message:\n\n    \u003cpre\u003e(gedit:3582): GLib-GIO-ERROR **: Settings schema 'org.gnome.gedit.plugins.trimtrailingws' is not installed\n\u003c/pre\u003e\n\n    then you need to install the GSettings schema file, `org.gnome.gedit.plugins.trimtrailingws.gschema.xml`. See the section on Installation above.\n\n## License\n\u003cpre\u003e\nCopyright © 2010–2013 Daniel Trebbien\nCopyright © 2006–2008 Osmo Salomaa\n\nThis program is free software; you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation; either version 2 of the License, or (at your option) any later\nversion.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE. See the GNU General Public License for more\ndetails.\n\nYou should have received a copy of the GNU General Public License along with\nthis program; if not, write to the Free Software Foundation, Inc., 51\nFranklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhermann%2Fgedit-trim-trailing-whitespace-before-saving-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhermann%2Fgedit-trim-trailing-whitespace-before-saving-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhermann%2Fgedit-trim-trailing-whitespace-before-saving-plugin/lists"}