Hacker News new | past | comments | ask | show | jobs | submit login

My favorite vim plugin is to not use any plugin: use the filter command "!", the unix way.



more on "!":

Run the given cmd/pipeline, and put it's output at the current cursor ___location:

    :r ! <cmd>

Filter the whole buffer through the given cmd/pipeline:

    :%! <cmd>

Filter a visual selection through the given cmd/pipeline: make selection (with mouse if you have :set mouse=a or gvim, or with any of the variations on 'v'), then hit '!'

you will pop into a command line like this:

    :'<,'>! <cmd>

'< is the beginning of the visual selection, and '> is the end.


Sure, but some things (eg, surround.vim) can't be emulated with that.


give me an example of something that i can't filter in a sed/grep/ed/awk/perl script.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: