copy-word,copy-line,copy-paragraph,copy-string这些我们最常用的就不用介绍了,有时候需要copy一行中的一半怎么办呢,今天写了两个函数.方便多了.
;;for copying curr position to begin of line
;;author:Created 2008-05-16 by qingwu
(defun copy-curr-position-to-begin-of-line (&optional arg)
"Copy curr position to begin of line string into kill-ring."
(interactive)
(let ((beg (point))
(end (line-beginning-position)))
(copy-region-as-kill beg end))
)
(global-set-key (kbd "C-c b") 'copy-curr-position-to-begin-of-line)
;;for copying end to curr position of line.
(defun copy-curr-position-to-end-of-line (&optional arg)
"Copy curr position to end of line string into kill-ring."
(interactive)
(let ((beg (point))
(end (line-beginning-position)))
(copy-region-as-kill beg end))
)
(global-set-key (kbd "C-c f") 'copy-curr-position-to-end-of-line)
阅读(624) | 评论(0) | 转发(0) |