There are probably a lot of editors that can do what you want. You might want to go here and poke around for references:
http://texteditors.org
Under Windows, I tend to use Notepad++, but have an assortment of other things installed as well. Notepad++ is one of a class of editors based on Neil Hodgsons's
Scintilla edit control. Scintilla provides syntax highlighting and code folding features for a large number of languages. There are a number of other editors based on Scintilla, and the TextEditors wiki has a family devoted to them. Another that I like is
Geany, which is based on Scintilla, but extends the editor through plugins to become a lightweight IDE.
Being able to edit macros implies a macro language in which macros can be written. Some Scintilla based editors use
Lua as an embedded scripting language, and you can write custom routines in Lua and call them from the editor.
Other editors may have different macro languages, and some may support more than one.
Vim is "vi Improved", based on the design of the vi editor shipped with Unix systems.
Vi is a rude shock for folks from the PC world, but makes sense once you understand the design. It was written by Bill Joy, co-founder and former VP of R&D at Sun Microsystems, in the days when the usual access to a Unix system was via a dumb terminal, possibly connected by a dial-up phone line. Early terminals didn't always
have arrow keys or F-keys, and vi's design doesn't use them. If you have a Ctrl-key and a QWERTY keyboard, you can use vi. (Unix systems generally map arrow keys, and vi will try to use whatever is defined by the termcap entry for the terminal Unix thinks you are using, and arrow keys normally work.) Vi also originated in the days of low bandwidth connections, so the design had a deliberately terse command syntax to let you accomplish the maximum amount of editing with the minimum keyboard input, and the screen handling routines were designed to minimize the amount of screen update needed. Vi has a macro facility (see the :map directive), and I've seen a vi macro that solves the Towers of Hanoi puzzle. The real power of vi came from support of regular expressions, and the fact that you could take a buffer being edited and pipe it through external programs to accomplish things not possible with unaided vi. If you used Unix, you learned to use vi, for the same reason people once used to learn WordStar on the PC: it might not be the editor you preferred, but it was likely to be available on what ever machine you were called upon to work on.
Bram Moolenaar's
Vim takes vi's basic design and vastly extends it, adding multiple editing buffers displayed in multiple windows or tabs, a full macro language, and a host of other enhancements. It's free, open source, and cross-platform, cross-platform, available for a number of architectures, and is shipped
as vi by a variety of Linux distros.
Emacs was originally written by Richard M. Stallman, the founder of the Gnu project. The earliest version was a set of macros in the TECO (Text Editor and COrrector) language available on the Digital Equipment Corporation mini-computer Stallman was working on at the MIT AI lab. (The name Emacs comes from "Editing MACroS") When TECO was going away, Stallman rewrote Emacs in LISP. LISP is intended for string processing, and mapped well to the sort of tasks performed by a text editor.
The current version of
Gnu Emacs is essentially an interpreter for a dialect of LISP, and most of the editor is written in the dialect of LISP it implements. If you are fluent in elisp, you can extend emacs as you like, and people have. There are "major modes" for editing code in most programming languages, plus interfaces to compilers and debuggers, plus modes for reading and replying to email, reading Usenet news, working at a command line, and even playing games. Unix old-timers who preferred emacs would run it when they logged on, and do
everything from within it. It became the shell from which they accessed the system. Like Vim, Emacs is free, open source, and available for an assortment of platforms.
There are lots of editors based on the emacs design, but using different implementations. Some use a different macro language, and some don't do macros at all. (Generally, these are tiny editors for low end machines.)
Whether vi or emacs was the One True Editor for Unix systems was a Holy War for some old timers.
I'd probably look at one of the Scintilla variants first, then broaden my search from there.
______
Dennis