Code Monkey home page Code Monkey logo

stringmanipulation's Introduction

String Manipulation Donate Version Downloads

IntelliJ plugin - https://plugins.jetbrains.com/plugin/2162


Main features

Provides actions for text manipulation:

Switch case:

  • Switch case (camelCase, kebab-lowercase, KEBAB-UPPERCASE, snake_case, SCREAMING_SNAKE_CASE, dot.case, words lowercase, First word capitalized, Words Capitalized, PascalCase)
  • Toggle: SCREAMING_SNAKE_CASE / camelCase
  • Toggle: snake_case / camelCase
  • Toggle: kebab-case / snake_case
  • Toggle: kebab-case / camelCase
  • Toggle: dot.case / camelCase
  • Toggle: PascalCase / camelCase
  • Toggle: lowercase words / camelCase
  • Toggle: First word capitalized / camelCase
  • Toggle: Capitalized Words / camelCase
  • To camelCase
  • To snake_case
  • To kebab-case
  • To SCREAMING_SNAKE_CASE
  • To Capitalized_Snake_Case
  • Capitalize
  • To lower case
  • To UPPER CASE
  • Invert case
  • To Spring Boot System Env Variable
- 'Switch case' action can be customized, or new ones can be added in settings
- when nothing is selected, then either nothing or a whole line or a particular element is selected (report an issue if you find something to improve, each file type needs its own implementation to work flawlessly)

Un/Escape:

  • Un/Escape selected Java text
  • Un/Escape selected JavaScript text
  • Un/Escape selected C# text (regular, verbatim, interpolated)
  • Un/Escape selected HTML text
  • Un/Escape selected JSON text
  • Un/Escape selected XML text
  • Un/Escape selected SQL text
  • Un/Escape selected PHP text
  • Convert diacritics (accents) to ASCII
  • Convert non-ASCII to escaped Unicode
  • Convert escaped Unicode to String
  • Unicode normalization (NFD, NFC, NFKC, NFKD)

Encode/Decode:

  • Encode selected text to MD5 Hex
  • Encode selected text to SHA-1 Hex
  • Encode selected text to SHA-256 Hex
  • Encode selected text to SHA-512 Hex
  • Encode selected text to SHA3-256 Hex
  • Encode selected text to SHA3-512 Hex
  • De/Encode selected text as URL
  • De/Encode selected text to Base64
  • De/Encode selected text to Hex
  • ISO Timestamp to Epoch Milliseconds
  • Epoch Milliseconds to ISO Timestamp

Increment/Decrement:

  • Increment/decrement all numbers found.
  • Duplicate selection and increment/decrement all numbers found.
  • Create sequence - Keep first number, replace all other by incrementing
  • Increment duplicate numbers

Sort with natural order or Collator:

  • Reversing order of lines
  • Shuffle lines
  • Sort case-sensitive A-z
  • Sort case-sensitive z-A
  • Sort case-insensitive A-Z
  • Sort case-insensitive Z-A
  • Sort line length asc., desc.
  • Sort hexadecimally
  • Sort lines by subselection - only one selection/caret per line is handled
  • Sort tokens (delimited text)
  • Hierarchical sort
  • Shuffle Characters
  • JSON sort

Align:

  • Align carets/selections into a vertical line by inserting spaces
  • Format selected text to columns/table by a chosen separator/delimiter and sort by columns
  • Align text to left/center/right

Filter/Remove/Trim/Convert...:

  • Grep
  • Inverted Grep
  • Group by Grep - matched lines will be separated from not matched
  • Trim
  • Trim Trailing
  • Trim Leading
  • Replace whitespaces with a single space char
  • Remove all spaces
  • Remove duplicates - supports multicaret subselection
  • Keep only duplicate lines
  • Remove empty lines
  • Remove consecutive empty lines
  • Remove all newlines
  • Minify JSON
  • Convert Between JSON and YAML

Other:

  • Reverse Letters
  • Swap Words
  • Swap Characters/Selections/Lines/Tokens
  • Wrap or shift double quotes to single quotes to backticks
  • Swap between double quotes and single quotes
  • Straighten/Educate quotes
  • Switch file path separators: Windows<->UNIX
  • Select All Occurrences For All Carets
  • Duplicate Line or Selection And Replace
  • Extend Selection in Different "CamelHumps" Mode

Actions are available under Edit menu, or via the shortcut "alt M" and "alt shift M".
You can setup your own shortcuts for better usability.
Popup can be customized in File | Settings | Appearance & Behavior | Menus and Toolbars.


Privacy Notice: No personal data is collected at all


YourKit-Logo

YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.

stringmanipulation's People

Contributors

cmmoran avatar derdan avatar detunized avatar erlangp avatar finalfantasia avatar isabek avatar krasa avatar m-radzikowski avatar piton4k avatar pmenke-de avatar raayu83 avatar tan9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stringmanipulation's Issues

Convert to UPPER and lower case

Would be great to have an action for converting the selected text to upper/lower case.
I don't mean capitalise, I mean change the case of all selected characters.

How do I build your source code to get the plugin .jar file? That way I can play around and maybe PR 😊

Sort lines / separated list of values

Case-Sensitive A-z
Case-Sensitive z-A
Case-Insensitive A-Z
Case-Insensitive Z-A
Numerically 0-9
Numerically 9-0
Line Length Short-Long
Line Length Long-Short
With whitespace ignored

Feature Request show possible string transformation in a selectable preview

already exists, my bad

use case:

  • As a user I want to be able to quickly change from any case to any case.

user story:

  1. I highlight the word myWord I want to change the case of.
  2. I press a shortcut key
  3. A preview dialog window appear next to the word. The preview shows:
    1. myWord (this is the original world, used as a header)
    2. my-word (the second entry is selected and highlighted by default)
    3. MY_WORD
    4. ... (and so on)
  4. Using the arrow, I highlight the 3rd entry MY_WORD and press enter.
  5. the case of the original word has now changed from myWord to MY_WORD.

How to change `HelloWorld` to `helloWorld`?

HelloWorld -> helloWorld, how to convert it with this plugin just in one time?

I have to press do it with 2 steps:

  1. option + m + 5, to convert it to HELLO_WORLD
  2. option + m + 5, to convert it to helloWorld

Do I miss anything that I can do it just in one step?

Ignore leading spaces when sorting

I try to sort this code with selection as shown below

   	>	$bundles[] = new DebugBundle();
   		$bundles[] = new SensioDistributionBundle();
   		$bundles[] = new WebProfilerBundle();<

(selection shown as >selected text<)

Expected:

   		$bundles[] = new WebProfilerBundle();
   		$bundles[] = new SensioDistributionBundle();
   		$bundles[] = new DebugBundle();
  • Leading whitespace is ignored

Actual:

   		$bundles[] = new DebugBundle(); <------ PROBLEM
   		$bundles[] = new WebProfilerBundle();
   		$bundles[] = new SensioDistributionBundle();
  • Leading whitespace is taken into account.

Increment Group as a whole

I tried selecting a large block of text with numbers in it and was hoping it would increment the whole lot, but alas, it did not.

Here is what I was hoping for:

This is what I have

<tr>
    <td><?php echo $var['excerpt_1']; ?></td>
    <td><?php echo $var['excerpt_2']; ?></td>
    <td><?php echo $var['excerpt_3']; ?></td>
</tr>

I selected the whole table row and hit "Duplicate and Increment" and was hoping for this

<tr>
    <td><?php echo $var['excerpt_1']; ?></td>
    <td><?php echo $var['excerpt_2']; ?></td>
    <td><?php echo $var['excerpt_3']; ?></td>
</tr>
<tr>
    <td><?php echo $var['excerpt_4']; ?></td>
    <td><?php echo $var['excerpt_5']; ?></td>
    <td><?php echo $var['excerpt_6']; ?></td>
</tr>

but what I got was this

<tr>
    <td><?php echo $var['excerpt_1']; ?></td>
    <td><?php echo $var['excerpt_2']; ?></td>
    <td><?php echo $var['excerpt_3']; ?></td>
</tr>
<tr>
    <td><?php echo $var['excerpt_2']; ?></td>
    <td><?php echo $var['excerpt_3']; ?></td>
    <td><?php echo $var['excerpt_4']; ?></td>
</tr>

Any chance of adding that to the options somehow?

Or is there a way to do this that I'm not aware of?

Align by columns: Seperator Delimeter Templates

Lots of time developers need to same template for separate to code block for different languages, if there is saveTemplate{also removeTemplate && loadTemplate buttons ( t1Btn, t2Btn, ... --> click for load) } action on seperators dialog it become very usefull

Exception thrown soon after installation

Not sure of the cause for this, but the following exception was thrown shortly after I installed this plugin in WebStorm 11.0.4. I'm now running Java 1.8.0_92-b14, but noticed that I hadn't installed the full SDK previously so maybe that is part of why this happened. In any case, below is the stack trace that showed up. All I'd done was install and then use the plugin on a block of text to:

  • Sort case-insensitive a-z
  • Remove duplicate lines
com/intellij/psi/impl/source/tree/java/PsiJavaTokenImpl
java.lang.NoClassDefFoundError: com/intellij/psi/impl/source/tree/java/PsiJavaTokenImpl
    at osmedile.intellij.stringmanip.styles.AbstractCaseConvertingAction.javaHandling(AbstractCaseConvertingAction.java:79)
    at osmedile.intellij.stringmanip.styles.AbstractCaseConvertingAction.selectSomethingUnderCaret(AbstractCaseConvertingAction.java:38)
    at osmedile.intellij.stringmanip.AbstractStringManipAction$1.executeWriteAction(AbstractStringManipAction.java:31)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.executeWriteAction(EditorWriteActionHandler.java:93)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:56)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1010)
    at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.doExecute(EditorWriteActionHandler.java:49)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3$1.perform(EditorActionHandler.java:206)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:109)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.access$000(EditorActionHandler.java:38)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler$3.perform(EditorActionHandler.java:203)
    at com.intellij.openapi.editor.impl.CaretModelImpl$3.run(CaretModelImpl.java:342)
    at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:422)
    at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:333)
    at com.intellij.openapi.editor.impl.CaretModelImpl.runForEachCaret(CaretModelImpl.java:324)
    at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:200)
    at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:98)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:109)
    at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:83)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:182)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:311)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:958)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:281)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at com.apple.laf.ScreenMenuItemCheckbox.itemStateChanged(ScreenMenuItemCheckbox.java:193)
    at java.awt.CheckboxMenuItem.processItemEvent(CheckboxMenuItem.java:389)
    at java.awt.CheckboxMenuItem.processEvent(CheckboxMenuItem.java:357)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:866)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: com.intellij.psi.impl.source.tree.java.PsiJavaTokenImpl PluginClassLoader[String Manipulation, 4.6.135.445.0]
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:68)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 57 more

Feature Request: add "To Words" option

Right now there is an option To camelCase (or to words) but there is no To words option. Sometimes you just want to convert to words but not from camelCase, so you need to do it in 2 steps. Would be nice to simply have a To Words menu item.

request to add swap words feature

request for addition of an feature that transposes words around a comma i.e.

callFuncname(aParam, aNotherPararm)

with the caret on a 1st parameter(aParam) a new action swap words would result in transposing the 2 parameters leaving the , in between resulting in :

funcname(aNotherPararm, aParam)

Do not use the calling context

origin code:

public void testMethod() {
    testMethod2(testSub);
}

Sets the cursor to "testSub" in line 5 (the word is not highlighted) (screenshot)
calling the action "To Constant Style"

expect:

public void testMethod() {
    testMethod2(TEST_SUB);
}

actual (not only incorrect transformation, but also "broken" code):

public void testMethod() {
TEST_METHOD_(TEST_SUB_;
}

Request: allow to customize which types of manipulations to use in "switch case"

I use "switch case" feature in the keys, of this plugin, to switch various cases of selected text:

https://user-images.githubusercontent.com/5357526/38096059-9d6b3bce-337a-11e8-9581-bee56311bc12.png

In Kotlin and in Java, there is a specific set of strings rules that we use:

  1. helloWorld - variables and functions names
  2. HelloWorld - Classes and enums
  3. HELLO_WORLD - constant values or enum values
  4. hello_world - packages and Android resources.

Other than those, there is no usage that I know of, that the plugin generates.

Please allow to customize which types to use. Maybe even allow it based on the file that is currently edited.

Feature Request: Basic UPPER and lower

Thanks for the great plugin, however there are 2 basic things I'm always trying to go for in the context menu and they are:

  • a basic convert to upper case: converts all the selected text to UPPER CASE, no matter what
  • a basic convert to lower case: converts all the selected text to lower case, no matter what.

Examples: (input, function, output)
Hello -> UPPER -> HELLO
Hello -> lower -> hello
TesT 12_34 -> UPPER -> TEST 12_34
TesT 12_34 -> lower -> test 12_34

Cheers!

Multiple seperator in one time (enhancements)

Is there any idea for multiple seperator in one time?
for example

x = ab( 123)
yz = cde (34)

----to----

x  = ab  ( 123 )
yz = cde ( 34  )

we need to align column three time with '=' then '(' then ')'
Can we do it in one time ? for example =&&(&&)

How do I use this plugin?

After installing, I don't see any key bindings to it. I searched in "Keymap" settings for "case" and "string", but nothing appeared.
I just want an easy way to switch between various string cases (camel case etc...).

I use Android Studio 2.3.1.

Feature Request: Split CSV String into array

Given a string and a separator string, convert a string to an array (and vice versa).

  • "Ford|Chevy|Honda|Toyota" --> ["Ford", "Chevy", "Honda", "Toyota"]
  • ["Ford", "Chevy", "Honda", "Toyota"] --> "Ford|Chevy|Honda|Toyota"

The separator should be a string, not a character because with complex data sets people often use multi-character separator strings to simplify the parsing.

Error

Noticed and error when installing the plugin in WebStorm 2016.

This could be a fault in WebStorm as I cannot download the package directly and have to do it manually. One it is installed I can see an error in the console and the String Manipulation menu is visible but greyed out.

class with name 'osmedile.intellij.stringmanip.PopupChoiceAction' not found [Plugin: String Manipulation]
com.intellij.diagnostic.PluginException: class with name 'osmedile.intellij.stringmanip.PopupChoiceAction' not found [Plugin: String Manipulation]
	at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:194)
	at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(ActionManagerImpl.java:157)
	at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:511)
	at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:491)
	at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:484)
	at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(DefaultActionGroup.java:354)
	at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:312)
	at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:125)
	at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:86)
	at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:280)
	at com.intellij.openapi.actionSystem.impl.ActionMenu.d(ActionMenu.java:323)
	at com.intellij.openapi.actionSystem.impl.ActionMenu.access$600(ActionMenu.java:50)
	at com.intellij.openapi.actionSystem.impl.ActionMenu$MenuListenerImpl.menuSelected(ActionMenu.java:277)
	at javax.swing.JMenu.fireMenuSelected(JMenu.java:1038)
	at javax.swing.JMenu$MenuChangeListener.stateChanged(JMenu.java:1118)
	at javax.swing.DefaultButtonModel.fireStateChanged(DefaultButtonModel.java:349)
	at javax.swing.DefaultButtonModel.setSelected(DefaultButtonModel.java:232)
	at javax.swing.JMenu.setSelected(JMenu.java:305)
	at com.apple.laf.ScreenMenu$2.run(ScreenMenu.java:135)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:857)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:658)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:386)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: osmedile.intellij.stringmanip.PopupChoiceAction PluginClassLoader[String Manipulation, 5.2.135.445.0]
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:64)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(ActionManagerImpl.java:153)
	... 39 more

Option to align into columns but make comma stick to the left

I've got some migrations that are quite long and look like this:

        $table->addColumn('field_01', 'boolean', ['default' => false]);
        $table->addColumn('field_02', 'boolean', ['default' => false]);
        $table->addColumn('field_03', 'datetime', ['notnull' => false]);
        $table->addColumn('field_long_name', 'datetime', ['notnull' => false]);

When aligned to columns they look like this:

        $table->addColumn('field_01'       , 'boolean' , ['default' => false]);
        $table->addColumn('field_02'       , 'boolean' , ['default' => false]);
        $table->addColumn('field_03'       , 'datetime', ['notnull' => false]);
        $table->addColumn('field_long_name', 'datetime', ['notnull' => false]);

But what I actually want to achieve is this:

        $table->addColumn('field_01',        'boolean',  ['default' => false]);
        $table->addColumn('field_02',        'boolean',  ['default' => false]);
        $table->addColumn('field_03',        'datetime', ['notnull' => false]);
        $table->addColumn('field_long_name', 'datetime', ['notnull' => false]);

So they aligned, but the space sticks to the left.

Bug: using hotkey to switch states doesn't always include all-upper-cases

I use "switch case" feature in the keys, of this plugin, to switch various cases of selected text:

image

It usually works, but I think that only if I use at least 2 words. Suppose you take this example of enum values, that you wish to set all caps (kotlin code) :

enum class ItemType{
    TermsOfUse , PrivacyPolicy, Acknowledgements,AppVersion
}

All of them work well, except for "Acknowledgements" which can only be replaced to "acknowledgements" and back to "Acknowledgements".

The others eventually become what they should: TERMS_OF_USE , PRIVACY_POLICY, APP_VERSION

Keymap access to sort lines by length

Is there any chance you could expose a way to trigger "Sort Lines by Length..." via Keymap? I use this ALL THE TIME and would love to trigger via keyboard.

Increment/decrement sub-sequences

Probably this is not an issue and is already covered somehow, but I could not find out how to increment sequences like:
1.1
1.2
1.3...
only at their second (last) portion.

Using Increment/Decrement... I got the following:
2.1
2.2
2.3

Is there a way to increment the minor part instead:
1.2
1.3
1.4

Sort by column

#7 (comment):
I vote to have numerical sorting : that will be very useful to sort a 'find . -ls' or a 'ls -la'
A dialog would appear to choose column and separator (otherwise choose the first numerical column)

Snake case drops numbers

The symbol v2Counter converted to snake_case turns into v_counter.
The same holds true for SCREAMING_SNAKE_CASE.
Tested on 4.0.135.445. I imagine this would be a quick fix?

Inverted grep

Sorry if this is already possible, I couldn't figure it out:

I think it would be nice to have inverted grep (grep -v), so that matching lines are removed instead of kept.

Conversion to snake case should convert only case, not other characters

Let's have a string

\My\AppBundle\App\Twig\GoogleTagManagerDataLayer

I want to convert it to

my.app_bundle.app.twig.google_tag_manager_data_layer

That seems to be the exact case for string manipulation plugin. But it's currently not possible. If I call "to snake_case" on it, it creates

my_app_bundle_app_twig_google_tag_manager_data_layer

I would expect the plugin to work on case (i.e. only convert [a-z][A-Z] to \1_\2) and not touch unknown characters. Current behaviour IMO severely limits use cases. What is this behvaiour's use-case?

My other typical use case would be

Some\PHP\SubNamespace -> some/php/sub-namespace.twig (i.e. replace slashes + to hyphen-case)

'Align to columns' removes leading whitespace

The 'Align to columns' function removes leading whitespace from all the lines it operates on. This makes it less useful to me, since usually when I want to use this feature, it is in source code where I want to preserve existing indentation. I think this feature would be more useful if it preserved leading whitespace on lines, or at least had the option to do so.

For example, say I have this python function:

def some_function():
    var1 = 'foo'
    another_variable = 'bar'
    variable3 = 'bla'

If I select the 3 variable assignment lines and invoke 'Align to columns', what I'd like to see is:

def some_function():
    var1             = 'foo'
    another_variable = 'bar'
    variable3        = 'bla'

But instead what I get is:

def some_function():
var1             = 'foo'
another_variable = 'bar'
variable3        = 'bla'

I'm using PyCharm 2017.1.5. Thanks.

Bad conversion to camelCase

. .
origin testFLEXIBLE_QUERY
expected testFlexibleQuery
actual testflexibleQuery
. .
origin testFlexibleQuery_PRODUCTS_FOR_WORKFLOW_ATTACHMENT
expected testFlexibleQueryProductsForWorkflowAttachment
actual testflexiblequeryProductsForWorkflowAttachment

Convert quoted string

This would convert a quoted string from current quote (single or double) to the other including any escaping if needed.

For instance, if you have a string such as:
"she's a great car"

It would convert to:
'she's a great car'

It should automatically determine whether the string is currently surrounded with single or double quotes and pick the other.

If possible, it should expand from the current selection point (assuming no text is selected) to select the quoted string the cursor is located in.

To ASCII

Hi, could you please add feature to convert a string to ASCII?

E.g.:
"Česká republika" -> "Ceska republika"
"ěščřžýáíé" -> "escrzyaie"

"Align to column by ," doesn't align correctly

Example:

Before:

INSERT INTO address
(id , address1 , address2 ) VALUES
(@club_address+1 ,'56 passage de la Coupole' , '92400 La Défense 6 Courbevoie') ,
(@club_address+2 ,'9 Esplanade du Général de Gaulle', '92800 Puteaux' ) ;

after: apply this function to all lines except first:

INSERT INTO address
(id , address1 , address2 ) VALUES
(@club_address+1 , '56 passage de la Coupole' , '92400 La Défense 6 Courbevoie') ,
(@club_address+2 , '9 Esplanade du Général de Gaulle' , '92800 Puteaux' ) ;

Please fix.

Feature Request: toUpperCase + toLowerCase

Thank you for your plugin. This is feature request.

You have many options for many advanced case manipulations and variable styles.

However you seem to be missing two of the most basic:

  • String.toUpperCase()
  • String.toLowerCase()

These are occasionly useful for standard text editing purposes and converting strings to match database schema requirements.

Thank you.

Feature Request: Live Template Variable Manipulation

Is it possible to implement a feature where if you try to do a string manipulation while in a live template's variable, or any guided edit mode, it automatically applies the manipulation to the entire field's value?

To explain my current use-case, I write tests in snake case like it_should_have_a_unique_slug... However, when actually typing them out, I prefer to use spaces: it should have a unique slug. It'd be nice to have a way to quickly convert the field to snake case, but Live Templates don't have the ability to post-process variables.

Currently, I have to do Ctrl + A to select everything in the current Live Template's input field before I'm able to apply the string manipulation to it.

For a better explanation of my specific use-case, see my JetBrains Community post.

"Lowercase Fully"... please!

Can you introduce a stand-alone lowercase action? It almost seems odd that there's a "Capitalize Fully" command, yet no "Lowercase Fully" action.

I understand there's already a Toggle option, but I would like the ability to bind to one action, to one Keymap.

Other than that... love the plug-in!

Feature Request: Quote Selection

Option to wrap the currently selected text in quotes (or possibly other characters).

Possibly implemented as a Wrap/Quote... submenu with entries like:

  • Wrap selection in "double quotes"
  • Wrap selection in 'single quotes'
  • Wrap selection in `backticks`

[Bug] Sort lines by subselection

Sort lines by subselection doesn't work

$a = [
  'name'=>2,
  'v2'=>3,
  'va'=>1,
];

Here it the code. I selected 2, 3, 1 in multiple selection mode -> invoked Sort lines by subselection and this just breaks my code.
Result:

$a = [
  'name'=>2,
  'v2'=>3,
  'v2'=>3,
];

P.S. Thanks for the great plugin ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.