added basic customization support
This commit is contained in:
parent
051275833b
commit
b4dd55883f
12 changed files with 297 additions and 146 deletions
4
init.el
4
init.el
|
@ -33,6 +33,10 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(defgroup prelude nil
|
||||||
|
"Emacs Prelude"
|
||||||
|
:group 'convenience)
|
||||||
|
|
||||||
;; On OS X Emacs doesn't use the shell PATH if it's not started from
|
;; On OS X Emacs doesn't use the shell PATH if it's not started from
|
||||||
;; the shell. If you're using homebrew modifying the PATH is essential.
|
;; the shell. If you're using homebrew modifying the PATH is essential.
|
||||||
(if (string= system-type "darwin")
|
(if (string= system-type "darwin")
|
||||||
|
|
|
@ -32,13 +32,24 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
;; customize
|
||||||
|
(defgroup c nil
|
||||||
|
"Emacs Prelude C programming support"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
|
(defcustom prelude-enable-c-hook t
|
||||||
|
"Enable Prelude's default C hook."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'c)
|
||||||
|
|
||||||
(defun prelude-c-coding-hook ()
|
(defun prelude-c-coding-hook ()
|
||||||
(setq c-basic-offset 4)
|
(setq c-basic-offset 4)
|
||||||
(prelude-coding-hook))
|
(prelude-coding-hook))
|
||||||
|
|
||||||
;; this will affect all modes derived from cc-mode, like
|
(when prelude-enable-c-hook
|
||||||
;; java-mode, php-mode, etc
|
;; this will affect all modes derived from cc-mode, like
|
||||||
(add-hook 'c-mode-common-hook 'prelude-c-coding-hook)
|
;; java-mode, php-mode, etc
|
||||||
|
(add-hook 'c-mode-common-hook 'prelude-c-coding-hook))
|
||||||
|
|
||||||
(provide 'prelude-c)
|
(provide 'prelude-c)
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,16 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
;; customize
|
||||||
|
(defgroup clojure nil
|
||||||
|
"Emacs Prelude Clojure programming support"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
|
(defcustom prelude-enable-clojure-hook t
|
||||||
|
"Enable Prelude's Clojure hook."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'clojure)
|
||||||
|
|
||||||
(require 'prelude-lisp)
|
(require 'prelude-lisp)
|
||||||
|
|
||||||
;; To start SLIME in your Clojure project:
|
;; To start SLIME in your Clojure project:
|
||||||
|
@ -39,7 +49,8 @@
|
||||||
;; 2. Invoke M-x clojure-jack-in from a project
|
;; 2. Invoke M-x clojure-jack-in from a project
|
||||||
(require 'clojure-mode)
|
(require 'clojure-mode)
|
||||||
|
|
||||||
(add-hook 'clojure-mode-hook 'prelude-lisp-coding-hook)
|
(when prelude-enable-clojure-hook
|
||||||
|
(add-hook 'clojure-mode-hook 'prelude-lisp-coding-hook))
|
||||||
|
|
||||||
(provide 'prelude-clojure)
|
(provide 'prelude-clojure)
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,15 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(defgroup coffee nil
|
||||||
|
"Emacs Prelude CoffeeScript support"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
|
(defcustom prelude-enable-coffee-hook t
|
||||||
|
"Enable Prelude's CoffeeScript's hook"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'coffee)
|
||||||
|
|
||||||
(require 'coffee-mode)
|
(require 'coffee-mode)
|
||||||
|
|
||||||
(defun prelude-coffee-mode-hook ()
|
(defun prelude-coffee-mode-hook ()
|
||||||
|
@ -64,7 +73,8 @@
|
||||||
(file-exists-p (coffee-compiled-file-name))
|
(file-exists-p (coffee-compiled-file-name))
|
||||||
(coffee-cos-mode t)))
|
(coffee-cos-mode t)))
|
||||||
|
|
||||||
(add-hook 'coffee-mode-hook 'prelude-coffee-mode-hook)
|
(when prelude-enable-coffee-hook
|
||||||
|
(add-hook 'coffee-mode-hook 'prelude-coffee-mode-hook))
|
||||||
|
|
||||||
(provide 'prelude-coffee)
|
(provide 'prelude-coffee)
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,27 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(defgroup common-lisp nil
|
||||||
|
"Prelude's Common Lisp support"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
|
(defcustom prelude-start-slime-automatically t
|
||||||
|
"Start SLIME automatically the first time a .list file is opened."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'common-lisp)
|
||||||
|
|
||||||
|
(defcustom prelude-enable-common-lisp-hook t
|
||||||
|
"Enable Prelude's Common Lisp hook"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'common-lisp)
|
||||||
|
|
||||||
|
(defcustom prelude-load-common-lisp-slime-automatically nil
|
||||||
|
"Load Common Lisp's SLIME by default. Setting this to `t' is not a
|
||||||
|
very good idea if you're programming on occasion in both Clojure and
|
||||||
|
Common Lisp."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'common-lisp)
|
||||||
|
|
||||||
(require 'prelude-lisp)
|
(require 'prelude-lisp)
|
||||||
|
|
||||||
;; the SBCL configuration file is in Common Lisp
|
;; the SBCL configuration file is in Common Lisp
|
||||||
|
@ -43,8 +64,7 @@
|
||||||
;; Common Lisp support depends on SLIME being installed with Quicklisp
|
;; Common Lisp support depends on SLIME being installed with Quicklisp
|
||||||
(if (file-exists-p (expand-file-name "~/quicklisp/slime-helper.el"))
|
(if (file-exists-p (expand-file-name "~/quicklisp/slime-helper.el"))
|
||||||
(load (expand-file-name "~/quicklisp/slime-helper.el"))
|
(load (expand-file-name "~/quicklisp/slime-helper.el"))
|
||||||
(message "%s" "SLIME is not installed. Use Quicklisp to install it."))
|
(message "%s" "SLIME is not installed. Use Quicklisp to install it.")))
|
||||||
)
|
|
||||||
|
|
||||||
;; a list of alternative Common Lisp implementations that can be
|
;; a list of alternative Common Lisp implementations that can be
|
||||||
;; used with SLIME. Note that their presence render
|
;; used with SLIME. Note that their presence render
|
||||||
|
@ -58,17 +78,23 @@
|
||||||
(sbcl ("sbcl" "--noinform") :coding-system utf-8-unix)))
|
(sbcl ("sbcl" "--noinform") :coding-system utf-8-unix)))
|
||||||
|
|
||||||
;; select the default value from slime-lisp-implementations
|
;; select the default value from slime-lisp-implementations
|
||||||
(setq slime-default-lisp 'sbcl)
|
(if (string= system-type "darwin")
|
||||||
|
;; default to Clozure CL on OS X
|
||||||
|
(setq slime-default-lisp 'ccl)
|
||||||
|
;; default to SBCL on Linux and Windows
|
||||||
|
(setq slime-default-lisp 'sbcl))
|
||||||
|
|
||||||
(add-hook 'lisp-mode-hook 'prelude-lisp-coding-hook)
|
(when prelude-enable-common-lisp-hook
|
||||||
(add-hook 'slime-repl-mode-hook 'prelude-interactive-lisp-coding-hook)
|
(add-hook 'lisp-mode-hook 'prelude-lisp-coding-hook)
|
||||||
|
(add-hook 'slime-repl-mode-hook 'prelude-interactive-lisp-coding-hook))
|
||||||
|
|
||||||
;; start slime automatically when we open a lisp file
|
;; start slime automatically when we open a lisp file
|
||||||
(defun prelude-start-slime ()
|
(defun prelude-start-slime ()
|
||||||
(unless (slime-connected-p)
|
(unless (slime-connected-p)
|
||||||
(save-excursion (slime))))
|
(save-excursion (slime))))
|
||||||
|
|
||||||
(add-hook 'slime-mode-hook 'prelude-start-slime)
|
(when prelude-start-slime-automatically
|
||||||
|
(add-hook 'slime-mode-hook 'prelude-start-slime))
|
||||||
|
|
||||||
;; Stop SLIME's REPL from grabbing DEL,
|
;; Stop SLIME's REPL from grabbing DEL,
|
||||||
;; which is annoying when backspacing over a '('
|
;; which is annoying when backspacing over a '('
|
||||||
|
|
|
@ -36,6 +36,11 @@
|
||||||
(require 'thingatpt)
|
(require 'thingatpt)
|
||||||
(require 'imenu)
|
(require 'imenu)
|
||||||
|
|
||||||
|
;; customization
|
||||||
|
(defgroup core nil
|
||||||
|
"Emacs Prelude core"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
(defun prelude-add-subfolders-to-load-path (parent-dir)
|
(defun prelude-add-subfolders-to-load-path (parent-dir)
|
||||||
"Adds all first level `parent-dir' subdirs to the
|
"Adds all first level `parent-dir' subdirs to the
|
||||||
Emacs load path."
|
Emacs load path."
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
;; customize
|
||||||
|
(defgroup editor nil
|
||||||
|
"Emacs Prelude Editor enhancements"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
;; Emacs users obviously have little need for Command and Option keys,
|
;; Emacs users obviously have little need for Command and Option keys,
|
||||||
;; but they do need Meta and Super
|
;; but they do need Meta and Super
|
||||||
(when (string= system-type "darwin")
|
(when (string= system-type "darwin")
|
||||||
|
@ -160,6 +165,10 @@
|
||||||
(require 'yasnippet) ;; not yasnippet-bundle
|
(require 'yasnippet) ;; not yasnippet-bundle
|
||||||
(yas/initialize)
|
(yas/initialize)
|
||||||
|
|
||||||
|
;; dispense of trailing whitespace once and for all
|
||||||
|
(add-hook 'before-save-hook
|
||||||
|
'delete-trailing-whitespace)
|
||||||
|
|
||||||
;; projectile is a project management mode
|
;; projectile is a project management mode
|
||||||
(require 'projectile)
|
(require 'projectile)
|
||||||
(projectile-global-mode t)
|
(projectile-global-mode t)
|
||||||
|
|
|
@ -32,17 +32,17 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(defgroup emacs-lisp nil
|
||||||
|
"Prelude support for Emacs Lisp"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
|
(defcustom prelude-enable-emacs-lisp-hook t
|
||||||
|
"Enable Prelude's Emacs Lisp hook"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'emacs-lisp)
|
||||||
|
|
||||||
(require 'prelude-lisp)
|
(require 'prelude-lisp)
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'prelude-remove-elc-on-save)
|
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'prelude-lisp-coding-hook)
|
|
||||||
|
|
||||||
(add-hook 'ielm-mode-hook 'prelude-interactive-lisp-coding-hook)
|
|
||||||
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)
|
|
||||||
|
|
||||||
(defun prelude-remove-elc-on-save ()
|
(defun prelude-remove-elc-on-save ()
|
||||||
"If you're saving an elisp file, likely the .elc is no longer valid."
|
"If you're saving an elisp file, likely the .elc is no longer valid."
|
||||||
(make-local-variable 'after-save-hook)
|
(make-local-variable 'after-save-hook)
|
||||||
|
@ -51,6 +51,15 @@
|
||||||
(if (file-exists-p (concat buffer-file-name "c"))
|
(if (file-exists-p (concat buffer-file-name "c"))
|
||||||
(delete-file (concat buffer-file-name "c"))))))
|
(delete-file (concat buffer-file-name "c"))))))
|
||||||
|
|
||||||
|
(when prelude-enable-emacs-lisp-hook
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'prelude-remove-elc-on-save)
|
||||||
|
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'prelude-lisp-coding-hook)
|
||||||
|
|
||||||
|
(add-hook 'ielm-mode-hook 'prelude-interactive-lisp-coding-hook)
|
||||||
|
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode))
|
||||||
|
|
||||||
(define-key emacs-lisp-mode-map (kbd "M-.") 'find-function-at-point)
|
(define-key emacs-lisp-mode-map (kbd "M-.") 'find-function-at-point)
|
||||||
|
|
||||||
(provide 'prelude-emacs-lisp)
|
(provide 'prelude-emacs-lisp)
|
||||||
|
|
|
@ -32,120 +32,132 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;; You know, like Readline.
|
(defcustom prelude-enable-additional-keybindings t
|
||||||
(global-set-key (kbd "C-M-h") 'backward-kill-word)
|
"Enable Prelude additional global keybindings"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
;; Align your code in a pretty way.
|
(defcustom prelude-disable-arrow-navigation t
|
||||||
(global-set-key (kbd "C-x \\") 'align-regexp)
|
"Disable arrow navigation"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
;; Perform general cleanup.
|
(when prelude-enable-additional-keybindings
|
||||||
(global-set-key (kbd "C-c n") 'prelude-cleanup-buffer)
|
;; You know, like Readline.
|
||||||
|
(global-set-key (kbd "C-M-h") 'backward-kill-word)
|
||||||
|
|
||||||
;; Font size
|
;; Align your code in a pretty way.
|
||||||
(define-key global-map (kbd "C-+") 'text-scale-increase)
|
(global-set-key (kbd "C-x \\") 'align-regexp)
|
||||||
(define-key global-map (kbd "C--") 'text-scale-decrease)
|
|
||||||
|
|
||||||
;; Jump to a definition in the current file. (This is awesome.)
|
;; Perform general cleanup.
|
||||||
(global-set-key (kbd "M-i") 'prelude-ido-goto-symbol)
|
(global-set-key (kbd "C-c n") 'prelude-cleanup-buffer)
|
||||||
|
|
||||||
;; File finding
|
;; Font size
|
||||||
(global-set-key (kbd "C-x f") 'prelude-recentf-ido-find-file)
|
(define-key global-map (kbd "C-+") 'text-scale-increase)
|
||||||
(global-set-key (kbd "C-c r") 'bury-buffer)
|
(define-key global-map (kbd "C--") 'text-scale-decrease)
|
||||||
(global-set-key (kbd "M-`") 'file-cache-minibuffer-complete)
|
|
||||||
|
|
||||||
;; Window switching. (C-x o goes to the next window)
|
;; Jump to a definition in the current file. (This is awesome.)
|
||||||
(global-set-key (kbd "C-x O") (lambda ()
|
(global-set-key (kbd "M-i") 'prelude-ido-goto-symbol)
|
||||||
|
|
||||||
|
;; File finding
|
||||||
|
(global-set-key (kbd "C-x f") 'prelude-recentf-ido-find-file)
|
||||||
|
(global-set-key (kbd "C-c r") 'bury-buffer)
|
||||||
|
(global-set-key (kbd "M-`") 'file-cache-minibuffer-complete)
|
||||||
|
|
||||||
|
;; Window switching. (C-x o goes to the next window)
|
||||||
|
(global-set-key (kbd "C-x O") (lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(other-window -1))) ;; back one
|
(other-window -1))) ;; back one
|
||||||
|
|
||||||
;; Indentation help
|
;; Indentation help
|
||||||
(global-set-key (kbd "C-x ^") 'join-line)
|
(global-set-key (kbd "C-x ^") 'join-line)
|
||||||
(global-set-key (kbd "C-M-\\") 'prelude-indent-region-or-buffer)
|
(global-set-key (kbd "C-M-\\") 'prelude-indent-region-or-buffer)
|
||||||
|
|
||||||
;; Start proced in a similar manner to dired
|
;; Start proced in a similar manner to dired
|
||||||
(global-set-key (kbd "C-x p") 'proced)
|
(global-set-key (kbd "C-x p") 'proced)
|
||||||
|
|
||||||
;; Start eshell or switch to it if it's active.
|
;; Start eshell or switch to it if it's active.
|
||||||
(global-set-key (kbd "C-x m") 'eshell)
|
(global-set-key (kbd "C-x m") 'eshell)
|
||||||
|
|
||||||
;; Start a new eshell even if one is active.
|
;; Start a new eshell even if one is active.
|
||||||
(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t)))
|
(global-set-key (kbd "C-x M") (lambda () (interactive) (eshell t)))
|
||||||
|
|
||||||
;; Start a regular shell if you prefer that.
|
;; Start a regular shell if you prefer that.
|
||||||
(global-set-key (kbd "C-x M-m") 'shell)
|
(global-set-key (kbd "C-x M-m") 'shell)
|
||||||
|
|
||||||
;; If you want to be able to M-x without meta
|
;; If you want to be able to M-x without meta
|
||||||
(global-set-key (kbd "C-x C-m") 'execute-extended-command)
|
(global-set-key (kbd "C-x C-m") 'execute-extended-command)
|
||||||
|
|
||||||
;; Fetch the contents at a URL, display it raw.
|
;; Fetch the contents at a URL, display it raw.
|
||||||
(global-set-key (kbd "C-x C-h") 'prelude-view-url)
|
(global-set-key (kbd "C-x C-h") 'prelude-view-url)
|
||||||
|
|
||||||
;; A complementary binding to the apropos-command(C-h a)
|
;; A complementary binding to the apropos-command(C-h a)
|
||||||
(global-set-key (kbd "C-h A") 'apropos)
|
(global-set-key (kbd "C-h A") 'apropos)
|
||||||
|
|
||||||
;; Should be able to eval-and-replace anywhere.
|
;; Should be able to eval-and-replace anywhere.
|
||||||
(global-set-key (kbd "C-c e") 'prelude-eval-and-replace)
|
(global-set-key (kbd "C-c e") 'prelude-eval-and-replace)
|
||||||
|
|
||||||
;; Magit rules!
|
;; Magit rules!
|
||||||
(global-set-key (kbd "C-x g") 'magit-status)
|
(global-set-key (kbd "C-x g") 'magit-status)
|
||||||
|
|
||||||
;; Activate occur easily inside isearch
|
;; Activate occur easily inside isearch
|
||||||
(define-key isearch-mode-map (kbd "C-o")
|
(define-key isearch-mode-map (kbd "C-o")
|
||||||
(lambda () (interactive)
|
(lambda () (interactive)
|
||||||
(let ((case-fold-search isearch-case-fold-search))
|
(let ((case-fold-search isearch-case-fold-search))
|
||||||
(occur (if isearch-regexp
|
(occur (if isearch-regexp
|
||||||
isearch-string
|
isearch-string
|
||||||
(regexp-quote isearch-string))))))
|
(regexp-quote isearch-string))))))
|
||||||
|
|
||||||
;; cycle through buffers
|
;; cycle through buffers
|
||||||
(global-set-key (kbd "<C-tab>") 'bury-buffer)
|
(global-set-key (kbd "<C-tab>") 'bury-buffer)
|
||||||
|
|
||||||
;; use hippie-expand instead of dabbrev
|
;; use hippie-expand instead of dabbrev
|
||||||
(global-set-key (kbd "M-/") 'hippie-expand)
|
(global-set-key (kbd "M-/") 'hippie-expand)
|
||||||
|
|
||||||
;; spell check Bulgarian text
|
;; spell check Bulgarian text
|
||||||
(global-set-key (kbd "C-c B")
|
(global-set-key (kbd "C-c B")
|
||||||
(lambda()(interactive)
|
(lambda()(interactive)
|
||||||
(ispell-change-dictionary "bulgarian")
|
(ispell-change-dictionary "bulgarian")
|
||||||
(flyspell-buffer)))
|
(flyspell-buffer)))
|
||||||
|
|
||||||
;; replace buffer-menu with ibuffer
|
;; replace buffer-menu with ibuffer
|
||||||
(global-set-key (kbd "C-x C-b") 'ibuffer)
|
(global-set-key (kbd "C-x C-b") 'ibuffer)
|
||||||
|
|
||||||
;; swap windows
|
;; swap windows
|
||||||
(global-set-key (kbd "C-c s") 'prelude-swap-windows)
|
(global-set-key (kbd "C-c s") 'prelude-swap-windows)
|
||||||
|
|
||||||
;; duplicate the current line or region
|
;; duplicate the current line or region
|
||||||
(global-set-key (kbd "C-c d") 'prelude-duplicate-current-line-or-region)
|
(global-set-key (kbd "C-c d") 'prelude-duplicate-current-line-or-region)
|
||||||
|
|
||||||
;; rename buffer & visited file
|
;; rename buffer & visited file
|
||||||
(global-set-key (kbd "C-c r") 'prelude-rename-file-and-buffer)
|
(global-set-key (kbd "C-c r") 'prelude-rename-file-and-buffer)
|
||||||
|
|
||||||
;; open an ansi-term buffer
|
;; open an ansi-term buffer
|
||||||
(global-set-key (kbd "C-x t") 'prelude-visit-term-buffer)
|
(global-set-key (kbd "C-x t") 'prelude-visit-term-buffer)
|
||||||
|
|
||||||
;; toggle input method
|
;; toggle input method
|
||||||
(global-set-key (kbd "C-\\") 'prelude-toggle-bulgarian-input-method)
|
(global-set-key (kbd "C-\\") 'prelude-toggle-bulgarian-input-method)
|
||||||
|
|
||||||
;; search with google
|
;; search with google
|
||||||
(global-set-key (kbd "C-c g") 'prelude-google)
|
(global-set-key (kbd "C-c g") 'prelude-google)
|
||||||
|
|
||||||
;; toggle menu-bar visibility
|
;; toggle menu-bar visibility
|
||||||
(global-set-key (kbd "<f12>") 'menu-bar-mode)
|
(global-set-key (kbd "<f12>") 'menu-bar-mode))
|
||||||
|
|
||||||
;; real Emacs hackers don't use the arrow keys
|
(when prelude-disable-arrow-navigation
|
||||||
(global-set-key (kbd "<up>") (lambda ()
|
;; real Emacs hackers don't use the arrow keys
|
||||||
|
(global-set-key (kbd "<up>") (lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(message "Arrow key navigation is disabled. Use C-p instead.")))
|
(message "Arrow key navigation is disabled. Use C-p instead.")))
|
||||||
(global-set-key (kbd "<down>") (lambda ()
|
(global-set-key (kbd "<down>") (lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(message "Arrow key navigation is disabled. Use C-n instead.")))
|
(message "Arrow key navigation is disabled. Use C-n instead.")))
|
||||||
(global-set-key (kbd "<left>") (lambda ()
|
(global-set-key (kbd "<left>") (lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(message "Arrow key navigation is disabled. Use C-b instead.")))
|
(message "Arrow key navigation is disabled. Use C-b instead.")))
|
||||||
(global-set-key (kbd "<right>") (lambda ()
|
(global-set-key (kbd "<right>") (lambda ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(message "Arrow key navigation is disabled. Use C-f instead.")))
|
(message "Arrow key navigation is disabled. Use C-f instead."))))
|
||||||
|
|
||||||
(provide 'prelude-global-keybindings)
|
(provide 'prelude-global-keybindings)
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,15 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(defgroup perl nil
|
||||||
|
"Emacs Prelude Perl support."
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
|
(defcustom prelude-enable-perl-hook t
|
||||||
|
"Enable Prelude's Perl hook"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'perl)
|
||||||
|
|
||||||
;; use cperl-mode instead of perl-mode
|
;; use cperl-mode instead of perl-mode
|
||||||
(defalias 'perl-mode 'cperl-mode)
|
(defalias 'perl-mode 'cperl-mode)
|
||||||
|
|
||||||
|
@ -56,7 +65,8 @@
|
||||||
(set-face-background 'cperl-hash-face nil)
|
(set-face-background 'cperl-hash-face nil)
|
||||||
(setq cperl-invalid-face nil))
|
(setq cperl-invalid-face nil))
|
||||||
|
|
||||||
(add-hook 'cperl-mode-hook 'prelude-cperl-mode-hook t)
|
(when prelude-enable-perl-hook
|
||||||
|
(add-hook 'cperl-mode-hook 'prelude-cperl-mode-hook t))
|
||||||
|
|
||||||
(provide 'prelude-perl)
|
(provide 'prelude-perl)
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,15 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
(defgroup ruby nil
|
||||||
|
"Emacs Prelude Ruby support"
|
||||||
|
:group 'prelude)
|
||||||
|
|
||||||
|
(defcustom prelude-enable-ruby-hook t
|
||||||
|
"Enable Prelude's Ruby hook"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'ruby)
|
||||||
|
|
||||||
;; Rake files are ruby, too, as are gemspecs, rackup files, and gemfiles.
|
;; Rake files are ruby, too, as are gemspecs, rackup files, and gemfiles.
|
||||||
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
|
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
|
||||||
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
|
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
|
||||||
|
@ -63,7 +72,8 @@
|
||||||
(ruby-block-mode t)
|
(ruby-block-mode t)
|
||||||
(local-set-key (kbd "C-h r") 'yari))
|
(local-set-key (kbd "C-h r") 'yari))
|
||||||
|
|
||||||
(add-hook 'ruby-mode-hook 'prelude-ruby-mode-hook)
|
(when prelude-enable-ruby-hook
|
||||||
|
(add-hook 'ruby-mode-hook 'prelude-ruby-mode-hook))
|
||||||
|
|
||||||
(require 'haml-mode)
|
(require 'haml-mode)
|
||||||
(require 'scss-mode)
|
(require 'scss-mode)
|
||||||
|
|
|
@ -33,34 +33,68 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;; the toolbar is just a waste of valuable screen estate
|
;; customization
|
||||||
(tool-bar-mode -1)
|
(defgroup ui nil
|
||||||
;; the menu bar is mostly useless as well
|
"Emacs Prelude UI"
|
||||||
;; but removing it under OS X doesn't make much sense
|
:group 'prelude)
|
||||||
(unless (string= system-type "darwin")
|
|
||||||
|
(defcustom prelude-use-minimalistic-ui t
|
||||||
|
"If set to true Prelude will dispense of most the UI that's mouse related -
|
||||||
|
menu bar, tool bar, etc"
|
||||||
|
:type 'boolean
|
||||||
|
:group 'ui)
|
||||||
|
|
||||||
|
(defcustom prelude-use-smooth-scrolling t
|
||||||
|
"Overrides the default scrolling behavior with a much more common one."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'ui)
|
||||||
|
|
||||||
|
(defcustom prelude-use-default-prelude-theme t
|
||||||
|
"If set to true Prelude will load up its default theme (Zenburn),
|
||||||
|
instead of Emacs's default theme."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'ui)
|
||||||
|
|
||||||
|
(defcustom prelude-enhance-modeline t
|
||||||
|
"If set to true Prelude will augment the default modeline settings."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'ui)
|
||||||
|
|
||||||
|
|
||||||
|
(when prelude-use-minimalistic-ui
|
||||||
|
;; the toolbar is just a waste of valuable screen estate
|
||||||
|
(tool-bar-mode -1)
|
||||||
|
;; the menu bar is mostly useless as well
|
||||||
|
;; but removing it under OS X doesn't make much sense
|
||||||
|
(unless (string= system-type "darwin")
|
||||||
(menu-bar-mode -1))
|
(menu-bar-mode -1))
|
||||||
;; the blinking cursor is nothing, but an annoyance
|
;; the blinking cursor is nothing, but an annoyance
|
||||||
(blink-cursor-mode -1)
|
(blink-cursor-mode -1)
|
||||||
|
|
||||||
;; disable startup screen
|
;; disable startup screen
|
||||||
(setq inhibit-startup-screen t)
|
(setq inhibit-startup-screen t))
|
||||||
|
|
||||||
;; nice scrolling
|
|
||||||
(setq scroll-margin 0
|
(when prelude-use-smooth-scrolling
|
||||||
|
;; nice scrolling
|
||||||
|
(setq scroll-margin 0
|
||||||
scroll-conservatively 100000
|
scroll-conservatively 100000
|
||||||
scroll-preserve-screen-position 1)
|
scroll-preserve-screen-position 1))
|
||||||
|
|
||||||
;; mode line settings
|
(when prelude-enhance-modeline
|
||||||
(line-number-mode t)
|
;; mode line settings
|
||||||
(column-number-mode t)
|
(line-number-mode t)
|
||||||
(size-indication-mode t)
|
(column-number-mode t)
|
||||||
|
(size-indication-mode t))
|
||||||
|
|
||||||
;; enable y/n answers
|
;; enable y/n answers
|
||||||
(fset 'yes-or-no-p 'y-or-n-p)
|
(fset 'yes-or-no-p 'y-or-n-p)
|
||||||
|
|
||||||
;; custom Emacs 24 color themes support
|
;; custom Emacs 24 color themes support
|
||||||
(add-to-list 'custom-theme-load-path (concat prelude-dir "themes/"))
|
(add-to-list 'custom-theme-load-path (concat prelude-dir "themes/"))
|
||||||
(load-theme 'zenburn t)
|
|
||||||
|
(when prelude-use-default-prelude-theme
|
||||||
|
(load-theme 'zenburn t))
|
||||||
|
|
||||||
(provide 'prelude-ui)
|
(provide 'prelude-ui)
|
||||||
;;; prelude-ui.el ends here
|
;;; prelude-ui.el ends here
|
||||||
|
|
Loading…
Reference in a new issue