Code Monkey home page Code Monkey logo

nvim-ts-comment-case's Introduction

nvim-ts-comment-case

GitHub Workflow Status Lua

A Neovim plugin to change js/ts comment into JSDoc style.

Installation

  • With lazy.nvim:
return {
  -- change ts comment case
  {
    'moecasts/nvim-ts-comment-case',
    build = function(plugin)
      os.execute(string.format('cd %s && npm i --no-save', plugin.dir))
    end,
    config = function(plugin)
      require('ts_comment_case').setup({
        plugin_dir = plugin.dir,
      })
    end,
  },
}

Configuration

return {
  -- change ts comment case
  {
    'moecasts/nvim-ts-comment-case',
    build = function(plugin)
      os.execute(string.format('cd %s && npm i --no-save', plugin.dir))
    end,
    config = function(plugin)
      require('ts_comment_case').setup({
        plugin_dir = plugin.dir,
      })
    end,
  },
}

Plugin Spec

Property Type Description
plugin_dir string? the plugin directory, a npm package tscc will be installed in there
keymaps Keymaps? the keymaps of the plugin actions

Default Configuration

{
  config = function(plugin)
    require('ts_comment_case').setup({
      plugin_dir = '',
      keymaps = {
        transform_jsdoc = '<leader>cctj',
        range_transform_jsdoc = '<leader>cctj',
        transform_single = '<leader>ccts',
        range_transform_single = '<leader>ccts',

        move_trailing_comment_to_leading = '<leader>ccm',
        range_move_trailing_comment_to_leading = '<leader>ccm',

        move_and_transform_jsdoc = '<leader>ccxj',
        range_move_and_transform_jsdoc = '<leader>ccxj',
        move_and_transform_single = '<leader>ccxs',
        range_move_and_transform_single = '<leader>ccxs',
      },
    })
  end,
},

Features

Keys

  • <leader>cctj: Comment case as JSDoc

  • <leader>ccts: Comment case as single line

  • <leader>ccm: Move tailing comment to leading comment

  • <leader>ccxj: Move Trailing comment and Comment case as JSDoc

  • <leader>ccxs: Move Trailing comment and Comment case as single line

Commands

  • TSCCTransformJSDoc: Comment case as JSDoc all lines
  • TSCCRangeTransformJSDoc: Comment case as JSDoc selected lines
  • TSCCTransformSingle: Comment case as single line all lines
  • TSCCRangeTransformSingle: Comment case as single line selected lines
  • TSCCMove: Move tailing comment to leading comment all lines
  • TSCCRangeMove: Move tailing comment to leading comment selected lines
  • TSCCMoveTransformJSDoc: Move Trailing comment and Comment case as JSDoc all lines
  • TSCCRangeMoveTransformJSDoc: Move Trailing comment and Comment case as JSDoc selected lines
  • TSCCMoveTransformSingle: Move Trailing comment and Comment case as single line all lines
  • TSCCRangeMoveTransformSingle: Move Trailing comment and Comment case as single line selected lines

Related

nvim-ts-comment-case's People

Contributors

moecasts avatar

Watchers

 avatar

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.