Q: How do I duplicate a whole line in vi?
A: yyp (lol)

Q: How do I duplicate a whole line in ATOM?
A: shift command d (wow)

Q: How do I duplicate a whole line in Emacs?
A: C-a C-k C-y C-m C-y C-a C-p (omg)

Therefore...

To your .emacs.d/init.el:
(global-set-key "\C-c\C-d" "\C-a\C-k\C-y\C-m\C-y\C-a\C-p")
or
(global-set-key "\C-c\C-d" "\C-a\C- \C-e\M-w\C-a\C-y\C-m\C-p")

Must-read

http://www.emacswiki.org/emacs/CopyingWholeLines

The much-beloved .emacs.d/init.el

; 7 Basics
(global-set-key "\C-h" 'backward-delete-char-untabify)
(global-set-key "\C-z" 'undo)
(global-set-key "\M-g" 'goto-line)
(setq next-line-add-newlines nil)
(setq require-final-newline t)
(setq line-number-mode nil)
(setq mc-verbose-code t)
; and tips...
; C-c C-d = Duplicate whole line
(global-set-key "\C-c\C-d" "\C-a\C-k\C-y\C-m\C-y\C-a\C-p")
;emacs tips                                                                     

; C-z でサスペンドはうっとうしいので封じる
; C-z は undo にしておく
; (global-set-key "\C-z" 'undo)
; サスペンドしてしまったら
; fg コマンドでジョブ復活してね (man fg)

; C-h でヘルプはうっとうしいので封じる
; C-h は backspase にしておく
; (global-set-key "\C-h" 'backward-delete-char-untabify) 

topic: macosx
first posted: 2015-12-07 13:06:40
last modified: 2015-12-29 21:19:15