SlickEdit Macros

SlickEdit Logo

Many years ago I started working with an editor named Visual SlickEdit. At a time it was the most advanced editor for software development. Despite years have passed, I believe it is still one of the best editors available for programmers.

Among its advantages is exceptionally powerful macro language. Many people don’t know this but SlickEdit is actually a thousands lines of code written with SlickEdit’s macro language and an interpretor that interprets these lines to create this powerful tool. Hence enormous number of features already built into SlickEdit can be extended into endless number of different abilities.

Over the years I collected number of macros for SlickEdit. Some of them I wrote myself, while others I found on the internet. Each I find exceptionally useful and use on a daily basis. I would like to present these macros, so that you’ll be able to enjoy them as well as I do.

Before I begin this review, I’d like to ask you to send me your favorite macros. I’d love to try them and post them here. In particular, I’m very much interested in macros that increase productivity. You can leave a link to your macros in comments here on this page (I’m moderating comments so I can keep the link hidden if you want) or send them to my email – alexander.sandler@gmail.com. Thank you!

Table of Contents

Highlight parensBACK TO TOC

This pearl is from Slick-C magician, Mr. chrisant. You can often see him posting cool stuff on SlickEdit’s forums. This macro highlights parens. It does a much better job than build into SlickEdit highlighting feature. One image worth a southand words so take a look at the screen-shots below.

You can get it here and on SlickEdit’s forum thread.

Installation is easy. Just load it via Macro->Load Module menu and assign a keyboard shortcut to HighlightParens command.

Remember that pressing the shortcut several times in a row brings different results. Just try it.

Project Toolbar ExtensionBACK TO TOC

This macro is from Slick-C maestro, Mr. Graeme from SlickEdit’s forum.

It adds a bunch of very useful actions to project’s context menu. After installing the macro, when you right-click somewhere in the project toolbar and go into “More” option, inside you’ll find plenty of additional stuff. This includes:

  • You can add a file directly into sub-directory in the project, instead of looking for it with the browser.
  • Explore folder containing file or directory you right-clicked on.
  • Change current directory to one you right-clicked on.
  • Copy into clipboard the name of the directory or a file.

Grab the macro here. You can also download it from appropriate thread on SlickEdit’s forum. It works on SlickEdit 2008 out of the box. If you want to use it with SlickEdit 2007 and SlickEdit 11, open the file in editor, comment definition of SLICK_V13 and uncomment definition of SLICK_V12 or SLICK_V11 respectively.

Installation is easy as a breathe. Load the macro via Macro->Load Module menu and you’re done.

In case you still have some doubts, check out these screen-shots.

OLS – Open Local SymbolBACK TO TOC

This is perhaps that most advanced macro in my collection. Once triggered, it opens a list of symbols available in currently opened file and allows easily search for certain symbol. The catch is with the way you search. You often remember only a word or two out of symbol name. Conventional search methods would be less effective here because you do not remember the full name. What OLS allows you to do is to find a symbol by only a small fraction of its name. It is exceptionally handy when you are used to work with keyboard. In that case you would press a keyboard shortcut to run the macro, type few letters comprised in the symbol name and hit enter to open the symbol. Alternative is to either few trial and errors with regular search or tediously scanning list of symbols for the right one.

Originally I wrote and maintained this macro, until couple of month ago I posted it in SlickEdit’s forum. Then it was immediately picked by hs2 (sorry, don’t know his real name). He rewrote the macro almost completely, fixing few problems and adding tons of new features. He’s still maintaining the macro.

You can download the latest version of the macro formĀ here. You can also download it from a thread on SlickEdit’s web-site, but it requires registration. This version should work with SlickEdit 2007 and SlickEdit 2008. In case you have problems with the macro, you can leave a comment here or drop a note on SlickEdit’s forum.

Installing the macro is simple. You can use Macro->Load Module menu to load the macro. Next assign a keyboard shortcut to ols and you’re done.

And here are some screen-shots.

Open Project FileBACK TO TOC

This is pearl in my collection. This time it allows you to search for and open one of the files in currently active project. Search principle used here is similar to one used in OLS macro above. There are few differences though. It interprets last word of the search pattern as a file name, while first words interpreted as path.

If you are friendly with your keyboard, this will definitely increase your productivity.

Again, latest version is here or here – later requires registration. Problems can be reported on this page or on forum.

Installation is via Load Module menu. Again, this version is for SlickEdit 2007 and SlickEdit 2008.

Comment and Uncomment SelectionBACK TO TOC

Another macro in my collection is comment and uncomment selection. Its origin is unknown. I remember having it for at least several years. It does what it name implies – comments and uncomments selected lines of code. The comments are C++ // type of comments.

You can get it here.

To install it ismply load it via Macro, Load Module menu. After loading it, assign a keyboard shortcut to comment-selection and uncomment-selection.

Did you know that you can receive periodical updates with the latest articles that I write right into your email box? Alternatively, you subscribe to the RSS feed!

Want to know how? Check out
Subscribe page

5 Comments

  1. Thanks for putting this page together. I found your open_project_files and open_local_symbols macros to be incredibly useful. I’ve copied these macros to a public repository on GitHub, so I could keep track of my changes. Here’s the URL: http://github.com/humblehacker/slickedit_macros

    Right now, there are only those two macros of yours there, but I plan on adding other macros that I’ve created over the years. It would be nice if we had a central location for user-created SlickEdit macros. Perhaps this could be it?

  2. @David Whetstone
    Thanks for spreading it :-)
    I don’t mind if it will be on github, as long as someone maintains it – I don’t have much time lately and I didn’t add new stuff for quiet some time.

  3. This is really interesting, You are a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your magnificent post. Also, I have shared your site in my social networks!

  4. sahaj says:

    The open project file macro on SE 2007 is not needed. I was able to bind the command “activate-files-project” to Alt+O and it pretty much does the same thing as the macro that you’ve written. Perhaps I’m misunderstanding your intentions with this macro.

  5. @sahaj
    Actually, I think that it does have some added value. The way it allows you to search for file name is precious. But activate-files-project or the new open dialog in later versions of SE is pretty good too.

Leave a Reply

Prove you are not a computer or die *