Live Templates

Hi Everyone, I'm trying to create some live templates and file templates in Rider. How can I insert a variable that will convert the Controller name (MVC) to camel case. Example is if I am inserting a function in TestController, the output of the variable should only be "test".

Also, is there a macro that can be assigned to a variable to replace part of the class name to whatever string I want? E.g. if the $CLASS$ variable is equal to "TestClassVM", the output of the macro for the other variable should be "TestClassRH", replacing VM with RH?

Thank you in advance.

1 comment
Comment actions Permalink

Hey Edward Carandang

I'd suggest using camelCase(<String>) function of Live Templates feature. For example, camelCase("my-text-file")camelCase("my text file"), and camelCase("my_text_file") all return myTextFile. Please find more here:

Turning "TestClassVM" to "TestClassRH" is not possible in Rider at the moment, I'm afraid. At least until the advanced naming rules are implemented, see

Hope it helps!


Please sign in to leave a comment.