Set ,, to add argument to function or array.
I'm a VIM user currently evaluating PHPStorm. As both VIM and PHPStorm so nicely complete the second [single|double] quote when opening the first quote, I have VIM configured to let me easily add additional arguments from within quoted strings:
1. Move to the next [single|double] quote
2. Add a comma and a space
3. Leave the cursor in insert mode after the space
The VIM configuration look like this:
inoremap ,, <Esc>/"\\|'<Return>a,<Space>
How might I configure PHPStorm to provide the same functionality? Thank you.
Please sign in to leave a comment.
Are you using .vimrc filefor your VIM configuration? IdeaVim plugin supports the same, please see docs at https://github.com/JetBrains/ideavim
Thank you Dmitry. I am not using the IdeaVim plugin as I am trying to learn how to use PHPStorm itself. Does PHPStorm have an "Add argument" ability, that may work the same or differently than that which I had configured in VIM?
In other words, if the pipe character | represents the character position, how would I get from here:
fooBar("PHPStorm | rocks");
...to here:
fooBar("PHPStorm rocks", |);
Hi there,
>Does PHPStorm have an "Add argument" ability, that may work the same or differently than that which I had configured in VIM?
None AFAIK (although I could be wrong here). You can check almost all available actions at "Settings/Preferences | Keymap"
For PHP .. the latest 2016.1.1 has "smart completion of function arguments" functionality (enabled by default; how to turn it off) which helps you with writing such code (you need to use Enter or Tab to get into another parameter placeholder)
Thank you Andriy. Smart completion of function arguments is a nice feature and good replacement for what I'm looking for when it works..
However I find it's scope limiting. For instance, one of my current projects is developing a Wordpress plugin, and this feature does not support the built-in Wordpress functions out of the box. I'll experiment and see if I can get it to recognize the WP functions and some other things that I'd like it to work with.
Thank you!