Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
620 views
in Technique[技术] by (71.8m points)

intellij idea - Using PhpStorm IdeaVim, I can't use shift+arrow keys to select words

I am using PhpStorm 7.1.2 with IdeaVim plugin.

When in Insert mode, I want to select words using Shift + ArrowKey. However, this IdeaVim plugin seems to be preventing from doing that. I can only highlight the words in Command mode using v key.

shift+Home/End/PageDown/PageUp or shift+ctrl+arrowKeys all do not work properly.

I tried changing shortcuts (i.e. Select to Right => shift+right) in Keymap setting but did not work.

Is there any way I can achieve this non-vim behavior?

UPDATE 1

There is a ticket opened in their bug tracking system without any fix. So I guess I can't do what I described above.

UPDATE 2 (11/14/2019)

From this last comment in that bug ticket, ideaVim now supports this shift+arrowKeys selections. I moved away from intellij to pure vim few years after asking this question so I won't be trying this out but wanted to just update this question for completeness. And saw @citizenmatt's answer after writing this update so see @citizenmatt's answer below for more details on this.

question from:https://stackoverflow.com/questions/21711551/using-phpstorm-ideavim-i-cant-use-shiftarrow-keys-to-select-words

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I would create a ~/.ideavimrc with the following lines

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>

It makes my code select text in the same way.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...