我使用Colemak键盘布局和传统的Vim' hjkl'不舒服在我的.vimrc中,我添加了以下内容来替换' hjkl'与' neio' (而反之亦然)。
WITH {startPrice:50, delta:150} as params
MATCH (p:Product)
WHERE p.price >= params.startPrice
WITH params, p
ORDER BY p.price asc
WITH params, COLLECT(p) as products
WITH params, TAIL(products) as products, HEAD(products) as first
WHERE first.price <= params.startPrice + params.delta
WITH REDUCE(prods = [first], prod in products |
CASE WHEN prod.price <= LAST(prods).price + params.delta
THEN prods + prod
ELSE prods END) as products
RETURN products
如果可能,我如何在包含Spacemacs的Emacs中执行此操作?
答案 0 :(得分:3)
以下hjkl
evil-maps.el
(define-key evil-motion-state-map "h" 'evil-backward-char)
(define-key evil-motion-state-map "j" 'evil-next-line)
(define-key evil-motion-state-map "k" 'evil-previous-line)
(define-key evil-motion-state-map "l" 'evil-forward-char)
的约束方式。
init.el
您可以在hjkl
中使用自己的密钥添加类似的行,将路线绑定到您想要的任何键。您还需要重新绑定hjkl
,假设您不希望它们保留原始方向绑定。
编辑:将neio
替换为i
我相信您需要在o
中取消绑定evil-normal-state-map
和(define-key evil-normal-state-map "i" nil)
(define-key evil-normal-state-map "o" nil)
:
<div class="tabs tabs-style-topline">
<nav>
<ul>
<li><a href="#section-topline-1"><span>Overview</span></a></li>
<li><a href="#section-topline-2"><span>Register</span></a></li>
<li><a href="#section-topline-3"><span>Exhibitors</span></a></li>
</ul>
</nav>
<div class="content-wrap">
<section id="section-topline-1">Test 1</section>
<section id="section-topline-2">Test 2</section>
<section id="section-topline-3">Test 3</section>
</div><!-- /content -->
</div><!-- /tabs -->
答案 1 :(得分:1)
您还可以在.spacemacs中进行这些更改。我无法找到 evil-maps.el,但FAQ建议在user-config中更改它们。
(defun dotspacemacs/user-config ()
;; colemak config
;; Make evil-mode up/down operate in screen lines instead of logical lines
(define-key evil-normal-state-map "i" nil)
(define-key evil-normal-state-map "o" nil) ;;neio back,up,down,next
(define-key evil-motion-state-map "i" 'evil-next-visual-line)
(define-key evil-motion-state-map "e" 'evil-previous-visual-line)
(define-key evil-motion-state-map "n" 'evil-backward-char)
(define-key evil-motion-state-map "o" 'evil-forward-char)
;; Also in visual mode
(define-key evil-visual-state-map "i" 'evil-next-visual-line)
(define-key evil-visual-state-map "e" 'evil-previous-visual-line)
答案 2 :(得分:1)
hjkl
在colemak中为hnei
,而不是neio
。我明白为什么你可能想要使用neio
因为它会把所有箭头都放在你的手指下(而不是向左移一个位置),但这不一定是好事:向下/向上({{1}经常使用qwerty),使用两个最强的手指。
qwerty jk
(colemak hjkl
)实际上非常符合人体工程学,所以对我来说,使用colemak时保持这一点是有意义的。当然,学习多年的肌肉记忆是另一个坚持下去的理由。
保持hnei
导航并明智地处理后果正是我使用evil-colemak-basics包所实现的目标。您可能想查看其文档,因为它有关于设计的广泛文章。也许你甚至会最终使用它。 :)