将 <Shift>-箭头映射到选择字符/行 [英] Mapping <Shift>-Arrows to selecting characters/lines

查看:15
本文介绍了将 <Shift>-箭头映射到选择字符/行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用vim,但我想念其他文本编辑器的字符/行选择方法.默认情况下,vim 将 映射到向上/向下跳转一页,我想将它们重新映射到文本选择.>

有没有办法做到这一点?

解决方案

在我看来,Vim 并没有那么容易屈服.在我的情况下,终端机甚至无法识别 Shift-Up!我认为 v(按字符选择)或 V(按行选择)是更容易了解 vi/vim 的概念之一.

如果这有效(现在无法测试),这就是您想要的:

" 在正常模式下激活可视模式nmap <S-Up>伏nmap <S-Down>伏" 这些以可视模式映射vmap <S-Up>克vmap <S-Down>j""等等..." 类似的 <S-Left>, <S-Right> 对于 v

I started to use vim recently, but I miss the character/line selection methods from other text editors. By default vim maps <S-Up>, <S-Down> to jumping one page up/down and I want to remap these to text selection.

Is there a way to do that?

解决方案

Vim doesn't bend to that easily in my opinion. The terminal one doesn't even recognize Shift-Up in my case! I thought the v (character-wise selection) or V (line-wise selection) was among the easier concepts to learn about vi/vim.

If this works (can't test right now), this is something you'll want:

" activate visual mode in normal mode
nmap <S-Up> V
nmap <S-Down> V
" these are mapped in visual mode
vmap <S-Up> k
vmap <S-Down> j
" 
" etc...
" similarly <S-Left>, <S-Right> for v

这篇关于将 &lt;Shift&gt;-箭头映射到选择字符/行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆