Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRadev committed Jan 20, 2014
1 parent 95a8155 commit f94e649
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,8 @@

This plugin remaps the standard `p` and `P` mappings to enhance their functionality. When pasting, it compresses all blank lines that result from the paste to a single one (or none, at the top and bottom of the file). That way, even if you copy any leftover whitespace, it'll be neatly trimmed to just one line. This takes effect only for linewise pasting, since it's not entirely clear what the behaviour should be for characterwise and blockwise pasting.

### Mappings

If you don't want to clobber your default `p` and `P` mappings, you can make whitespaste use different ones by setting two predefined variables:

``` vim
Expand All @@ -24,6 +26,8 @@ xmap ,P <Plug>WhitespasteVisual
xmap ,p <Plug>WhitespasteVisual
```

### Special cases

The plugin also takes care of special cases like pasting functions/methods, if-clauses and so on. Currently, these special cases work only with ruby and vimscript, but see below in "Extending" to find out how you can extend the plugin for a different language or change it to fit your own coding style. If you're wondering how this could be useful, consider a ruby example:

``` ruby
Expand Down Expand Up @@ -60,6 +64,8 @@ class Test
end
```

### Compatibility

Whitespaste can play well with other plugins like [vim-pasta](https://github.com/sickill/vim-pasta). The underlying paste command that is being executed is available as a global variable and can be changed. For example, here's how you could combine whitespaste with vim-pasta:

``` vim
Expand Down

0 comments on commit f94e649

Please sign in to comment.