SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Features and/or Improvements => Topic started by: garion911 on September 08, 2011, 04:09:15 pm

Title: Make the project name available in C/C++ Aliases
Post by: garion911 on September 08, 2011, 04:09:15 pm

My goal is to add a header to my C/C++ files that works with doxygen, and one of the 'requirements' is to have the project name in there. I've been using aliases for a while to add the basic structure, but can't find a way for it to insert the project name.. I tried the %RM (and %\rm) I've seen elsewhere, but I think cause aliases use %\r for the return type, its not working.

I think I could do it with file templates, but since they are buried in a menu, and not where I generally right click to add files, I don't use that feature... I think I could figure out how to add it to the menu, but I think it should be there from the get-go...
Title: Re: Make the project name available in C/C++ Aliases
Post by: hs2 on September 08, 2011, 04:39:56 pm
@garion911: You can easily extend aliases by using the 'execute macro' feature '%\m':

- add this to e.g. common aliases 'alias.slk'
Code: [Select]
%\m_alias_ins_project%
and this alias helper macro to your user macros:
Code: [Select]
void _alias_ins_project()
{
   _insert_text( strip_filename( _project_name, 'PDE' ) );
}

You see - there is no limit ;)

Have fun,
HS2