当您使用大量括号时,有推荐的输入方法吗?

发布于 2024-12-27 04:53:48 字数 132 浏览 2 评论 0原文

对我来说输入很多括号很尴尬,比如 ()[] {} 来得更自然一些。有人在处理大量括号时映射他们的键或做任何事情吗?一般提示值得赞赏,如果它有助于了解我经常使用 Vim。

It's awkward to type a lot of parentheses for me, as in (). [] {} come a little more naturally. Does anyone map their keys or do anything when dealing with a lot of parentheses? General tips are appreciated, and if it helps to know I use Vim regularly.

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

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

发布评论

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

评论(2

捎一片雪花 2025-01-03 04:53:48

我提供的最好建议是使用 dvorak 的程序员版本。学习需要一些工作,但它完全解决了您正在谈论的问题。

这是链接

一些文本编辑器会自动添加右括号、方括号或其他内容。我喜欢这个来帮助解决你所说的问题。

The best advice I'd offer is to use programmer version of dvorak. It would take a little work to learn but it solves exactly the problem you are talking about.

Here is the link

Some text editors add the closing parenthese,brackets or what have you automatically. I like this to help with the problem you speak of.

情话墙 2025-01-03 04:53:48

我使用:

set timeoutlen=150
inoremap (( ()<ESC>i
inoremap [[ []<ESC>i
inoremap {{ {}<ESC>i
inoremap '' ''<ESC>i
inoremap "" ""<ESC>i

inoremap <C-SPACE> <ESC>la
inoremap <S-TAB> <ESC>A

第一部分让我快速输入一对括号或其他内容,第二部分帮助我快速走出去。
您必须根据您的打字速度调整超时长度。

例如获取:
someMethod($a['key']) 我输入 someMethod(($a[[''key
然后按 Shift+Tab 转到行尾,或按 Shift+空格 仅跳过一个字符。对我来说有点容易。

I use:

set timeoutlen=150
inoremap (( ()<ESC>i
inoremap [[ []<ESC>i
inoremap {{ {}<ESC>i
inoremap '' ''<ESC>i
inoremap "" ""<ESC>i

inoremap <C-SPACE> <ESC>la
inoremap <S-TAB> <ESC>A

First part lets me type fast pairs of parentheses or others, second helps to fast go outside.
You have to adjust timeoutlen to your typing speed.

For example to get:
someMethod($a['key']) I type someMethod(($a[[''key
and then Shift+tab to go to the end of line or shift+space to skip just one char. For me its a bit easier.

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