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)。结帐:) –