有人請給我一隻手重映射org-shiftmetaright
| org-shiftmetaleft
至[shift-select-meta]left-word
| [shift-select-meta]right-word]
。我們的目標是在組織模式下一舉突出選擇區域(右側或左側),而不是改變標題的級別。當我釋放輪班時不會突出顯示,但仍然可以將整個單詞向左或向右跳。重映射org-shiftmetaright | org-shiftmetaleft爲[shift-select-meta]左字| [shift-select-meta] right-word]
我會想象left-word
和right-word
可能有在交互式命令,或者類似的東西插入符號"^"
,因此對於左移位字或右移字沒有獨立的功能。
(defvar custom-keys-mode-map (make-keymap) "custom-keys-mode keymap.")
(define-minor-mode custom-keys-mode
"A minor mode so that my key settings override annoying major modes."
t " my-keys" 'custom-keys-mode-map)
(custom-keys-mode 1)
(defun my-minibuffer-setup-hook()
(custom-keys-mode 0))
(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
(defadvice load (after give-my-keybindings-priority)
"Try to ensure that my keybindings always have priority."
(if (not (eq (car (car minor-mode-map-alist)) 'custom-keys-mode))
(let ((mykeys (assq 'custom-keys-mode minor-mode-map-alist)))
(assq-delete-all 'custom-keys-mode minor-mode-map-alist)
(add-to-list 'minor-mode-map-alist mykeys))))
(ad-activate 'load)
;; (define-key custom-keys-mode-map (kbd "<C-key>") 'some-command)
(define-key custom-keys-mode-map (kbd "M-<left>") 'left-word)
(define-key custom-keys-mode-map (kbd "M-<right>") 'right-word)
(define-key custom-keys-mode-map (kbd "M-S-<left>") 'left-word)
(define-key custom-keys-mode-map (kbd "M-S-<right>") 'right-word)
編輯:這裏是bindings.el我希望看到在使用組織模式的功能:
(defun right-word (&optional n)
"Move point N words to the right (to the left if N is negative).
Depending on the bidirectional context, this may move either forward
or backward in the buffer. This is in contrast with \\[forward-word]
and \\[backward-word], which see.
Value is normally t.
If an edge of the buffer or a field boundary is reached, point is left there
there and the function returns nil. Field boundaries are not noticed
if `inhibit-field-text-motion' is non-nil."
(interactive "^p")
(if (eq (current-bidi-paragraph-direction) 'left-to-right)
(forward-word n)
(backward-word n)))
(defun left-word (&optional n)
"Move point N words to the left (to the right if N is negative).
Depending on the bidirectional context, this may move either backward
or forward in the buffer. This is in contrast with \\[backward-word]
and \\[forward-word], which see.
Value is normally t.
If an edge of the buffer or a field boundary is reached, point is left there
there and the function returns nil. Field boundaries are not noticed
if `inhibit-field-text-motion' is non-nil."
(interactive "^p")
(if (eq (current-bidi-paragraph-direction) 'left-to-right)
(backward-word n)
(forward-word n)))
'org-shiftmetaleft'是一個函數。 '[shift-select-meta] left-word'是...? – phils
這就是我說的方式:shift + alt + left和shift + alt + right這些是在OSX上向左或向右突出顯示/選擇一個單詞的方式,我也認爲Windows也是如此(但自從我'已經使用該操作系統)。從本質上講,我只需要禁用這些鍵的組織模式映射,而我以前的禁用嘗試都不起作用,所以我想重新映射。 – lawlist
更好地使用'C-h k'或'C-h c'來詢問Emacs如何表示鍵。在這種情況下''。 –
phils