Code Monkey home page Code Monkey logo

swap-selection-with-clipboard's Introduction

Swap Selection with Clipboard

Swap the Clipboard string(previously copied string) with a Selected strings/a Pointed words in code or Swap two selected strings/poited words, with multiselection in code.

Features

How it work descriptions (text):

With One Selection in code and Clipboard:

  • In the code, Select a string/Point a word - in one place, without multiselection.
  • Use Alt+S to swap this string with the string from the clipboard(previously copied string).

With Double Multiselection in code:

  • In the code, Select a string/Point a word - in two places with multiselection (Alt+Select/Click).
  • Use Alt+S to swap these strings.

Point a word means clicking word without selecting it.
Then, the extension will automatically select pointed word when you press Alt+S to swap.

How it work examples (on GIF-s):

Swap pointed word with clipboard string - Click on one word and Alt+S to swap:

swap-pointed-word-with-clipboard-string

Swap selected string with pointed word - Select string, Alt+Click on some word and Alt+S to swap:

swap-selected-string-with-pointed-word

Swap pointed words - Click on first word, Alt+Click on second word and Alt+S to swap:

swap-pointed-words

Reason for creation. In what helps

I wanted to read the VS Code extension API when creating a simple extension.

When I want to swap two strings in one file - Swap Selected strings/Pointed words is helpful. (Why not other ready extensions?)

Without this extension:

  1. select first string
  2. cut string
  3. point place to paste
  4. paste
  5. select second string
  6. cut string
  7. point place to paste
  8. paste

With this extension:

  1. select first string/point word
  2. select second string/point word
  3. use Ctrl+S

When I want to swap thongs in two different files - Swap Clipboard string with Selected string/Pointed word is helpful.

Without this extension:

  1. select string
  2. cut string
  3. switch tab
  4. point place to paste
  5. paste
  6. select string
  7. cut string
  8. switch tab
  9. paste

With this extension (less spectacular difference):

  1. select string/point word
  2. cut string
  3. switch tab
  4. select string/point word
  5. use Ctrl+S
  6. switch tab
  7. paste

Known Issues

Insignificant Bug:

  • A longer string is incorrectly marked when you quickly press Alt+S 3 times, while the strings are of different length.

Release Notes

1.2.6

Update dependencies.

1.2.3

Activate an extension at the startup.

1.1.0

Create extension.

Similar extensions

I will list similar extensions here, and why they are not enough for me.

  • transpose by Varun Vasan V

    • In this extension, is possible to swap selected strings.
    • In this extension, is not possible to swap a word with a clipboard string.
    • In this extension, is not possible to swap pointed word: swaps the two letters between which the cursor, instead of the pointed words.
    • In this extension, you have the ability to swap more than two selected strings, but I do not know what it can be useful for.
  • Copy Swapper by berickson324

    • In this extension, is possible to swap clipboard string with selected string.
    • In this extension, is not possible to swap clipboard string with pointed word.
    • In this extension, is not possible to swap two selected strings/pointed words.
  • swap-word by davidmart

    • In this extension, is possible to swap two selected strings/pointed words.
    • In this extension, is not possible to swap clipboard string with selected string.

In addition, I wanted to use one keyboard shortcut for all these operations Alt+S.
If you used several complementary extensions (E.g. Copy Swapper and swap-word), the shortcuts would conflict with each other.

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.