作者:昆哥2502852107 | 来源:互联网 | 2022-12-19 13:51
I'm a rather happy PhpStorm user, but there are a few things that really annoy me, but I'm not a settings expert and wish there is a solution for them (editing PHP files) :
我是一个相当开心的PhpStorm用户,但有一些事情真的让我烦恼,但我不是设置专家,并希望有一个解决方案(编辑PHP文件):
Often in the editor, one want to go back to where the cursor was 100 lines above etc... And in PhpStorm Back Alt-Shift-Left and Forward Alt-Shift-Right do this - but they follow an algorithm that is beyond me: it definitely misses "steps" (e.g. from line 500 go to line 300 using keys like arrows or -even worse- page-up/down, then Alt-Shift-Left doesn't bring you back to line 500)
通常在编辑器中,人们想要回到光标位于上方等100行的位置......并且在PhpStorm中返回Alt-Shift-Left和Forward Alt-Shift-Right执行此操作 - 但它们遵循的算法超出了我的范围:它绝对错过了“步骤”(例如从第500行到第300行使用像箭头一样的键或者甚至更糟糕的页面向上/向下,然后Alt-Shift-Left不会让你回到第500行)
=> Is there a way to refine the conditions that drive the behavior of Back and Forward?
=>有没有办法改善驱动后退和前进行为的条件?
Is there a way to refine the indentor behavior? For instance
有没有办法改进压痕行为?例如
$a = array('X' => 'Something',
'Y' => 'Something else',[RETURN]
^ ^
now there
like in Emacs the cursor would go there right under the first quote after the spaces (and not at now where PS goes)?
就像在Emacs中一样,光标会在空格后面的第一个引号下面(而不是现在PS的位置)?
=> Is a regexp (or something else) able to refine the behavior of the indentor, Not only for this very specific case but for the behavior in general?
(Not mentioning another problem when Shift-Inserting where the indent is often unreliable)
=>正则表达式(或其他东西)是否能够改进压缩器的行为,不仅对于这个非常具体的情况,而且对于一般的行为? (当缩进通常不可靠的Shift-Inserting时,没有提到另一个问题)
I don't want to disable the automatic quoting feature as it is sometimes convenient, but it seems the algorithm doesn't parse correctly the environment where the "
or '
is inserted (don't have an example right now but at times it was annoying, like inserting 2 "
unexpectedly while only one is required, deleting one will actually delete the 2 (normal because they were inserted automatically... but I needed 1 only!) so have in this case to trick PhpStorm to force a 1 "
).
我不想禁用自动引用功能,因为它有时很方便,但似乎算法没有正确解析插入“或”的环境(现在没有示例,但有时它是令人讨厌,就像插入2“意外而只需要一个,删除一个将实际删除2(正常,因为他们被自动插入...但我只需要1!)所以在这种情况下,欺骗PhpStorm强制1” )。
=> Is there a regexp or similar to control the quoting behavior?
=>是否有正则表达式或类似的控制引用行为?
- Select via Shift-Arrow (for instance, to delete...)
通过Shift-Arrow选择(例如,删除...)
Almost forgot: PhpStorm remembers at which column the cursor is when navigating Up and Down. Fine. But when one want to select (using Shift and Up/Down Arrows) from beginning of line it is usually to select lines. Not a line-to-where-cursor-was-earlier. An example will explain better: *
is where the cursor is [beginning of line 3], %
is where the cursor was [middle of line 2]
几乎忘了:PhpStorm会记住在向上和向下导航时光标在哪一列。精细。但是当想要从行的开头选择(使用Shift和向上/向下箭头)时,通常选择行。不是一个行到哪里光标 - 更早。一个例子可以更好地解释:*是光标所在的位置[第3行的开头],%是光标所在的位置[第2行的中间]
1. $x = 'string';
2. $y = %'string';
3.*
doing Shift-Up will select (all s)
做Shift-Up会选择(全部)
1. $x = 'string';
2. $y = *sssssssss
3.
while in the specific case of a selection, it should select that:
而在选择的特定情况下,它应该选择:
1. $x = 'string';
2.*sssssssssssssssss
3.
not sure there is a way to configure that though - just in case there is?
不知道有没有办法配置,但以防万一?
Thanks
2 个解决方案
2
Oh well...
1) Is there a way to refine the conditions that drive the behavior of Back and Forward?
1)有没有办法改善推动后退和前进行为的条件?
No. Maybe (just maybe) it takes into consideration what you were doing at that location (even if you done nothing, then maybe how long the pause was). But mainly it looks at editing activity, navigation events (jump to declaration/implementation etc).
不。也许(只是可能)它考虑到你在那个地方做了什么(即使你什么也没做,那么也许停顿多久)。但主要是它关注编辑活动,导航事件(跳转到声明/实现等)。
2) Is a regexp (or something else) able to refine the behavior of the indentor, Not only for this very specific case but for the behavior in general?
2)正则表达式(或其他东西)是否能够改进压缩器的行为,不仅对于这个非常具体的情况,而且对于一般的行为?
RegEx -- definitely no. This question is not clear for me anyway -- are you talking about formatting or navigation? If first -- then all currently existing settings are in "Settings | Code Style". If second -- then check "Settings | Editor | Smart keys" -- maybe they will help.
RegEx - 绝对没有。无论如何,这个问题对我来说还不清楚 - 你在谈论格式化还是导航?如果是 - 那么所有当前存在的设置都在“设置|代码样式”中。如果第二 - 然后检查“设置|编辑|智能键” - 也许他们会帮助。
Otherwise -- please record some screencast/bunch of screenshots for current and desired behaviour and submit it as a new ticket to the Issue Tracker: http://youtrack.jetbrains.com/issues/WI
否则 - 请为当前和期望的行为记录一些截屏/一组截图,并将其作为新票提交给问题跟踪器:http://youtrack.jetbrains.com/issues/WI
3) Is there a regexp or similar to control the quoting behavior?
3)是否有正则表达式或类似控制引用行为?
No. You explanation is not clear enough. I suggest the same as for #2 -- get a code example and submit it as a new ticket to the Issue Tracker: http://youtrack.jetbrains.com/issues/WI . This way it may gets implemented/fixed for next version
不,你的解释不够明确。我建议和#2一样 - 获取代码示例并将其作为新票据提交给问题跟踪器:http://youtrack.jetbrains.com/issues/WI。这样它可以为下一版本实现/修复
4) not sure there is a way to configure that though - just in case there is?
4)不确定是否有办法配置 - 尽管有以下情况?
Don't know. I'm also facing this usability issue and would like to know workaround. The way I'm using it -- pressing "Home" before (or during/after) making the selection (not ideal "solution" as it is still annoying to do so, but works). Alternatively you can use mouse to select the lines (use it over editor gutter area -- where the line numbers are).
不知道。我也面临这个可用性问题,想知道解决方法。我正在使用它的方式 - 在选择之前(或期间/之后)按“Home”(不是理想的“解决方案”,因为它仍然很烦人,但是有效)。或者,您可以使用鼠标选择线条(在编辑装订线区域使用它 - 行号在哪里)。
If selection is to just delete/duplicate the line -- then there are shortcuts just for that.
如果选择只是删除/复制该行 - 那么只有快捷方式。