Browse Source

Minor refactoring

custom
Bozhidar Batsov 13 years ago
parent
commit
3d24efbb65
  1. 6
      core/prelude-core.el
  2. 2
      core/prelude-mode.el

6
core/prelude-core.el

@ -79,14 +79,12 @@
(indent-rigidly (point-min) (point-max) arg) (indent-rigidly (point-min) (point-max) arg)
(clipboard-kill-ring-save (point-min) (point-max))))) (clipboard-kill-ring-save (point-min) (point-max)))))
(defun prelude-insert-empty-line ()
(defun prelude-smart-open-line ()
"Insert an empty line after the current line. "Insert an empty line after the current line.
Position the cursor at its beginning, according to the current mode." Position the cursor at its beginning, according to the current mode."
(interactive) (interactive)
(move-end-of-line nil) (move-end-of-line nil)
(open-line 1)
(forward-line 1)
(indent-according-to-mode))
(newline-and-indent))
(defun prelude-move-line-up () (defun prelude-move-line-up ()
"Move up the current line." "Move up the current line."

2
core/prelude-mode.el

@ -38,7 +38,7 @@
(define-key map (kbd "C-c o") 'prelude-open-with) (define-key map (kbd "C-c o") 'prelude-open-with)
(define-key map (kbd "C-c g") 'prelude-google) (define-key map (kbd "C-c g") 'prelude-google)
;; mimic popular IDEs binding, note that it doesn't work in a terminal session ;; mimic popular IDEs binding, note that it doesn't work in a terminal session
(define-key map [(shift return)] 'prelude-insert-empty-line)
(define-key map [(shift return)] 'prelude-smart-open-line)
(define-key map [(control shift up)] 'prelude-move-line-up) (define-key map [(control shift up)] 'prelude-move-line-up)
(define-key map [(control shift down)] 'prelude-move-line-down) (define-key map [(control shift down)] 'prelude-move-line-down)
(define-key map (kbd "C-c n") 'prelude-cleanup-buffer) (define-key map (kbd "C-c n") 'prelude-cleanup-buffer)

Loading…
Cancel
Save