t9md / atom-vim-mode-plus

vim-mode improved

Home Page:https://atom.io/packages/vim-mode-plus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: inline comment support

sersorrel opened this issue · comments

commented
debug info
{
  "atom": "1.45.0",
  "platform": "linux",
  "release": "4.15.0-91-generic",
  "vmpVersion": "1.36.4",
  "vmpConfig": {
    "charactersToAddSpaceOnSurround": [
      "(",
      "{",
      "[",
      "<"
    ],
    "stayOnVerticalMotion": false,
    "useSmartcaseForSearch": true
  }
}

Checklist

You have to check all before open issue.

  • Provide your environment info clipped by Vim Mode Plus: Clip Debug Info command.
  • Try with latest Atom and latest vim-mode-plus.
  • Pick a descriptive and non-ambiguous subject
  • Express "what" you want(feature? config option?, behavior change?) in short sentence(not long!).
  • Contrast current behavior if you want to change current behavior, with sample text, operation(keystroke) and result.
  • Include real use case so that maintainer can understand "why" you need help.
  • Include Atom(atom --version), vim-mode-plus version, and OS version(e.g. macOS Sierra 10.12.3).
    • $ atom --version
      Atom    : 1.45.0
      Electron: 4.2.7
      Chrome  : 69.0.3497.128
      Node    : 10.11.0
      
    • vim-mode-plus 1.36.4
    • Ubuntu 18.04
  • If keybinding issue, Read this.

I set up a mapping similar to vim-commentary:

"atom-text-editor.vim-mode-plus:not(.insert-mode)":
  "g c": "vim-mode-plus:toggle-line-comments"

however, this doesn't work well (obviously) for if you have part of a line selected and you want to insert a block comment without commenting out the rest of the line.

tcomment supports inline comments, where only part of the line is commented out – could vim-mode-plus also support this?

i.e. having some visual-mode selection of less than a full line and pressing gc would use a block comment to comment just the selection out, rather than a line comment.