Giter Site home page Giter Site logo

priyanshu92 / surroundselection Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 6.0 269 KB

This is a visual studio extension which lets you quickly wrap the selected text with double quotes, single quotes, braces etc..

Home Page: https://marketplace.visualstudio.com/items?itemName=PRIYANSHUAGRAWAL92.SurroundSelection

License: Other

C# 100.00%
visual-studio-extension double-quotes visual-studio productivity

surroundselection's Introduction

Surround Selection

🚨Project Archived: This functionality is now natively available in Visual Studio🚨

Build status

Download this extension from the VS Gallery or get the CI build.


The quickest way to wrap some selected text with various delimiters like double quotes, single quotes, braces etc.

See the change log for changes and road map.

Features

Toggle wrapping of selected text in visual studio with:

  • Double Quotes " "
  • Single Quotes ' '
  • Braces { }
  • Parentheses ( )
  • Square Brackets [ ]
  • Angular Brackets < >
  • Asterisk * *
  • Multiline Comment /* */
  • Hash # #

Steps to use

Select any text in Visual Studio and right click.

Select And Right Click

Then select Surround Selection With and then select the option you want eg. Double Quotes to get the text wrapped around that.

Hotkeys

Action Hotkey
Double Quotes Ctrl+K, Ctrl+'
Asterisk Ctrl+K, Ctrl+*
Angular Brackets Ctrl+K, Ctrl+<
Hash Ctrl+K, Ctrl+#
Parentheses Ctrl+K, Ctrl+(
Square Brackets Ctrl+[, Ctrl+[
Curly Braces Ctrl+K, Ctrl+{

For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.

License

Apache 2.0

surroundselection's People

Contributors

imgbotapp avatar priyanshu92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

surroundselection's Issues

Option to make it work like Sublime and Visual Code

Description

Please add an option to make it work like Sublime and Visual Code does, meaning just pressing the ( key to surround the current selection with parenthesis and if there is nothing selected just creates the 2 characters () with the caret in the middle of them, or if not possible just put (.

Plus the very same feature for the other characters (", {, ')

Thanks.

Intellisense automatically replaces selection

Installed product versions

  • Visual Studio: VS Community 2017
  • This extension: 2.0.3

Description

As an example, if you select "Format" in String.Format(), then add parenthesis it turns to String.(FormatException)()
There will be rare cases where this is undesired behavior and I wish there was an option to be able to bypass intellisense when using the extension

Steps to recreate

  1. Select "Format" in String.Format()
  2. Press Ctrl + K, Ctrl+(

Current behavior

Turns to String.(FormatException)()

Expected behavior

Turns to String.(Format)()

Inserts extra tabs, screwing up formatting

Installed product versions

Visual Studio 2017 Enterprise

Description

Great idea, but doesn't work right. I wanted this to wrap sections of code in curly brackets to limit scope. Instead of simply inserting curly brackets at beginning and end of selected block (with correct indentation), this tool completely messes up the formatting in the selected block by inserting a whole lot of extra tabs; the text is seemingly randomly pushed far to the right.

Steps to recreate

Select block of code; apply this tool (with curly brackets).

Current behavior

Inserts brackets in wrong places; adds a bunch of extra tabs that mess up formatting.

Expected behavior

With selected block of code, insert brackets { and } before and after selected block, correctly indenting text of selected block. Example final result:

{
    //Stuff
    const int foo = 42;
    EetMoarChikkin(foo);
}

Undo after applying surround is not working correctly

Installed product versions

  • Visual Studio: 2019 Community
  • This extension: 2.0.3

Description

Undo after applying surround is not working correctly

Steps to recreate

  1. Select text in code ditor
  2. Hit Ctrl+K, Ctrl+[ to surround with {} braces
  3. Hit Ctrl+Z to do Undo

Current behavior

It does not return to previous state, even worse it changes already written text.

Expected behavior

It should return the code to exactly same state as before applying the surround, in one step.

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.