简体   繁体   English

Home 键 go 到 Visual Studio Code 中的行首?

[英]Home key go to start of line in Visual Studio Code?

Where is the option in Visual Studio Code to make the Home key go to the start of the line? Visual Studio Code 中将 Home 键 go 设置为行首的选项在哪里?

Right now you have to do现在你必须做

Home , Home,

or或者

Home , Ctrl + Left Arrow主页, Ctrl +左箭头

i'd prefer that home goes to the start of the line.我宁愿家在线路的起点。

Bonus Chatter奖金喋喋不休

File → Preferences → Keyboard Shortcuts:文件 → 首选项 → 键盘快捷键:

在此处输入图像描述

Bonus Reading奖金阅读

I don't think there is any buiilt-in option to change the current behaviour of the Home but you change it yourself easily with the help of a macro extension, like multi-command (in keybindings.json ):我认为没有任何内置选项可以更改Home的当前行为,但您可以借助宏扩展轻松更改它,例如多命令(在keybindings.json中):

{
  "key": "home",
  "command": "extension.multiCommand.execute",
  "args": {
    "sequence": [
      "cursorHome",
      "cursorHome"
    ]
  },
  "when": "editorTextFocus"
}

Now pressing Home once has the same effect as pressing it twice.现在按Home一次与按两次具有相同的效果。


A cleaner way is to give the command cursorLineStart the Home keybinding:一种更简洁的方法是为命令cursorLineStart提供Home键绑定:

  {
    "key": "home",
    "command": "cursorLineStart",
    "when": "editorTextFocus"
  },

Either do it from the Keybinding Shortcuts or manually add that to your keybindings.json .从 Keybinding Shortcuts 执行此操作或手动将其添加到您的keybindings.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM