|
From: | Alex Wei |
Subject: | Re: How to rebind keys "C-j" to join-line -- SOLVED! |
Date: | Wed, 8 Aug 2007 10:27:06 +0800 |
Hi H. Dieter Wilhelm
Thanks for disgussing, your understandings are almost right.
for
C-o -- Yes, just C-e <RET>, the same effect as
Vim's o command
C-- -- Kill whole line, same as C-a C-k C-k, kill whole
line along with the last carriage return.
C-= -- Yes, I define it as copy whole line, the same effect as
Vim's yy command
C-. -- Why binding this to set-mark-command, and not C-SPC, because
It was defined by Windows to activate IME.
Why hook it up? Because other scripts override my key bindings after Emacs
startup, .emacs was executed the first.
Appending my codes for your reference.
(defun copy-whole-line ()
"copy line" (interactive) (setq end-pos (if (< (line-end-position) (point-max)) (+ 1 (line-end-position)) (point-max))) (copy-region-as-kill (line-beginning-position) end-pos) (message "line copied.") ) (defun kill-whole-line ()
"cut line" (interactive) (setq end-pos (if (< (line-end-position) (point-max)) (+ 1 (line-end-position)) (point-max))) (kill-region (line-beginning-position) end-pos) ) (defun open-newline ()
"open newline below and place the cursor at newline." (interactive) (goto-char (line-end-position)) (newline-and-indent) ) Best Regards
Alex Wei
Sierra Atlantic
|
[Prev in Thread] | Current Thread | [Next in Thread] |