RSS

 
WinEdt Macro Library  | WinEdt previous macro  | next macro

statuspath

Description

This macro shows the %p and %!P path (or either of them) in the Status Line, trimmed to size by snipping the middle part.

If you want to have the Current File's and/or Current Path in the Status Line (using Custom Info A resp. B) but it doesn't fit, this macro is the right one for you. It snips off the middle part of the path and replaces it with "...", so that you always see the important parts, the beginning and the end of the path.
(Current Path is the path you are actually in, i.e. the one that you are in when you want to open a file;
 Current File's Path is the path of the active file.)
A special feature: If the %!P and %p paths are the same, the Project's name is shown instead.

Installation

  • Save the file in the folder %b\Macros\
  • Append the following line to the macro file %b\Macros\MDIActivate.edt:
    [Exe("%b\macros\statuspath.edt")]
    
  • In Options | Appearance | Panels, set "Custom Info A":
    %$("InfoA");
    
    and / or "Custom Info B" to:
    %$("InfoB");
    

Options

It's no problem to use the macro only for one kind of path (probably the Current Path, for the Current File's Path can be shown in the Caption). Just leave out the definition for one of the Custom Infos (%$('InfoA'); shows the Current File's Path %p, while %$('InfoB'); shows the Current Path %!P).

You can also play around with the lengths, if the default of 40 characters is too short or too long for your Status Line. You are pointed to the relevant numbers in the file's documentation.

Download

/StatusPath.edt

Macro contributed by Robert <w.m.lgmx.net>.

WinEdt Macro Library  | WinEdt previous macro  | next macro