Giter VIP home page Giter VIP logo

mnemonics's Introduction

official JetBrains project

Mnemonics

Mnemonics are templates for ReSharper and IntelliJ that let you quickly generate code and data structures by typing in names which are based on mnemonics - a structured abbreviation of the code you're trying to create.

For example, in C#, typing c and pressing Tab creates something like this:

public class MyClass
{
  |
}

The vertical bar above indicates where the caret will end up once you're done editing the name of the class.

Similarly, C will create a static class, m creates a method, M creates a static method, and so on, including fields, variables, properties and more. You can then extend this to include the return type of the method:

  • mf - generates a method that returns float
  • ms - a method that returns string
  • m~s - a method that returns an IEnumerable<string>

This extends to more complex examples such as:

  • pgh.sb - a property with only a getter, of type HashSet<StringBuilder>

Please take a look through the templates in ReSharper or IntelliJ to see the full list. Note that currently the shortcuts that include a period (.) do not work, and are unlikely to work in the future.

Supported Languages

The project aims to support the following languages - currently supported ones are in bold:

  • C# and VB.NET (ReSharper)
  • Java, Scala, Kotlin (IntelliJ IDEA)
  • Python (PyCharm)
  • Ruby (RubyMine)
  • Objective-C (appCode)

Installation Notes

Installing mnemonics is simple.

  • Go to the downloads directory and download the file related to your IDE.
  • ReSharper:
  • 8.0 and later: Look for the mnemonics extension package in the ReSharper|Extension Manager.
  • pre-8.0: Open ReSharper|Templates Explorer, press the Import... button, select the XML file. You're done. Note that on first use, VS might freeze for a while - this is normal and only happens once.
  • IntelliJ IDEA: open File|Import Settings..., navigate to the directory with the .jar file, select it, press OK. IDEA will ask you to restart.

mnemonics's People

Contributors

citizenmatt avatar nesteruk avatar yole 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

Watchers

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

mnemonics's Issues

Duplicate generated code

In the download folder, the ReSharper xml file has a load of test method templates that all expand to the same piece of code. As are the templates for "vr..." mnemonics. This is for C# and VB

How can I contribute?

Hello,

I'd like to issue a PR but it is denied? I have made a series a fixes and upgraded the repo to .net 8 and Rider 2024.
I can't figure how to automatically build a extension package though!

Cheers
François

Print-riendly keymap

Hi!

Is anywhere a "print-riendly" Mnemonics keymap exist? Not a full list, of course, just common scenarios. I hope it may be very helpful, because a part of mnemonics may be investigated only in Templates Explorer. I faced tm (NUnit Test Method) few minutes ago, when tried to add a completely identical mnemonic =)

P.S. Are the mnemonics for Assert or Setup Method included in project? Cann't find it.

Support Reshrper 9.1

I upgraded to Resharper 9.1 and mnemonics extension stopped working. Please support re#9.1

Thanks!

What about nullable property templates?

Are they existing? If not pni or pin for public int? $propname$ { get; set; }

(I found your templates yesterday and already like them a lot :-) and I like the idea of those templates...)

All Tests are looking the same?

Hello Guys,

First, I really like this plugin. I use it every day. Thank you for keeping it working! 🎉
However, I was trying to use it for tests, but I noticed all the tests are exactly the same when we use it. It doesn't matter if it's for xUnit to MsUnit. It's possible to fix this?

I'm using the plugin on Rider (mac and windows)

test method1
test method3
test method2

What about Live Templates?

How is this different to Resharoer's standard Live Templates, where, e.g. I just type 'pps' for a public string auto-property? All I enter is the property name.

m and M produce the same

Hi,
I have an issue with Resharper9.1.
m and M produce the same code:

   public static void MyMethod()
    {

    }

I have no Idea cause the Templates looking ok.

Same text for any "t"....

Hi!, looking for mnemonics for my unity tests I found the tb to t~u, however they do exactly the same thing,
[Test] public void $methodname$(){$END$}

Add Task-returning templates

I couldn't find any templates for Task return types, this makes it hard to use the templates in an async/await environment. It would be very useful if Task-wrapped return types could be added.

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.