VS Code Vim: How do you highlight current line?

后端 未结 3 1143
一整个雨季
一整个雨季 2021-01-11 11:34

How do you highlight the current line using Vim VS Code?

This functionality would be awesome. Anyone know if this configuration is possible in Vim VS Code? http://vi

相关标签:
3条回答
  • 2021-01-11 12:13

    Shiftv toggles visual line, not sure if you've discovered that yet or not.

    It's worth pointing out that in Vim, you don't need to highlight to act on or manipulate the current line (as I see you're trying to do in your comment to another answer). In fact, it's often better/faster not to. For example:

    • dd: delete linewise
    • Shiftd: delete from cursor to end of line
    • yy: yank linewise
    • Shifty: yank from cursor to end of line
    • cc: change linewise
    • Shiftc: change from cursor to end of line
    • >>: indent line
    • <<: unindent line

    If you find yourself in visual mode a lot, that can be a sign that you haven't yet become comfortable with text object motions and text object selection.

    0 讨论(0)
  • 2021-01-11 12:14

    Try this in your settings.json:

    "workbench.colorCustomizations": {
    
      "editor.lineHighlightBackground": "#ff0000"
    }
    

    This assumes that you have

      "editor.renderLineHighlight": "line",
    

    (that is the default) set to "line" or ""all".

    [EDIT after your comment about selecting]

    I am not exactly sure what you are looking to do but Ctrl-C selects the current line and Ctrl-I highlights the entire line but doesn't select it. In neither case does the highlighting stay on a previous line after you move the cursor.

    0 讨论(0)
  • 2021-01-11 12:25

    I found that you can use shift+alt+RightArrow to select parts within current line.

    Hope this helps

    0 讨论(0)
提交回复
热议问题