小智 14
这是我从之前的 Stack Overflow 问题中学到的:
(defun smart-beginning-of-line ()
"Move point to first non-whitespace character or beginning-of-line.
Move point to the first non-whitespace character on this line.
If point was already at that position, move point to beginning of line."
(interactive)
(let ((oldpos (point)))
(back-to-indentation)
(and (= oldpos (point))
(beginning-of-line))))
(global-set-key [home] 'smart-beginning-of-line)
(global-set-key "\C-a" 'smart-beginning-of-line)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10728 次 |
| 最近记录: |