GithubHelp home page GithubHelp logo

swapie.vim's Introduction

Swapie

Swapie adds :T for swapping lines in the spirit of :m and :t

Installing

Install Swapie the tpope way:

mkdir -p ~/.vim/pack/tpope/start
cd ~/.vim/pack/tpope/start
git clone https://tpope.io/vim/surround.git
vim -u NONE -c "helptags surround/doc" -c q

Or install Swapie with your favorite package manager and 'ianfabs/swapie.vim'

Using

1~ I
2~ love
3~ you
4~ so
5~ much
6~ mom

:2,6T

Boom, you should get:

1~ I
6~ mom
3~ you
4~ so
5~ much
2~ love

(I actually used the plugin to do that btw)

Related

This section, and a lot of the README, is thanks to the generous support of kiryph and zemja .

swapie.vim's People

Contributors

ianfabs avatar

Watchers

 avatar

swapie.vim's Issues

Range support

1   ~ /* Old Code
2   ~ function two(egg) {
3   ~    let result = "tastey" + egg;
4   ~    return result;
5   ~ }
6   ~ */
7   ~ 
8   ~ function one(egg) {
9   ~      console.log("This is a test");
10 ~      console.log("I love " + egg);
11 ~ }

Currently, the syntax works like this, given the above example:

:2,6T<CR>

To be truly powerful, swapie should support ranges like this:

:2,5T8,11<CR>

which should swap lines 2-5 with lines 8-11. commenting out the function one block.

it should also support moving a block to a specific line

:8,11T5<CR>

which should move the function one block into the comment block.

I know nothing

Sorry

This project will probably not receive as much love as I would like to give it. I have a very limited working knowledge of Vim and Vimscript and I am still learning. I do have aspirations though, so if you'd like to see what I have planned check the features label

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.