Difference between revisions of "Prelude"

From WikEmacs
Jump to navigation Jump to search
(→‎Common Customization: Clarified personal dir startup)
(Minor update (Prelude now requires Emacs 25.1+))
 
(9 intermediate revisions by 7 users not shown)
Line 9: Line 9:
 
'''Prelude''' has the goal to ease the initial Emacs setup process and to provide you with a much more powerful and productive experience than that you get out of the box. By using Emacs Prelude you're basically getting a "Get me out of the Prelude, I just want to use Emacs" card.
 
'''Prelude''' has the goal to ease the initial Emacs setup process and to provide you with a much more powerful and productive experience than that you get out of the box. By using Emacs Prelude you're basically getting a "Get me out of the Prelude, I just want to use Emacs" card.
  
Emacs Prelude is compatible ONLY with GNU Emacs 24. While Emacs 24 is not yet officially released it's a rock solid piece of software more than suitable for everyday work. There is no good excuse not to use Emacs 24!
+
Emacs Prelude is compatible ONLY with GNU Emacs 25.1+.  In general you're advised to always run Prelude with the latest stable Emacs release.
  
 
= Basic setup =
 
= Basic setup =
  
Assuming you're using an Unix-like OS (*BSD, GNU/Linux, OS X, Solaris, etc), you already have Emacs 24 installed, as well as git & curl you can skip the whole manual and just type in your favorite shell the following command:
+
Assuming you're using an Unix-like OS (*BSD, GNU/Linux, OS X, Solaris, etc), you already have Emacs 25.1+ installed, as well as git & curl you can skip the whole manual and just type in your favorite shell the following command:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
+
# curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
 +
# You really should not be running commands from an anonymously editable wiki
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 35: Line 36:
 
You can tweak Prelude's config by adding '''.el''' files under the
 
You can tweak Prelude's config by adding '''.el''' files under the
 
'''personal''' directory.  All files ending in ".el" will be read automatically when emacs starts up.
 
'''personal''' directory.  All files ending in ".el" will be read automatically when emacs starts up.
 +
 +
== Re-enable the arrow keys ==
 +
 +
Arrow keys for navigation are turned off by default.  This is to get people to use the preferred Emacs defaults. To re-enable them, add the following to a file in your personal directory:
 +
 +
<syntaxhighlight lang="lisp">
 +
(defun disable-guru-mode ()
 +
  (guru-mode -1)
 +
)
 +
(add-hook 'prelude-prog-mode-hook 'disable-guru-mode t)
 +
</syntaxhighlight>
 +
 +
== Turn off whitespace mode ==
 +
 +
Prelude adds a lot of functionality from whitespace mode, including line-ending markers, highlighting of long-lines, space visualization.  If you find these distracting, add the following to a file in your personal directory:
 +
 +
<syntaxhighlight lang="lisp">
 +
(add-hook 'prog-mode-hook 'prelude-turn-off-whitespace t)
 +
</syntaxhighlight>
  
 
== Change the default theme  ==
 
== Change the default theme  ==
Line 68: Line 88:
  
 
Note: it also expects git to be on the system paths defined in PATH. I used git from Cygwin. It worked.
 
Note: it also expects git to be on the system paths defined in PATH. I used git from Cygwin. It worked.
 +
 +
On Windows XP - specifically for using clojure stuff, installing Prelude along the way:
 +
 +
NOTE: i had msysgit on my pc before I started this and I wouldn't be surprised if that put utilities in my path that made this all easier.  But I didn't run cygwin or run inside bash or anything, I did it all from powershell and emacs.
 +
 +
You want to have git in your path
 +
You want to have lein in your path
 +
You want to have java in your path
 +
You want to have clojure installed.  A mystery to me - how does lein find clojure?  I have clojure installed at c:\clojure, there's nothing in the path, things just worked when I went to run cider-jack-in, I don't know how clojure got located.
 +
 +
In emacs, do C-x shell, and if you can't run java -help, git, and lein, figure that out.  Download the lein.bat file from leiningen.org, put it in a folder that is in your path, and run "lein self-install"
 +
 +
Once you have those prerequisite:
 +
 +
When you install prelude, you REPLACE your .emacs.d directory.  IF you have anything you want in in init.el, or anything else in .emacs.d, rename the whole .emacs.d directory. It's going to be under /documents and settings/paul.footwarmer/.emacs.d, unless your name isn't paul.footwarmer.  So rename .emacs.d or erase it.  Then, in cmd or powershell, cd to /documents and settings/paul.footwarmer.  Now run:
 +
 +
    c:\prompt>  git clone https://github.com/bbatsov/prelude.git .emacs.d
 +
 +
Now you will have a new .emacs.d.  When you start emacs it will be prelude, grey theme, run a bunch of stuff, download a bunch of stuff. 
 +
 +
Create a file in .emacs.d called "prelude-modules" and in it put (require 'prelude-clojure)
 +
 +
Restart emacs, see http://clojure-doc.org/articles/tutorials/emacs.html, try M-x cider-jack-in to see if you can run clojure from inside emacs.  On my 8-year-old-laptop it takes about 30 seconds to start up.
  
 
= See Also =
 
= See Also =
Line 88: Line 131:
  
 
[[Category:Beginner]][[Category:Starter Kit]]
 
[[Category:Beginner]][[Category:Starter Kit]]
 +
[[Category:Popular Package]]

Latest revision as of 16:25, 10 October 2021

Emacs Prelude
Description Advanced Emacs config
Author Bozhidar Batsov
Maintainer Bozhidar Batsov
Source https://github.com/bbatsov/prelude

Prelude has the goal to ease the initial Emacs setup process and to provide you with a much more powerful and productive experience than that you get out of the box. By using Emacs Prelude you're basically getting a "Get me out of the Prelude, I just want to use Emacs" card.

Emacs Prelude is compatible ONLY with GNU Emacs 25.1+. In general you're advised to always run Prelude with the latest stable Emacs release.

Basic setup

Assuming you're using an Unix-like OS (*BSD, GNU/Linux, OS X, Solaris, etc), you already have Emacs 25.1+ installed, as well as git & curl you can skip the whole manual and just type in your favorite shell the following command:

# curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | sh
# You really should not be running commands from an anonymously editable wiki

You can now power up your Emacs, sit back and enjoy Prelude.

Helpful keybindings

[C-c f]
Find a recently accessed file.
[C-c r]
Rename file and buffer.

Common Customization

You can tweak Prelude's config by adding .el files under the personal directory. All files ending in ".el" will be read automatically when emacs starts up.

Re-enable the arrow keys

Arrow keys for navigation are turned off by default. This is to get people to use the preferred Emacs defaults. To re-enable them, add the following to a file in your personal directory:

(defun disable-guru-mode ()
  (guru-mode -1)
)
(add-hook 'prelude-prog-mode-hook 'disable-guru-mode t)

Turn off whitespace mode

Prelude adds a lot of functionality from whitespace mode, including line-ending markers, highlighting of long-lines, space visualization. If you find these distracting, add the following to a file in your personal directory:

(add-hook 'prog-mode-hook 'prelude-turn-off-whitespace t)

Change the default theme

Emacs Prelude uses the Zenburn theme by default, but you can easily change this:

(load-theme 'solarized-dark t)


GNU/Linux

OS X

Windows

Note: on Windows 7 (Enterprise),

ln -s <prelude-directory> ~/emacs.d

did not work. But copying the content of prelude directory to .emacs.d worked as expected.

Note: it also expects git to be on the system paths defined in PATH. I used git from Cygwin. It worked.

On Windows XP - specifically for using clojure stuff, installing Prelude along the way:

NOTE: i had msysgit on my pc before I started this and I wouldn't be surprised if that put utilities in my path that made this all easier. But I didn't run cygwin or run inside bash or anything, I did it all from powershell and emacs.

You want to have git in your path You want to have lein in your path You want to have java in your path You want to have clojure installed. A mystery to me - how does lein find clojure? I have clojure installed at c:\clojure, there's nothing in the path, things just worked when I went to run cider-jack-in, I don't know how clojure got located.

In emacs, do C-x shell, and if you can't run java -help, git, and lein, figure that out. Download the lein.bat file from leiningen.org, put it in a folder that is in your path, and run "lein self-install"

Once you have those prerequisite:

When you install prelude, you REPLACE your .emacs.d directory. IF you have anything you want in in init.el, or anything else in .emacs.d, rename the whole .emacs.d directory. It's going to be under /documents and settings/paul.footwarmer/.emacs.d, unless your name isn't paul.footwarmer. So rename .emacs.d or erase it. Then, in cmd or powershell, cd to /documents and settings/paul.footwarmer. Now run:

   c:\prompt>  git clone https://github.com/bbatsov/prelude.git .emacs.d

Now you will have a new .emacs.d. When you start emacs it will be prelude, grey theme, run a bunch of stuff, download a bunch of stuff.

Create a file in .emacs.d called "prelude-modules" and in it put (require 'prelude-clojure)

Restart emacs, see http://clojure-doc.org/articles/tutorials/emacs.html, try M-x cider-jack-in to see if you can run clojure from inside emacs. On my 8-year-old-laptop it takes about 30 seconds to start up.

See Also

Emacs Starter Kit


Project Pages


Tutorial Pages