Skip to content

Emacs: removing the unnecessary spaces from your buffers.

License

Notifications You must be signed in to change notification settings

targzeta/delete-nl-spaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Delete Needless Spaces

Emacs: removing the unnecessary spaces from your buffers.

Demonstration

Intro

Delete Needless Spaces is a smart minor mode that keep clean our buffers from silly spaces. It's enabled by default for all new and already clean buffers but, if you visit a dirty file, it disables itself.

When this minor mode is enabled (implicitly for clean buffers and explicitly on dirty buffers with M-x delete-nl-spaces-mode), before a buffers it's saved to its files this mode:

  • deletes initial blank lines;
  • changes spaces on tabs or vice versa depending on indent-tabs-mode;
  • deletes the trailing whitespaces and empty last lines;
  • deletes also latest blank line if require-final-newline is nil;

Installation

Copy the file in a directory which is in the Emacs load-path. Then, execute the following code either directly or in your .emacs file:

;;; Deleting needless spaces before saving buffers.
(require 'delete-nl-spaces)

About

Emacs: removing the unnecessary spaces from your buffers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published