我使用的是PhpStorm 7.1.2和IdeaVim插件。
在插入模式下,我希望使用Shift + ArrowKey选择单词。然而,这个IdeaVim插件似乎阻止了这样做。我只能使用v键高亮显示命令模式中的单词。
shift+Home/End/PageDown/PageUp或shift+ctrl+arrowKeys都不能正常工作。
我尝试在Keymap设置中更改快捷方式(即选择向右选择=> shift+right),但没有奏效。
我有什么办法可以实现这种非暴力行为吗?
更新1
在他们的臭虫追踪系统中打开了一张没有任何补丁的票。所以我想我不能像我上面描述的那样。
更新2 (11/14/2019)
从bug票证中的这是最后一个评论中,ideaVim现在支持这个shift+arrowKeys选择。在问了这个问题几年后,我从intellij转到了纯vim,所以我不会尝试这个问题,我只想更新这个问题以确保完整。并在撰写此更新后看到@citizenmatt的答复,因此有关此更新的更多细节,请参见下面@citizenmatt的答复。
发布于 2015-07-30 03:06:02
我将使用以下行创建一个~/.ideavimrc
nmap <S-Up> v<Up>
nmap <S-Down> v<Down>
nmap <S-Left> v<Left>
nmap <S-Right> v<Right>
vmap <S-Up> <Up>
vmap <S-Down> <Down>
vmap <S-Left> <Left>
vmap <S-Right> <Right>
imap <S-Up> <Esc>v<Up>
imap <S-Down> <Esc>v<Down>
imap <S-Left> <Esc>v<Left>
imap <S-Right> <Esc>v<Right>它使我的代码以相同的方式选择文本。
发布于 2017-04-17 08:48:38
使用以下行创建~/..ideavimrc文件
nnoremap <S-Left> :action EditorLeftWithSelection<CR>
nnoremap <S-Right> :action EditorRightWithSelection<CR>
nnoremap <S-Up> :action EditorUpWithSelection<CR>
nnoremap <S-Down> :action EditorDownWithSelection<CR>
inoremap <S-Left> <C-O>:action EditorLeftWithSelection<CR>
inoremap <S-Right> <C-O>:action EditorRightWithSelection<CR>
inoremap <S-Up> <C-O>:action EditorUpWithSelection<CR>
inoremap <S-Down> <C-O>:action EditorDownWithSelection<CR>发布于 2014-06-17 05:00:45
这似乎是不可能的。但是,只要您有ideavim,就不难破解插件来删除shift +箭头键的硬编码vim操作。这样做的效果是允许使用默认行为。
步骤:
git clone https://github.com/JetBrains/ideavim.gitideavim/src/com/maddyhome/idea/vim/RegisterActions.java。:s%/^.*KeyEvent.VK_\(KP_\)\?\(LEFT\|RIGHT\|UP\|DOWN\), KeyEvent.SHIFT_MASK.*$//。clean compile dist重新生成。ideavim/out/dist/ideavim-xx-dev.ziphttps://stackoverflow.com/questions/21711551
复制相似问题