Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/bbatsov/prelude:
  enabled evil-visualstar by default
  Use the phrase 'open a line' in both tips
  Minor fix
  Update the section on Projectile's keybindings
  [Fix bbatsov#602] Associate .tpl files with web-mode
  [Fix bbatsov#604] Save only the current buffer on focus lost
  Add a shorter prefix for all Projectile commands
  Add god-mode
  Respect initial-major-mode creating scratch buffer
  Set buffer mode according to `auto-mode-alist'
  • Loading branch information
Caleb Epstein committed Jul 16, 2014
2 parents d802311 + ef381ed commit db30a4c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 24 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,8 @@ Keybinding | Description
<kbd>C-c p z</kbd> | Adds the currently visited to the cache.
<kbd>C-c p s</kbd> | Display a list of known projects you can switch to.

Prelude adds some extra keybindings:

Keybinding | Command
-------------------|------------------------------------------------------------
<kbd>Super-f</kbd> | Find file in project
<kbd>Super-d</kbd> | Find directory in project
<kbd>Super-g</kbd> | Run grep on project
<kbd>Super-p</kbd> | Switch projects
Prelude adds an extra keymap prefix `S-p` (`S` stands for
`Super`), so you can use `S-p` instead of `C-c p`.

If you ever forget any of Projectile's keybindings just do a:

Expand Down
9 changes: 4 additions & 5 deletions core/prelude-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,9 @@ Doesn't mess with special buffers."
(defun prelude-create-scratch-buffer ()
"Create a new scratch buffer."
(interactive)
(progn
(switch-to-buffer
(get-buffer-create (generate-new-buffer-name "*scratch*")))
(emacs-lisp-mode)))
(let ((buf (get-buffer-create (generate-new-buffer-name "*scratch*"))))
(set-buffer-major-mode buf)
(switch-to-buffer buf)))

(defvar prelude-tips
'("Press <C-c o> to open a file with external program."
Expand All @@ -392,7 +391,7 @@ Doesn't mess with special buffers."
"Press <C-x g> or <s-m> to run magit-status."
"Press <C-c D> to delete the current file and buffer."
"Press <C-c s> to swap two windows."
"Press <S-RET> or <M-o> to open a new beneath the current one."
"Press <S-RET> or <M-o> to open a line beneath the current one."
"Press <s-o> to open a line above the current one."
"Press <C-c C-z> in a Elisp buffer to launch an interactive Elisp shell."
"Press <C-Backspace> to kill a line backwards."
Expand Down
13 changes: 7 additions & 6 deletions core/prelude-editor.el
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ The body of the advice is in BODY."

(add-hook 'mouse-leave-buffer-hook 'prelude-auto-save-command)

;; Autosave buffers when focus is lost
(defun prelude-save-all-buffers ()
"Save all modified buffers, without prompts."
(save-some-buffers 'dont-ask))

(when (version<= "24.4" emacs-version)
(add-hook 'focus-out-hook 'prelude-save-all-buffers))
(add-hook 'focus-out-hook 'prelude-auto-save-command))

(defadvice set-buffer-major-mode (after set-major-mode activate compile)
"Set buffer major mode according to `auto-mode-alist'."
(let* ((name (buffer-name buffer))
(mode (assoc-default name auto-mode-alist 'string-match)))
(with-current-buffer buffer (if mode (funcall mode)))))

;; highlight the current line
(global-hl-line-mode +1)
Expand Down
8 changes: 3 additions & 5 deletions core/prelude-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@
(define-key map (kbd "C-c TAB") 'prelude-indent-rigidly-and-copy-to-clipboard)
(define-key map (kbd "C-c I") 'prelude-find-user-init-file)
(define-key map (kbd "C-c S") 'prelude-find-shell-init-file)
;; extra prefix for projectile
(define-key map (kbd "s-p") 'projectile-command-map)
;; make some use of the Super key
(define-key map [?\s-d] 'projectile-find-dir)
(define-key map [?\s-p] 'projectile-switch-project)
(define-key map [?\s-f] 'projectile-find-file)
(define-key map [?\s-g] 'projectile-grep)

(define-key map (kbd "s-g") 'god-mode)
(define-key map (kbd "s-r") 'prelude-recentf-ido-find-file)
(define-key map (kbd "s-j") 'prelude-top-join-line)
(define-key map (kbd "s-k") 'prelude-kill-whole-line)
Expand Down
1 change: 1 addition & 0 deletions core/prelude-packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
gist
gitconfig-mode
gitignore-mode
god-mode
grizzl
guru-mode
ov
Expand Down
2 changes: 2 additions & 0 deletions modules/prelude-evil.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

(prelude-require-packages '(evil goto-chg evil-surround evil-visualstar evil-numbers))

(require 'evil-visualstar)

(setq evil-mode-line-format 'before)

(setq evil-emacs-state-cursor '("red" box))
Expand Down
1 change: 1 addition & 0 deletions modules/prelude-web.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.blade\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
Expand Down

0 comments on commit db30a4c

Please sign in to comment.