简体   繁体   English

使用IdeaVim和Phpstorm缩进文本块的快捷键

[英]Shortcut key to indent a block of text with IdeaVim and Phpstorm

Without IdeaVim in PhpStorm, the tab key can be used to indent a selected block of text. 如果没有PhpStorm中的IdeaVim,tab键可用于缩进选定的文本块。 However, I'm interested to know if there's a shortcut key that does the same thing with the IdeaVim plugin installed (without losing any functionality that the tab key otherwise has). 但是,我很想知道是否有一个快捷键与安装的IdeaVim插件做同样的事情(不会失去tab键所具有的任何功能)。

See Indent multiple lines quickly in vi 请参阅vi中快速缩进多行

You must be in normal mode, ie go Esc before indenting. 你必须处于正常模式,即在缩进前去Esc

You can select a block of lines with Shift+V , then up/down arrows, then > to indent ( < reverses indent). 您可以使用Shift+V选择一个线条,然后使用向上/向下箭头,然后选择>缩进( <反转缩进)。

I think following settings are what you want! 我认为以下设置是你想要的! :) :)

Put the followings to ~/.ideavimrc 将以下内容放到〜/ .ideavimrc

nnoremap <Tab> >>_
nnoremap <S-Tab> <<_
inoremap <S-Tab> <C-D>
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv

ideavim support vimrc with .ideavimrc ideavim支持带.ideavimrc的vimrc

also see: Is there a way to get IdeaVIM to honor the mappings from my .vimrc file? 另请参阅: 有没有办法让IdeaVIM尊重我的.vimrc文件的映射?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM