Macro Collection
From Niki
For an overview on what macros are, see Macros. For larger macro applications hosted externally, see the Accessories page.
Until the new automated resource library thingy is up, publish your macros right here on the wiki (or link from here to your own location).
Contents |
How to use the macros here:
- Go to the page with the macro you want.
- Press the "Edit" button at the bottom of the page.
- Copy the code from between the <pre> </pre> tags.
- See the Macros or Macro Programming page on how to turn that raw text into a macro.
- Don't press the wiki page's Save button (just in case you changed something by accident). Hit your browser's Back button instead.
Note: It's probably best to copy/paste the code for the macros right from the page source (as described above), rather than directly from what you first see in your browser. That way you get the correct indenting and no HTML to remove.
(The old macro archive is [1]. It is mirrored to Marc's Macros to update and to merge it eventually.)
Programming
macro-kit - Macro collection for programmers written by Frank Perbet.
cscope - runs cscope (analyses code better than ctags) query and then shows the query results in a listbox so that user can open files from there. Use highlighted text as query string, otherwise ask for it in a dialog box
Develop NEdit Macros - utilities to develop or test NEdit macros
LivePythonSyntaxCheck - Check the syntax of your Python buffer
OpenFileWithTag - a tweak of the usual ctags behavior that, if you are not highlighting a word, asks you for the tag in a dialog box
PerlMacrosAndCompletion - My macros for perl code auto-completion, inline documentation, code refactoring and more.
VerilogFindPair - Finds and marks all sorts of Verilog pairs (e.g. begin-end, case-endcase).
General Editing
AutoIndent - Force standard auto-indent even if smart-indent is on (bind for example to Ctrl+Return)
Change Case - Cycles the case of selected text.
CompleteWord - Try to complete a text at current cursor position by scanning the whole text in buffer.
Convert2HTML - Converts the highlighted document to HTML (great for color printing)
DeleteFollowingWhitespace - delete all contiguous whitespace immediately after the cursor
FindAndOpen - Not sure exactly where that file is in your hierarchy, but know the name? Highlight it in the buffer or type it in the dialog box to find and open. Multiple matches are presented for your choice to open.
LineColToPos - Translate line+char coordinates to buffer position
ManyClipboards - as many additional clipboards as you like
OpenFileWithTag - a tweak of the usual ctags behavior that, if you are not highlighting a word, asks you for the tag in a dialog box
ParagraphFilling - enhanced replacement for normal Ctrl+J: format paragraphs respecting quotings in e-mail
PrefixSuffix - adds prefix and/or suffix to selection
EnumerateColumns - Enumerate a column.
AutoIncDec - Add / Sub 1 to the highlighted number.
Rangeset Macro Collection - for comfortable management of rangesets
Rangeset Hot Keys - Use function keys to manage rangesets
Find/Cut/Paste Hot Keys - Find, Cut, Paste without dialogs or control keys.
SmartKeys - Some small enhancements to some popular keys.
WritingLists - smart-indent Newline macro for writing lists or enumerations
ConvertingTabs - functions to convert the tab characters in a string of text to spaces and vice-versa
MakingColumns - functions for a macro which divides fields in a set of lines so that they appear in columns, padded with spaces; the macro can be used to lay out tab- or comma-separated value text files
External integration
UseTheKdeFileDialogs - Use the powerful and convenient kde file dialogs to open and save files and especially to navigate the file system.This will replace nedit's own difficult and limited (imho) file dialog, if you use kde.
PlatformSpecific - Macros and or scripts helpful on a specific platform like MS Windows (Cygwin), Mac OS X, ...
CVS-Integration - only some simple shell-menu stuff so far, but still a timesaver
FileMerge - Execute diff to produce file difference data in your NEdit window, then invoke fileMerge_from_diff() to analyse them. One of the original motivations for adding colored range sets to NEdit. (Requires NEdit 5.4+)
LiveDiff - a diff of the buffer against the saved version of the file
LivePythonSyntaxCheck - Check the syntax of your Python buffer
nGrep - A grep wrapper hand-made for NEdit development
nMan - Watch manpages with NEdit (in case your less is broken)
neman - Another man wrapper.
ManTip - Show synopsis in a calltip of a manpage
PyGrep - one more grep wrapper written in Python/Tkinter
Subversion Macro Set - a set of macros and menu definitions to work with an svn repository.
SCCS-Integration - Macros providing basic support to SCCS (Source Code Control System)
SuperGrep - recursive grep with output to new file (highlight file path and name in grep output buffer and use CTRL-Y to open them!)
ViewFileInMozillaNewTab - open the current file in a new tab in Mozilla, if open; starts Mozilla is Mozilla not running
Vim Modelines - A special case, since it requires a file_open_hook() to really work.
Utility macro function libraries
ArrayUtilities - building arrays from argument lists, requesting array keys and values (requires NEdit 5.3+)
ArrayEntrySelection - display the content of an array showing keys and values, allowing the user to select one (using the list_dialog() built-in)
ExtractPatterns - extract highlighting pattern sets and macro menu definitions
FileUtils - extract basename, extension, path, file name
MakeMacroCallTips - scan your favourite NEdit macro collection directory and generate text suitable for a calltips file holding all your comments for those macros.
OnDemandMacroLoading - faster startup for heavy macro users: just-in-time loading of NEdit Macro files. Includes reload and open-for-editing capabilities. (requires NEdit 5.3+)
Word Wrap - returns a string with \n added at points to wrap the text based upon your chosen width. Includes support for none breaking spaces and none breaking hyphens. Great for displaying large amounts of text in dialogs or to a log window.
"Missing features"
BookmarkFiles - bookmark and show list of bookmarked files
ChangeFontsQuickly - Other GUI editors let you zoom the current text fonts with a single click. Here is what NEdit can do for you.
packaged imports - Unix only: This macro offers users a selection of changes to the user's preferences (you define these) and handles the import and any associated autoload.nm changes for them. It remembers what has already been selected and acts accordingly. It can also hide unneeded standard macros from menus.
Great for implementing standards, such as indenting, to a user base, or publishing company macros to the menus.
SaveAllFiles - saves all files.
SwitchDocument - small collection: open file in new window, open previous, switch document (if you have large number of files opened)
RestoreSession - functions for saving and restoring the last editing session
NEsession - macro package for NEdit session management. You can save/restore editor state and delete auxiliary files. To use the package you must compile patched NEdit from CVS snapshot.
ProjectManagement - The project management macros from http://www.mailnet.co.uk/~marc/msl.html are a bit too simplistic and didn't work very well, so I enhanced them and added many features, check this out!
How to contribute:
- Introduce categories and/or subpages as they become useful, but not before. Elaborate hierarchies with little or no content are hell to browse.
- Use alphabetical ordering within a category.
- Put the actual macro and associated info on a separate page.
- Use the <pre> </pre> tags to enclose the macro code, so it can be copied directly from he page source into a macro file and work.
- Include as much info and documentation as I can convince you to.
It is a lot more tempting to try a macro if you can read a little about things like:
- What it's for. The need/usefulness may not be as obvious to your readers as to you. Tell them! Prefereably already in the listing, but also on the page, so searches will find it.
- How it is meant to be used
- How it improves on earlier efforts
- Maybe even a little about how it works That's not a bad order to do it in, either.
But of course: if you don't have the time or energy for all that, post it anyway, so at least it is available, and maybe someone else will add some commentary.
- You can list the macro in several categories if appropriate. The aim here is to help people find what they need, not to organise the universe.
- Feel free to post your own enhanced versions of things already in here, but preferably do it as a parallell to the existing one and explain what the difference is.
