Vim Dvorak 键绑定(重新绑定:)

发布于 2024-07-06 18:53:39 字数 254 浏览 10 评论 0原文

虽然我以前玩过它,但我终于开始定期使用 Dvorak(简体)。 我与 Vim 的关系已经好几年了,我正在尝试找出重新映射键绑定的最佳方法,以适应我新发现的 Dvorak 技能。

如何重新映射 Vim 的键绑定以最好地与 Dvorak 配合使用?

鼓励解释!

Although I played with it before, I'm finally starting to use Dvorak (Simplified) regularly. I've been in a steady relationship with Vim for several years now, and I'm trying to figure out the best way to remap the key bindings to suit my newfound Dvorak skills.

How do you remap Vim's key bindings to best work with Dvorak?

Explanations encouraged!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

扮仙女 2024-07-13 18:53:39

我使用一种常见推荐的键绑定

Dvorak it!
no d h
no h j
no t k
no n l
no s :
no S :
no j d
no l n
no L N
Added benefits
no - $
no _ ^
no N <C-w><C-w>
no T <C-w><C-r>
no H 8<Down>
no T 8<Up>
no D <C-w><C-r>

移动键保持在同一位置。 其他更改:

  • 删除“d”-> 垃圾 'j'
  • 下一个 'n' -> 查看“l”
  • 前一个“N”-> 回顾“L”

为了熟悉起见,还进行了一些更改,“s”/“S”可用于访问命令模式(: 的旧位置,仍然有效)。

添加的好处

  • 行尾 '$' -also- '-'
  • 行首 '^' -also- '_'
  • 上移 8 'T'
  • 下移 8 'H'
  • 下一个窗口 ; -also- 'N'
  • 交换窗口 -also- 'D'

-Adam

I use one of the more common recommended keybindings:

Dvorak it!
no d h
no h j
no t k
no n l
no s :
no S :
no j d
no l n
no L N
Added benefits
no - $
no _ ^
no N <C-w><C-w>
no T <C-w><C-r>
no H 8<Down>
no T 8<Up>
no D <C-w><C-r>

Movement keys stay in the same location. Other changes:

  • Delete 'd' -> Junk 'j'
  • Next 'n' -> Look 'l'
  • Previous 'N' -> Look Back 'L'

There were also some changes for familiarity, 's'/'S' can be used to access command mode (the old location of the :, which still works).

Added Benefits

  • End of line '$' -also- '-'
  • Beginning of line '^' -also- '_'
  • Move up 8 'T'
  • Move down 8 'H'
  • Next window <C-w><C-w> -also- 'N'
  • Swap windows <C-w><C-r> -also- 'D'

-Adam

蓝戈者 2024-07-13 18:53:39

我发现我不需要重新映射 Dvorak 的按键——当我切换布局时,我很快就习惯了使用默认的按键绑定。

作为奖励,这意味着当我在 Dvorak 和 Qwerty 之间切换时,我不必记住两个不同的组合键。 键盘布局的差异足以让我不希望按键位于相同的位置。

I don't find that I need to remap the keys for Dvorak -- I very quickly got used to using the default keybindings when I switched layouts.

As a bonus, it means that I don't have to remember two different key combinations when I switch between Dvorak and Qwerty. The difference in keyboard layout is enough that I'm not expecting keys to be in the same location.

说好的呢 2024-07-13 18:53:39

有点晚了,但我使用以下内容:

" dvorak remap
noremap h h
noremap t j
noremap n k
noremap s l
noremap l n
noremap L N

" easy access to beginning and end of line
noremap - $
noremap _ ^

这基本上执行以下操作:

  • 左-下-上-右都在主行上的默认手指位置下(即没有像默认 QWERTY Vim 映射中那样移动一个)
  • l /L 用于下一个/上一个搜索结果
  • 使用 -/_ 到达行的结尾/开头

这似乎对我有用......

A little late, but I use the following:

" dvorak remap
noremap h h
noremap t j
noremap n k
noremap s l
noremap l n
noremap L N

" easy access to beginning and end of line
noremap - $
noremap _ ^

This basically does the following:

  • left-down-up-right are all under the default finger positions on the home row (i.e. not moved over by one as in the default QWERTY Vim mappings)
  • l/L is used for next/previous search result
  • use -/_ to reach the end/beginning of a line

This seems to work for me...

喜爱皱眉﹌ 2024-07-13 18:53:39

我只是使用标准 qwerty 作为命令,使用 dvorak 作为插入模式。

这是如何设置

I simply use standard qwerty for commands and dvorak for insert mode

Here is how to set it up

小清晰的声音 2024-07-13 18:53:39

我的重新绑定:

noremap h h
noremap t j
noremap n k
noremap s l
noremap j t
noremap l n
noremap k s
noremap J T
noremap L N
noremap K S
noremap T J
noremap N L
noremap S K

注意:

  • 在 qwert 中,vi 必须使用 'h',因为 vi 不想使用 ';' 一个非字母。 但
    在 dvroak 中,我们有 's',那么为什么不利用这个优势呢?
  • vi 使用 Caps 来执行相对操作。 这是一个很好的设计理念。 所以我尝试
    符合这个。

含义:

n (Next) -> l (Left) -- "What's left?" resembles "What's next?"
s (Substitute) -> k (Kill then insert)
t (jump Till) -> j (Jump till)
N, S, T are similar.

J (Join lines) -> T (make lines Together)
K (Keyword) -> S (Subject)
L[count] (Line count) -> N (line Number)

BTW L 本身到最后一行,N 是 fin 的最后一个字母。
(感谢 tenzu 指出这一点。)

PS 我已经使用这些重新绑定一段时间了。 现在我不在 vim 中使用它。 我只使用默认的。

My rebindings:

noremap h h
noremap t j
noremap n k
noremap s l
noremap j t
noremap l n
noremap k s
noremap J T
noremap L N
noremap K S
noremap T J
noremap N L
noremap S K

Notes:

  • In qwert, vi has to use 'h', because vi doesn't want to use ';' a non-letter. But
    in dvroak, we have 's', so why not take this advantage?
  • vi uses Caps for relative actions. This is a good design philosophy. So I try to
    conform this.

Meanings:

n (Next) -> l (Left) -- "What's left?" resembles "What's next?"
s (Substitute) -> k (Kill then insert)
t (jump Till) -> j (Jump till)
N, S, T are similar.

J (Join lines) -> T (make lines Together)
K (Keyword) -> S (Subject)
L[count] (Line count) -> N (line Number)

B.T.W. L itself goes to the last line, and N is the last letter of fin.
(Thanks for tenzu to point out this.)

P.S. I have used these rebindings for a while. Now I does not use it in vim. I just use the default ones.

后知后觉 2024-07-13 18:53:39

Vim 附带了一个广泛的 Dvorak 脚本,但不幸的是它不能直接源码,因为该文件包含几行指令和另一个撤消其效果的脚本。 要读取它,请发出以下命令:

:e $VIMRUNTIME/macros/dvorak

Vim ships with an extensive Dvorak script, but unfortunately it’s not directly source-able, since the file includes a few lines of instructions and another script that undoes its effects. To read it, issue the following command:

:e $VIMRUNTIME/macros/dvorak
世俗缘 2024-07-13 18:53:39

你可以使用它让 Vim 仅在插入模式下使用 Dvorak:

:set keymap=dvorak

这样,所有命令仍采用 QWERTY 格式,但您键入的所有内容都将采用 Dvorak 格式。

注意事项:嗯,几乎所有事情。 插入模式、搜索模式和替换模式都将是 dvorak,但 ex 命令不会。 这意味着您不必重新学习 :wq,但需要在 QWERTY 中键入 :%s/foo/bar/gc

如果你只想移动某些命令,这将无济于事,但我发现在我的脑海中,“向前移动一个单词”必然是“向上移动左手无名指”,而不是“询问打字部门字母'在哪里” w' 是,然后按下它,”这使这个方法对我来说更容易。

You can use this to have Vim use Dvorak only in insert mode:

:set keymap=dvorak

This way all of the commands are still in QWERTY, but everything you type will be in Dvorak.

Caveats: Well, almost everything. Insert mode, search mode, and replace mode will all be dvorak, but ex commands will not. This means that you don't have to relearn :wq, but you will need type :%s/foo/bar/gc in QWERTY.

This won't help if you only want to move certain commands, but I found that in my head, "move forward one word" was bound to "move left ring finger up," rather than "ask the typing department where the letter 'w' is and then press it," which made this method much easier for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文