Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This Vim plugin provides a command that changes the order of 2 delimited pieces of text

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 autoload
Octocat-spinner-32 doc
Octocat-spinner-32 plugin
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
README.md

Flipwords

The plugin Flipwords provides the command Flip that changes the order of two delimited words on a single line.

Examples

Flip    - flip two white-space delimited words
Flip ,  - flip two items in a comma-delimited list 
Flip , )    - flip last two parameters (nested parens are not handled)
Flip = ;    - flip two words delimited by '=' and ';' (c assignment)
Flip = )    - flip two words delimited by '=' where the second 
      word ends with and includes ')'

Some effects of the Flip command (the coursor is at the character following '|'):

~~ let |b = a
:Flip =
~~ let |a = b

~~ call doThis(|"one", "two", "three")
:Flip ,
~~ call doThis(|"two", "one", "three")

~~ call doThis("one", |"two", "three")
:Flip ,
~~ call doThis("one", |"three"), "two"

~~ call doThis("one", |"two", "three")
:Flip , )
~~ call doThis("one", |"three", "two")

~~ if |result == getValue() " some comment
:Flip == )\zs
~~ if |getValue() == result " some comment
Something went wrong with that request. Please try again.