Versions:
- Orginal version: NEdit, build/install from source or search your package manager (e.g.
apt install nedit
). This version has no unicode support
- XNEdit: currently manatained, adds a couple of useful features to NEdit, like unicode support (I am using this, and it works like a charm). Build-install from source.
- NEdit-ng: a Qt5 port of Nedit, with a couple of extra features.
Editors providing shell-filters integration
Even though this question is old, I ended up here every now and then because I was unsatisfied with text editors I used to use. I've tried quite many, and I feel I can add to the current answers. Here is a list of editors I tried that have support for shell filters (in one way or another). The list is not exhaustive, and I may edit it later to add more software.
Running in console
- Gnu's nano: most likely already installed in your system (or try via package manager). Nano has great support to run shell commands: Ctrl+T and you get a prompt where you can write shell commands to be executed; you can choose to pipe the currently selected text to the command (prefix the command with the pipe operator
|
). The output of the command is inserted automatically (either appending to file or filtering selection). It is maybe less known that nano allows for user-defined keybindings, which makes it very convenient to work with it (you can basically add snippet functionality to it; I did it). man nano
and man nanorc
is everything you need to know.
- Vi (or vim in compatibility mode): most of vi clones have the ability to run shell filter and/or shell commands to modify current text; in normal mode, press
:
and enter the command prompt. Here you can either type "ed" commands (powerful syntax, similar to 'sed' command) or prefixing the command with !
(or some other symbol/syntax) to read the output of a shell command. The integration with the shell is typically very good and straightfowrard, however more or less features may be provided according to the sèecific vi-clone you are using (e.g. searching for previous command history may not be possible).
- Vim or Nvim: works as vi and has all features you would expect (e.g. command history).
- micro: I never tried micro, but it should also have the ability to run shell filters/commands.
GUI programs
Geany: this is a great text editor. It has a good integration with the terminal, running an embedded VTE where you can interact with the terminal. It supports running and readig shell-commands output via snippets (which allow to define snippets that execute custom shell commands), and support shell filters on selected text or whole document/session via the "mini-script" plugin. However, the latter is a bit inconvenient to use, so if you plan to rely heavily on shell filters and commands you may be better served by another editor.
JetBrain IDEs: among modern, fully-featured IDEs, JetBrains's support shell filter via plugins. I found that Morgan Schweers's "Shell Process" provides the best experience. In my opinion, this works a little bit better than Geany's one, but still it is not good if you need to use a lot of shell filters.
Gedit supports shell filter/command via the "external tools" functionality. It works ok, but unfortunately it is a hassle to set up: basically, you need to define write a wrapper script (within Gedit) that calls any filter/script/command you defined previously. It is way too annoying in my opinion. You may want to use it in those rare occasions whene there is no other convenient option to achieve the editing you want if not using a custom script/filter.
Kate: I know Kate also offers integration with shell filters via plug-ins. However, I never tried it, so can't say anything about it.
XNEdit: among the others, XNEdit has by far the greatest support for shell filters and commands. It has predefined shortcuts to excute shell commands or filter text through a command/filter inserted in a pop-up dialog; it can write a shell command in the file being edited and it will execute it (reading its output) at a keypress. You can easily edit the editor's menu entries (guided by editor's GUI) to define new ones, executing arbitrary shell commands/filters with user-defined shortcuts and/or mouse right-click's menu. These entries may be grouped in submenus (for a more organized UI) and be available or not according to the filetype of the file being edited. The editor functionalities are greatly extended by the shell integration, making it extremely powerful; plus, it is super-easy to set up. It also has a macro language with few well-documented commands, that can be combined with arbitrary user-defined scripts to achieve basically anything. It also has a good (reasonably short) documentation and other extremely convenient integrations (like the xnc command and unique mouse-editing abilities).
Personal recommendation and opinions
When I found out about shell filters, I really tried hard to integrate them in my daily workflow: they are extremely convenient and give the user more editing-power than other software may achieve with complex and obscure plugins. Plus, shell filters work everywhare, in a standard, predictable way; you do not need to migrate your entire scrpts should you change software.
Before XNEdit, I struggled integrating filters in GUIs as I never found a painless workflow.
So I would definitely recommend XNEdit for extensive use of filters/commands.
It is an excellent piece of software, that can be used also when working on large projects.
I personally substitued it to IDEs, and now I don't see myself coming back to them.
I also recommend to pair it with a console-editor, as this is typically needed for quick editing to file (especially if you work a lot with terminals and filters).
For this, Nano is my pick.
The only other reasonable alternative is vim (not vi), but it is unecessarly complex, non-standard, and you will end-up doing everything with plug-ins (rather than shell), reinventing the wheel (note POV: I've been using vim for 5 years as my only editor, and I was sold to it; but I changed my mind for the better).
Vi-clones are either buggy, or miss useful functionalities (e.g. syntax-highlighting, command history), or both. The best I've tried so far are Keith Bostic's nvi, Neatvi and kyx0r's Nextvi.
IMHO, Nano is a great compromise between the simplicity of vi and complexity of vim.
Once you learn how to use command line (Ctrl+T) and piping, it is extremely powerful (not as convenient as XNEdit though).
Just to get a sense of what you can do, I was able to add REPL functionality (for interactive Python and R development) combining nano shortcuts' binding and custom shell-script (not anything fancy) and snippets ability (even though it is probably not worth-it).
It is worth to read through man nano
and man nanorc
(the only documentation you will need; plus, in couple of hours you will master it) and add few custom shortucts (e.g. select-all, copy-paste to/from clipboard).