Merge branch 'master' of github.com:bbatsov/prelude

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
Bozhidar Batsov 2013-04-02 12:14:31 +03:00
commit 1e10d763f3
3 changed files with 16 additions and 7 deletions

View file

@ -79,6 +79,13 @@
(indent-rigidly (point-min) (point-max) arg)
(clipboard-kill-ring-save (point-min) (point-max)))))
(defun prelude-smart-open-line-above ()
"Insert an empty line above the current line.
Position the cursor at it's beginning, according to the current mode"
(interactive)
(previous-line)
(prelude-smart-open-line))
(defun prelude-smart-open-line ()
"Insert an empty line after the current line.
Position the cursor at its beginning, according to the current mode."
@ -87,14 +94,14 @@ Position the cursor at its beginning, according to the current mode."
(newline-and-indent))
(defun prelude-move-line-up ()
"Move up the current line."
"Move the current line up."
(interactive)
(transpose-lines 1)
(forward-line -2)
(indent-according-to-mode))
(defun prelude-move-line-down ()
"Move down the current line."
"Move the current line down."
(interactive)
(forward-line 1)
(transpose-lines 1)

View file

@ -39,6 +39,7 @@
(define-key map (kbd "C-c g") 'prelude-google)
;; mimic popular IDEs binding, note that it doesn't work in a terminal session
(define-key map [(shift return)] 'prelude-smart-open-line)
(define-key map [(control shift return)] 'prelude-smart-open-line-above)
(define-key map [(control shift up)] 'prelude-move-line-up)
(define-key map [(control shift down)] 'prelude-move-line-down)
(define-key map [(meta shift up)] 'prelude-move-line-up)