简体   繁体   English

在 VS 代码中,如果我在单元格的最后一行,我希望向下箭头将我带到行尾,但在最后一行的末尾,go 到下一个单元格

[英]In VS code, I want the down arrow take me to end of line, if I'm in the last line of a cell, but at the end of the last line, go to next cell

In jupyter lab in anaconda:在 anaconda 的 jupyter 实验室中:

#1) The down arrow generally takes you one line down. #1) 向下箭头通常会将您向下移动一行。

#2) Unless you are at the last line of the cell, in which case it takes you to the end of the line. #2) 除非您位于单元格的最后一行,否则它将带您到行尾。

#3) Pressing the down arrow while at the end of the last line, will take you to the next cell. #3) 在最后一行的末尾按向下箭头,将带您到下一个单元格。

In VS code, by default, #2 doesn't happen.在 VS 代码中,默认情况下,#2 不会发生。 How can I make it happen, while keeping #1 and #3?我怎样才能做到这一点,同时保持#1和#3? I managed to get #2 to happen, using this answer from a similar question:我设法让#2发生,使用来自类似问题的答案:

For cursor to go from the beginning of the last line to the end of it when pressing arrow down (↓) instead of jumping to the next cell you should open Keyboard Shortcuts (File > Preferences > Keyboard Shortcuts [Ctrl+K Ctrl+S]) and remove or change bindings for "Notebook: Focus Next Cell Editor".对于 cursor 到 go,当按下向下箭头 (↓) 而不是跳到下一个单元格时,您应该打开键盘快捷键(文件 > 首选项 > 键盘快捷键 [Ctrl+K Ctrl+S] ) 并删除或更改“Notebook: Focus Next Cell Editor”的绑定。 Similarly you should change bindings for "Notebook: Focus Previous Cell Editor" if you want the same functionality for the up arrow (↑).同样,如果您希望向上箭头 (↑) 具有相同的功能,您应该更改“笔记本:聚焦上一个单元格编辑器”的绑定。

but it also removed #3.但它也删除了#3。 I would also like for it to work when using the up arrow.我也希望它在使用向上箭头时工作。

The first and third items you proposed are already satisfied in vscode.你提出的第一项和第三项在 vscode 中已经满足了。

For the second item, move to the beginning/end of the line.对于第二项,移动到行的开头/结尾 I suggest you use Home/End according to the keyboard reference sheets to move quickly.我建议您根据键盘参考表使用Home/End快速移动。

You can modify it in the keyboard shortcuts:您可以在键盘快捷键中修改它:

在此处输入图像描述

But please do not use , because it conflicts with moving line down as you mentioned first item.但请不要使用 ,因为它与您提到的第一项向下移动线相冲突。

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

相关问题 如何将 VSCode 上的向下箭头设置为 go 到 Jupyter Notebooks 的行尾? - How to make down arrow on VSCode to go to end of line in Jupyter Notebooks? 到达文本的最后一行后,如何结束程序? - How do I end the program once the last line of the text is reached? 如何从列表的最后一行获取单元格值? - How can I obtain a cell value from the last line of a list? 删除行尾的最后一个字符(仅当它是定界符时) - remove the last character at the end of the line (only if it is a delimiter) 代码一直在无限循环中运行。 最后一行的末尾也有错误。 不知道为什么。 我是编码新手 - Code keeps going in an infinite loop. there is also an error at the end on the last line. Not sure why. I am new to coding CSV writer 将第一行添加到最后一个单元格 - CSV writer adds the first line to the last cell 我如何在没有新行的情况下结束这段代码? - How can i end this code without the new line at the end? 仅删除最后一行末尾的换行符 python - Removing New line character at end of last line only python 如何在单独的行上打印最后一行代码? - How can I print the last line of code on a seperate line? 我在保存保存最后一行 python 的文件时遇到问题 - I'm having a problem saving a file that saves the last line python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM