SlickEdit Community
SlickEdit Product Discussion => SlickEdit® => Topic started by: joecar on September 10, 2019, 10:42:50 PM
-
Is it possible to set formatting style per project or workspace...?
( this is a undisguised feature request :) )
-
There isn't a workspace setting for it. But if you can add an XML file to your workspaces, for v23 and later you can use the .seeditorconfig.xml file support to do it.
To use that, you have to enable the support in Tools -> Options -> General -> "Apply .editorconfig, .seeditorconfig.xml settings" first, and then you can create the override file using Tools -> Beautifier -> "Beautifier Profile Overrides...".
-
If you have a tree of source, create the Beautifier Profile Override and the root of the source tree. That way it's applied to all the source files beneath it.
-
Thanks, let me try that...
I'm running SlickEdit Pro 2019 (v24.0.0.4 64-bit)
-
Can the .seeditorconfig.xml file pathname be specified in the .vpw file...?
-
I can't seem to get it to work correctly...
When I goto a differnt workspace the formatting does not override...
Attached pics are of workspace #1... you can see format is "QNX_Workspace" for override and actual.
-
Attached are pics for workspace #2... you can see that the actual does not follow the override (instead, it followed workspace #1).
-
see attached pics for options and .xml locations.
-
If things are working, you can verify the override is occurring. See picture.
In my test case, f:\test\ has a .seeditorconfig.xml. The file I'm editing is f:\test\subdir1\myfile.cpp.
It looks like you've set this up correctly. I've attached a zip file of my test case. I haven't posted my simple user.cfg.xml. You'll have to manually add the Workspace-Test1 C++ formatting profile if you want to try it out.
-
I did get a little tripped up. I already had myfile.cpp open when I configured my beautifier override profile. I had to close and reopen myfile.cpp to get the correct beautifier settings. I copied the "Google Coding Style" profile which has an indent of 2 (totally different than my typical settings).
-
Ok, I got it working, thanks.
-
Can the .seeditorconfig.xml file pathname be specified in the .vpw file...?
If .seeditorconfig.xml could be specified in the .vpw then it would have having to copy it to various places.
-
Can the .seeditorconfig.xml file pathname be specified in the .vpw file...?
If .seeditorconfig.xml could be specified in the .vpw then it would have having to copy it to various places.
Nevermind... I see now that the .xml can be located in an upper directory, and the Beautify Profile Override can specify that path.
-
Thanks for all your help.
Being able to automatically override indent styles among workspaces/projects is a HUGE time saver :) :) :) :)
Thanks.
-
Configuring by directory is a bit better than configuring per workspace. The current method will give you the correct beautifier settings even if you access a file that is not in the current workspace you have open. The downside is that if your files have very poor structure like files in same directory having different beautifier settings, then the current algorithm doesn't support that. Hopefully, nobody needs that. The current override method could be extended to support a filename and/or wildcard. Not trivial but doable.
-
Thanks.
How would I configure formatting for this "double-indent" style (where braces are indented, and then block inside braces is further indented):
{
for(int i=0;i<LastView;i++)
{
if(UserList[i].svcsView==view)
{
SetSVCSInfo(i);
break;
}
}
}
-
SlickEdit doesn't support this style yet.