From 4d15923e2c9fa06842ff9e39de5b00e6a1b9b00e Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 30 May 2013 16:50:55 +0300 Subject: [PATCH] Add new command `prelude-top-join-line` Saner version of the built-in `join-line`, that joins lines from the top to the bottom. --- README.md | 2 +- core/prelude-core.el | 5 +++++ core/prelude-global-keybindings.el | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 10aba2a..723abeb 100644 --- a/README.md +++ b/README.md @@ -197,7 +197,7 @@ Keybinding | Description C-+ | Increase font size(`text-scale-increase`). C-- | Decrease font size(`text-scale-decrease`). C-x O | Go back to previous window (the inverse of `other-window` (`C-x o`)). -C-x ^ | Join two lines into one(`join-line`). +M-^ | Join two lines into one(`prelude-top-join-line`). C-x p | Start `proced` (manage processes from Emacs; works only in Linux). C-x m | Start `eshell`. C-x M-m | Start your default shell. diff --git a/core/prelude-core.el b/core/prelude-core.el index 370e41b..efd8093 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -97,6 +97,11 @@ Position the cursor at its beginning, according to the current mode." (move-end-of-line nil) (newline-and-indent)) +(defun prelude-top-join-line () + "Join the current line with the line beneath it." + (interactive) + (delete-indentation 1)) + (defun prelude-move-line-up () "Move the current line up." (interactive) diff --git a/core/prelude-global-keybindings.el b/core/prelude-global-keybindings.el index 1cae597..0c0188f 100644 --- a/core/prelude-global-keybindings.el +++ b/core/prelude-global-keybindings.el @@ -45,7 +45,7 @@ (other-window -1))) ;; back one ;; Indentation help -(global-set-key (kbd "C-x ^") 'join-line) +(global-set-key (kbd "M-^") 'prelude-top-join-line) ;; Start proced in a similar manner to dired (global-set-key (kbd "C-x p") 'proced)