Recently I edit C# code in vim. And the build system has StyleCop enabled so that all using statement should be in alphabetical order.
So, I tried to select below lines of code in visual mode, then type ":sort".
using System.Security.Permissions;
using System.Runtime.Serialization;
using System.Security;
using System.ServiceModel;
The result is:
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Security;
using System.ServiceModel;
It doesn't pass StyleCop checking because "System.Security" is not ahead of "System.Security.Permissions". The ASCII value of ";" is larger than ASCII value of ".".
The preferred result is:
using System.Runtime.Serialization;
using System.Security;
using System.Security.Permissions;
using System.ServiceModel;
How to achieve it?