Coder Social home page Coder Social logo

oskstr / sensible-defaults.el Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hrs/sensible-defaults.el

0.0 0.0 0.0 28 KB

A simple, modular collection of better Emacs default settings.

License: GNU General Public License v3.0

Emacs Lisp 100.00%

sensible-defaults.el's Introduction

Sensible default settings for Emacs

Emacs is a terrific editor, but its out-of-the-box experience isn't great. Some of its default settings feel a bit clunky. sensible-defaults.el aspires to help new users configure some of those settings in a simple and modular way (i.e., it's just a file of functions you can call).

The sensible-defaults.el file contains a number of function definitions, any of which can be called from your ~/.emacs or ~/.emacs.d/init.el file.

sensible-defaults.el includes settings for:

  • Ensuring that files end with newlines,
  • Always enabling syntax highlighting,
  • Increasing the garbage collection threshold,
  • Defaulting line-length to 80 characters,
  • Creating parent directories after saving a deeply nested file,
  • Making dired file sizes human-readable,
  • AND MORE!

For good or ill, sensible-defaults doesn't deal with any external packages. It only tweaks settings built into the editor itself. If you wanna configure packages, you're on your own.

Getting started

Emacs reads its initial configuration from either ~/.emacs.d/init.el or ~/.emacs. We suggest using a .emacs.d directory so you can keep your configuration code in more than one file.

Copy sensible-defaults.el into your .emacs.d. You can also store it in a separate directory, if you'd like, or symlink it into your .emacs.d directory. Symlinking is nice, since you can clone this repo somewhere and pull down new changes as they come in!

Load it from your init.el with (load-file "~/.emacs.d/sensible-defaults.el") (or some other path, if you put it somewhere else). This evaluates the file. That shouldn't do anything interesting on its own, though, since the file only defines functions.

Browse through sensible-defaults.el and decide which settings you'd like to enable. Call those functions in your init.el. That's it!

An Example

Suppose you want to use every setting and every keybinding suggested by sensible-defaults. Your init.el should contain the following code:

(load-file "~/.emacs.d/sensible-defaults.el")
(sensible-defaults/use-all-settings)
(sensible-defaults/use-all-keybindings)

A More Selective Example

Maybe you just want to increase the garbage collection threshold, show matching parentheses, and bind the Home and End keys correctly. Kind of a weird set of choices, but whatevs, it's easy:

(load-file "~/.emacs.d/sensible-defaults.el")
(sensible-defaults/increase-gc-threshold)
(sensible-defaults/show-matching-parens)
(sensible-defaults/bind-home-and-end-keys)

That's it!

Non-Default Settings

The sensible-defaults/backup-to-temp-directory setting isn't enabled by default (i.e., it isn't included in sensible-defaults/use-all-settings), since it could lead to unexpected data loss in some cases.

If you're the sort of person who doesn't rely much on backups and saves reflexively, though, this might be a perfectly fine choice for you.

If you choose to enable it, just call it like any of the other functions:

(sensible-defaults/backup-to-temp-directory)

sensible-defaults.el's People

Contributors

hrs avatar oskstr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.