的問題是,邪惡的增量搜索是在正 - 執行狀態,據我所知,它不能用於輸入法。這是一種快速入侵,在執行搜索之前切換到插入狀態以允許使用輸入方法。由於搜索結束後立即切換回正常狀態,因此在執行搜索時,唯一的怪癖是緩衝區中的不同光標。
(evil-define-motion evil-search-forward()
(format "Search forward for user-entered text.
Searches for regular expression if `evil-regexp-search' is t.%s"
(if (and (fboundp 'isearch-forward)
(documentation 'isearch-forward))
(format "\n\nBelow is the documentation string \
for `isearch-forward',\nwhich lists available keys:\n\n%s"
(documentation 'isearch-forward)) ""))
:jump t
:type exclusive
:repeat evil-repeat-search
(progn ;MADE CHANGES HERE
(evil-insert-state)
(evil-search-incrementally t evil-regexp-search)
(evil-normal-state)
))
(evil-define-motion evil-search-backward()
(format "Search forward for user-entered text.
Searches for regular expression if `evil-regexp-search' is t.%s"
(if (and (fboundp 'isearch-forward)
(documentation 'isearch-forward))
(format "\n\nBelow is the documentation string \
for `isearch-forward',\nwhich lists available keys:\n\n%s"
(documentation 'isearch-forward)) ""))
:jump t
:type exclusive
:repeat evil-repeat-search
(progn ;MADE CHANGES HERE
(evil-insert-state)
(evil-search-incrementally nil evil-regexp-search)
(evil-normal-state)
))
C-h f切換輸入法應該有所幫助。 – aartist 2013-04-03 14:17:44
這對我來說很好。你在使用香草搜索嗎?如果您使用'-Q'啓動emacs,它會起作用嗎? – Thomas 2013-04-04 01:01:58
@Thomas我道歉,我的問題實際上更復雜,我想,我已經更新了這個問題來反映這一點。上面的解決方案在vanilla emacs中確實工作正常,但它在EVIL中不起作用。 – 2013-04-04 17:28:37