I\'m trying NERDtree which is pretty cool, but what I\'d like to do is execute special commands, or scripts, on the selected file.
For example, I\'d like to highligh
:!
This will execute the current file under the cursor (in windows, this means that it will open the default program associated with the file). I haven't used NERDTree, but if the file is highlighted, it might not work quite right (it will try to filter the selection through the command you provide).
You can also use this to execute commands on files:
:!notepad
Depending on what you want to do, you can also take the content of a file and send it through your script for filtering. Based on your example, this sounds like it might work out. The selected content will be sent to standard input of your program (or script) and the selection will be replaced by it's output. For example, highlight some text and press :
and you should see :'<,'>
(which are markers for the current selection). Then type !
followed by your command. The result might look like:
:'<,'>!myscript
When you execute this, the part you highlighted will be sent on standard input to myscript
and then replaced by the output of myscript
.