macos - 哪些键映射会一次将光标上下移动一条真线?
问题描述
我使用 VS Code 来编写 markdown(除其他外),并且希望能够使用我在其他文本编辑器中导航文本时习惯的键盘映射,例如 MacOS 上的 TextEdit,或者我所在的窗口输入这个问题。这些关键地图包括:
- "alt+up" 将光标向上移动一行
- "alt+down" 将光标下移一行
- "shift+alt+up" 向上移动光标并选择
- "shift+alt+down" 向下移动光标并选择
当我写“向上一行”时,我的意思是向上穿过“真实”行,而不是换行。目前,向上和向下箭头会自行移动光标穿过换行线。这很好,但我也希望能够在真实线条中上下移动。
我知道我可以在 VS Code 中手动重新映射这些组合,但我不确定将它们重新映射到. 换句话说,用于将光标上下移动一条真线并在选择文本时移动它的 VS Code 函数是什么?
解决方案
我认为这就是您所说的“真实路线”(但我可能错了)。例如,在您的keybindings.json
尝试中:
{
"key": "alt+up", // whatever keybinding you want
"command": "cursorMove",
"args": {
"to": "up",
"by": "line", // you can get intellisense for the options (Ctrl+Space)
// "select": true // false is the default
},
"when": "editorTextFocus"
},
{
"key": "alt+down",
"command": "cursorMove",
"args": {
"to": "down",
"by": "line",
// "select": true
},
"when": "editorTextFocus"
},
推荐阅读
- c# - 将鼠标或光标放在坐标上
- c++ - 使用 assimp 将 3d 模型转换为 2d
- html - 在 font-family 中使用两种不同的字体
- python - 将像素坐标从相机图像转换为二维鸟瞰图
- javascript - 从角度上传多个包含图像数据数组的 FormField 对象以表达
- r - 如何根据边缘属性为 R 中 igraph 图中的边缘分配颜色范围?
- json - Xamarin 形成 Json 反序列化
- reactjs - 无法从创建的用户 firebase 传递 uid
- c - 返回变量在c中保存一个字符串并将其打印出来
- reactjs - 传递传播道具与 html 样式属性时的打字差异