emacs学习笔记
OlDman
posted @ 2010年9月21日 23:16
in emacs
, 1264 阅读
很高兴用emacs学习系列开始我的is-programer之旅。
先记录一下oio对于emacs复制黏贴的一组设置。
记录在oio-cc-cv.el中。在.emacs里load--
;; -*- 自定义复制黏贴 -*-
(defun copy-line (&optional arg)
"Save current line into Kill-Ring without mark the line"
(interactive "P")
(let ((beg (line-beginning-position))
(end (line-end-position arg)))
(copy-region-as-kill beg end))
)
(defun copy-word (&optional arg)
"Copy words at point"
(interactive "P")
(let ((beg (progn (if (looking-back "[a-zA-Z0-9]" 1) (backward-word 1)) (point)))
(end (progn (forward-word arg) (point))))
(copy-region-as-kill beg end))
)
(defun copy-paragraph (&optional arg)
"Copy paragraphes at point"
(interactive "P")
(let ((beg (progn (backward-paragraph 1) (point)))
(end (progn (forward-paragraph arg) (point))))
(copy-region-as-kill beg end))
)
(global-set-key (kbd "M-l") 'copy-line)
(global-set-key (kbd "M-w") 'copy-word)
(global-set-key (kbd "M-p") 'copy-paragraph)
;;codes ends here.....