热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

PhpStorm:解决4个恼人问题的解决方案?-PhpStorm:anysolutionfor4annoyingproblems?

ImaratherhappyPhpStormuser,butthereareafewthingsthatreallyannoyme,butImnotaset

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文件):

  • Navigation

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?

=>有没有办法改善驱动后退和前进行为的条件?

  • Indentation

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时,没有提到另一个问题)

  • Quotes (automatic)

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 个解决方案

#1


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.

如果选择只是删除/复制该行 - 那么只有快捷方式。

#2


2  

Regarding quotes, in cases when you just want the one quote, hit del instead of backspace after typing ".

关于引号,如果您只想要一个引号,请在输入后按“del”而不是“退格”。

I've some qualms about the indentation (and code (re)formatting in general) too, but it's that it changes from release to release, there's not much you can do about it though...

我对缩进(以及一般的代码(重新)格式化)也有一些疑虑,但它是从发行版到发行版的变化,尽管如此,你可以做的并不多。

Re: selection - in your case you can just hit Home while still holding shift. It never even registered to me as unexpected behavior.

回复:选择 - 在你的情况下,你可以在仍然保持班次时击中Home。它甚至从未向我注册为意外行为。


推荐阅读
  • 本文整理了315道Python基础题目及答案,帮助读者检验学习成果。文章介绍了学习Python的途径、Python与其他编程语言的对比、解释型和编译型编程语言的简述、Python解释器的种类和特点、位和字节的关系、以及至少5个PEP8规范。对于想要检验自己学习成果的读者,这些题目将是一个不错的选择。请注意,答案在视频中,本文不提供答案。 ... [详细]
  • IhaveconfiguredanactionforaremotenotificationwhenitarrivestomyiOsapp.Iwanttwodiff ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 本文介绍了游标的使用方法,并以一个水果供应商数据库为例进行了说明。首先创建了一个名为fruits的表,包含了水果的id、供应商id、名称和价格等字段。然后使用游标查询了水果的名称和价格,并将结果输出。最后对游标进行了关闭操作。通过本文可以了解到游标在数据库操作中的应用。 ... [详细]
  • 本文介绍了三种方法来实现在Win7系统中显示桌面的快捷方式,包括使用任务栏快速启动栏、运行命令和自己创建快捷方式的方法。具体操作步骤详细说明,并提供了保存图标的路径,方便以后使用。 ... [详细]
  • 本文介绍了Windows Vista操作系统中的用户账户保护功能,该功能是为了增强系统的安全性而设计的。通过对Vista测试版的体验,可以看到系统在安全性方面的进步。该功能的引入,为用户的账户安全提供了更好的保障。 ... [详细]
  • MySQL多表数据库操作方法及子查询详解
    本文详细介绍了MySQL数据库的多表操作方法,包括增删改和单表查询,同时还解释了子查询的概念和用法。文章通过示例和步骤说明了如何进行数据的插入、删除和更新操作,以及如何执行单表查询和使用聚合函数进行统计。对于需要对MySQL数据库进行操作的读者来说,本文是一个非常实用的参考资料。 ... [详细]
  • HashMap的扩容知识详解
    本文详细介绍了HashMap的扩容知识,包括扩容的概述、扩容条件以及1.7版本中的扩容方法。通过学习本文,读者可以全面了解HashMap的扩容机制,提升对HashMap的理解和应用能力。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • Oracle seg,V$TEMPSEG_USAGE与Oracle排序的关系及使用方法
    本文介绍了Oracle seg,V$TEMPSEG_USAGE与Oracle排序之间的关系,V$TEMPSEG_USAGE是V_$SORT_USAGE的同义词,通过查询dba_objects和dba_synonyms视图可以了解到它们的详细信息。同时,还探讨了V$TEMPSEG_USAGE的使用方法。 ... [详细]
  • 本文介绍了Python爬虫技术基础篇面向对象高级编程(中)中的多重继承概念。通过继承,子类可以扩展父类的功能。文章以动物类层次的设计为例,讨论了按照不同分类方式设计类层次的复杂性和多重继承的优势。最后给出了哺乳动物和鸟类的设计示例,以及能跑、能飞、宠物类和非宠物类的增加对类数量的影响。 ... [详细]
  • 本文介绍了在处理不规则数据时如何使用Python自动提取文本中的时间日期,包括使用dateutil.parser模块统一日期字符串格式和使用datefinder模块提取日期。同时,还介绍了一段使用正则表达式的代码,可以支持中文日期和一些特殊的时间识别,例如'2012年12月12日'、'3小时前'、'在2012/12/13哈哈'等。 ... [详细]
  • 本文介绍了在iOS开发中使用UITextField实现字符限制的方法,包括利用代理方法和使用BNTextField-Limit库的实现策略。通过这些方法,开发者可以方便地限制UITextField的字符个数和输入规则。 ... [详细]
  • MPLS VP恩 后门链路shamlink实验及配置步骤
    本文介绍了MPLS VP恩 后门链路shamlink的实验步骤及配置过程,包括拓扑、CE1、PE1、P1、P2、PE2和CE2的配置。详细讲解了shamlink实验的目的和操作步骤,帮助读者理解和实践该技术。 ... [详细]
  • 本文介绍了在序列化时如何对SnakeYaml应用格式化,包括通过设置类和DumpSettings来实现定制输出的方法。作者提供了一个示例,展示了期望的yaml生成格式,并解释了如何使用SnakeYaml的特定设置器来实现这个目标。对于正在使用SnakeYaml进行序列化的开发者来说,本文提供了一些有用的参考和指导。摘要长度为169字。 ... [详细]
author-avatar
昆哥2502852107
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有