Skip to content

Conversation

zo
Copy link

@zo zo commented Aug 7, 2017

Could break habits for a few, but bring back sublime-text and atom duplications for the vast majority of us.

@nicooprat
Copy link

Looking forward to this PR to be merged! :) How could your fork be used as an extension for now? Is this sth VScode allows?

@zo
Copy link
Author

zo commented Aug 29, 2017

Yes, you can remove ContextualDuplicate from vscode and git-clone my fork in extensions folder (~/.vscode/extensions)

I can understand why @lafe is not thrilled to maintain code he mostly not write himself...
(I would be happy to explain it if you have some time to review / ask questions)

Also, I think this behaviour should be native in vscode !
So, be sure to thumb up the related issue : microsoft/vscode#2075

@nicooprat
Copy link

Just tried to remove original extension and clone yours in the specified folder. The extension appears in the list (in green btw), but when running command, I'm getting the error command 'lafe.duplicateCode' not found. Any idea?

PS. Thumbed up ;)

@zo
Copy link
Author

zo commented Aug 29, 2017

Ho yeah, it's written in TypeScript, you should run npm install in the cloned folder
and then npm run vscode:prepublish

@nicooprat
Copy link

It worked, thanks! For others, don't forget to checkout the right branch before running above commands: https://github.com/zo/ContextualDuplicate/tree/st-like

@elado
Copy link

elado commented Mar 28, 2018

Looks like this hasn't merged, I found this extension that provides this functionality:

https://marketplace.visualstudio.com/items?itemName=kkapsner.duplicateselection#review-details

@blunket
Copy link

blunket commented May 11, 2018

Step by step for anyone who wants to get this working

First, uninstall ContextualDuplicate

cd ~/.vscode/extensions
git clone https://github.com/zo/ContextualDuplicate
cd ContextualDuplicate
git checkout st-like
npm install
npm run vscode:prepublish

Then open keybindings.json and add this to map it to ctrl+shift+d

{
    "key": "ctrl+shift+d",
    "command": "lafe.duplicateCode"
}

all done!

@sebudde
Copy link

sebudde commented Nov 19, 2018

This worked for me:

don't uninstall ContextualDuplicate

Then like @blunket

cd ~/.vscode/extensions
git clone https://github.com/zo/ContextualDuplicate
cd ContextualDuplicate
git checkout st-like
npm install
npm run vscode:prepublish

And then

copy extension.js from ContextualDuplicate\out\src to lafe.contextualduplicate-0.2.0\out\src
delete folder ContextualDuplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants