Code Monkey home page Code Monkey logo

join-comment-aware's Introduction

join-comment-aware

join-comment-aware will join lines and remove extraneous comment indicators. Previously when joining lines (e.g. via ctrl+j or shift+j in vim mode), comment characters are kept and you'll have to remove them manually.

demo

Lines to join:

# This is a comment
# and this is the 2nd line

Old join style:

# This is a comment # and this is the 2nd line

New join functionality:

# This is a comment and this is the 2nd line

Suggested Installation

This is available through the vscode standard installation and in the vscode Marketplace.

I'd recommend replacing your normal join command (e.g. ctrl+j or shift+j in vim mode) with join-comment-aware. If a file type isn't recognized, it performs the default behavior as before.

To replace the default join command without vim mode (ctrl+j), add this to your keybindings.json:

[
  ...
  {
    "key": "ctrl+j",
    "command": "joinCommentAware.join",
    "when": "terminalFocus"
  }
]

To replace the default join command with vim mode (shift+j), add this to your settings.json:

{
  ...
  "vim.otherModesKeyBindingsNonRecursive": [
    {
      "before": ["J"],
      "after": [],
      "commands": [
        {
          "command": "joinCommentAware.join",
          "args": []
        }
      ]
    }
  ]
}

Known Issues

The following file types are supported with comment-awareness joining. Otherwise, default join behavior will take over.

  • ruby
  • python
  • javascript
  • java
  • json
  • csharp
  • cpp
  • go
  • php

Release Notes

Initial join-comment-aware release.

Motivation

I've been thinking about switching from vim to vscode and noticed the line-joiner could use some improvement. And I saw this issue that other folks have the same feedback. I also was inspired by the original vscode join, which got integrated directly into the editor.

0.0.3

Tweak README example.

0.0.2

Add icons. Update version so VS Marketplace can udpate.

0.0.1

Initial release of join-comment-aware

join-comment-aware's People

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.