sponsor Vim development Vim logo Vim Book Ad

permut.vim : Plugin for swapping text columns separated by arbitrary character.

 script karma  Rating 0/0, Downloaded by 1064  Comments, bugs, improvements  Vim wiki

created by
JY LM
 
script type
utility
 
description
This permut.vim plugin allows to swap two columns of text in a selected range of lines.  The columns can be separated by any character (not present in text). By default, the column_separator is '|' character. The user can enter any kind of separator character. The more usual separator character encountered are the ',' or ';' or ':' characters.

Here is the syntax of the Permut command:

    :[range] Permut <colnum1> <colnum2> [column_separator]

Example 1 with default column separator:

    1  ab cd | ef gh | ijk lmn | opq rst | uv wx | yz
    2  ab cd | ef gh | ijk lmn | opq rst | uv wx | yz
    3  ab cd | ef gh | ijk lmn | opq rst | uv wx | yz
    4  ab cd | ef gh | ijk lmn | opq rst | uv wx | yz
    5  ab cd | ef gh | ijk lmn | opq rst | uv wx | yz
    6  ab cd | ef gh | ijk lmn | opq rst | uv wx | yz
    7  ab cd | ef gh | ijk lmn | opq rst | uv wx | yz

    :1,7 Permut 1 3

    1  ijk lmn | ef gh | ab cd | opq rst | uv wx | yz
    2  ijk lmn | ef gh | ab cd | opq rst | uv wx | yz
    3  ijk lmn | ef gh | ab cd | opq rst | uv wx | yz
    4  ijk lmn | ef gh | ab cd | opq rst | uv wx | yz
    5  ijk lmn | ef gh | ab cd | opq rst | uv wx | yz
    6  ijk lmn | ef gh | ab cd | opq rst | uv wx | yz
    7  ijk lmn | ef gh | ab cd | opq rst | uv wx | yz

For more detailed documentation, see the README on GitHub:
https://github.com/jlemetay/permut
 
install details
A simple way to install the permut vim plugin is to use [pathogen](https://github.com/tpope/vim-pathogen). Once this plugin manager is installed, you have just to run these commands:

    cd ~/.vim/bundle
    git clone git://github.com/jlemetay/permut.git

 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
permut_0.2.tgz 0.2 2015-01-19 7.0 JY LM Take into account another additional text aligner plugin: vim-easy-align (https://github.com/junegunn/vim-easy-align) as suggested on site http://usevim.com/2015/01/05/permut/
permut-0.1.tgz 0.1 2015-01-05 7.0 JY LM Initial upload
ip used for rating: 216.73.216.103

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github