(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...
(defun occur/copy-curr-line () (interactive) (let* ((rawline (buffer-substring-no-properties (line-beginning-position) (line-beginning-position 2))) (line (string-trim-left rawline "[ 0-9]+:"))) (kill-new line) (message "Copied current line."))) (define-key occur-mode-map "y...
例如,很多用户习惯让Emacs启动时自动从其官方插件仓库https://elpa.gnu.org下载安装插件.当改网站偶尔下线或者公司的防火墙拦截了对外网站访问时,Emacs就会启动失败. 这也就是一分钟可以解决的小事,如果你理解软件自由, 有勇气 到~/.emacs.d/elpa/目录下看一看的话。 我不明白为什么年年会有那么多人对此长篇大论的...
copylinesdown 复制一行的内容,并将复制的内容粘贴到上一行 Command-Option-Up copylinesup 删除一个字符 Delete | Control-Delete | Shift-Delete del 复制选定的内容,并在选择后立即粘贴复制的内容 Command-Shift-D duplicateSelection 将当前行的内容包含在选定内容中 Command-Shift-L expandtoline 将...
kill-line 剪切行的整数 数目。如果是 0,剪切从光标到该行开头的全部内容;如果是负数,则反向剪切。 M-k kill-sentence 剪切从光标到句子的结尾处的内容。 M-z zap-to-char 删除从光标到指定的字符之间的所有文本。 M-y yank-pop 移动到剪切环中的下一个槽位。 M-(num) C-y yank 粘贴剪切环中指定槽...
(fboundp'cua-copy-region-to-global-mark)(cua--global-mark-active))(cua-copy-region-to-global-markbeg end))((eqtype'block)(evil-yank-rectanglebeg end register yank-handler))((eqtype'line)(evil-yank-linesbeg end register yank-handler))(t(evil-yank-charactersbeg end register yank-handler...
copylinesup 刪除一個空格 Delete | Control-Delete | Shift-Delete del 複製選取項目的內容,並立即在選取項目的後方貼上複製的內容 Command-Shift-D duplicateSelection 將目前行的內容納入選取項目 Command-Shift-L expandtoline 將直到下一個相符符號的內容納入選取項目 Control-Shift-M expandToMatching...
(defun lmintmate/kill-ring-save-line-trim () "Copy current line in kill-ring, trimming begining spaces and tabs" (interactive) (beginning-of-line) (kill-ring-save (progn (skip-chars-forward " \t") (point)) (line-beginning-position 2)) (beginning-of-line)) Command to copy the selec...
所有的函数都可以从迷你缓冲区(Emacs 框架底部的命令行)执行。理论上,你甚至可以通过键入forward-word和backward-word以及next-line和previous-line等函数来导航光标。这肯定是无比低效的,但这就是一种直接访问你运行的代码的方式。在某种程度上,Emacs 就是自己的API。
Edit.EmacsLineOpen CTRL + O Inserts a new line after the cursor. The cursor stays in the current line. Edit.EmacsQuotedInsert CTRL + Q Reads another key and inserts the key into the buffer. Keys must be 8-bit ASCII characters. Use this command to insert control characters, meta character...