0
我試圖在我的.emacs中創建一個函數,以在邪惡模式下綁定到kbd「*」,以便像在vim中一樣突出顯示光標下的單詞。emacs在光標下突出顯示單詞
我修改從腳本: http://www.emacswiki.org/emacs/SearchAtPoint
這是我有:
(defun isearch-yank-regexp (regexp)
"Pull REGEXP into search regexp."
(let ((isearch-regexp nil)) ;; Dynamic binding of global.
(isearch-yank-string regexp))
(if (not isearch-regexp)
(isearch-toggle-regexp))
(isearch-search-and-update))
(defun isearch-yank-symbol()
"Put symbol at current point into search string."
(interactive)
(let ((sym (highlight-regexp)))
(if (null sym)
(message "No symbol at point")
(isearch-yank-regexp
(concat "\\_<" (regexp-quote sym) "\\_>")) 'hi-yellow)))
似乎有一些錯誤的位置:
let: Wrong number of arguments: #[(regexp &optional face)
我是一個口齒不清的新手。
你能幫我解決這個問題嗎?
你已經用0個參數調用了'highlight-regexp',而它至少需要1.使用'f1 f'來讀取'highlight-regexp'的函數doc –
你能解釋爲什麼默認*不適合你的需求?它已經突出顯示單詞下的單詞並向前搜索。另外,你可以延長突出顯示的時間(setq evil-flash-delay 10)。 – Ehvince
我想這與[this]類似(http://stackoverflow.com/a/387877/4247851)。結帳:) –