Skip to content

Instantly share code, notes, and snippets.

@sjl
Created December 15, 2014 18:58
Show Gist options
  • Select an option

  • Save sjl/b9e3d9f821e57c9f96b3 to your computer and use it in GitHub Desktop.

Select an option

Save sjl/b9e3d9f821e57c9f96b3 to your computer and use it in GitHub Desktop.

Revisions

  1. sjl created this gist Dec 15, 2014.
    34 changes: 34 additions & 0 deletions ext.vim
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    " run command
    " no stdin
    " output displayed in "Press enter to continue" style
    " current buffer untouched
    :!uptime

    " run command
    " pipe range of text to command on stdin
    " output replaces the range in the current buffer
    :RANGE!grep foo

    " run command
    " no stdin
    " append output beneath the current line in the buffer
    :r!uptime

    " run command
    " no stdin
    " append output beneath the last line in the range
    :RANGEr!uptime

    " run command
    " pipe whole buffer to command on stdin
    " output displayed in "Press enter to continue" style
    " current buffer untouched
    " (the space between w and ! is important)
    :w !pbcopy

    " run command
    " pipe range to command on stdin
    " output displayed in "Press enter to continue" style
    " current buffer untouched
    " (the space between w and ! is important)
    :RANGEw !pbcopy
    8 changes: 8 additions & 0 deletions lol.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    | command | stdin | stdout |
    |-------------|------------|--------|
    | `:!` | none | press enter to continue |
    | `:RANGE!` | range | replace range |
    | `:r!` | none | append below curent line |
    | `:RANGEr!` | range | append below last line in range |
    | `:w !` | whole file | press enter to continue |
    | `:RANGEw !` | range | press enter to continue |