简体   繁体   English

如何在 VS Code 中更改 cursor?

[英]How do I change the cursor in VS Code?

Somehow I ended up with a block/square cursor in VS Code.不知何故,我在 VS Code 中得到了一个块/方块 cursor。 What is the setting name, and how do I go back to the pipe cursor?设置名称是什么,我怎么把go改回pipe cursor?

Note that it's not "overtype" mode: I can type before other characters and it doesn't overwrite them.请注意,这不是“改写”模式:我可以在其他字符之前输入并且不会覆盖它们。

I'm on macOS Sierra我在 macOS Sierra 上

// Controls the cursor style, accepted values are 'block', 'line' and 'underline' // 控制光标样式,接受的值为“block”、“line”和“underline”

"editor.cursorStyle": "line",

from VSCode settings.json defaults来自VSCode settings.json 默认值

I believe the reason is that you installed vim extension in vscode by mistake as it puts you in that mode by default until you press (i) to edit text.我相信原因是您错误地在 vscode 中安装了 vim 扩展,因为它默认将您置于该模式,直到您按 (i) 编辑文本。 uninstall vim extension and things should go back to normal.卸载 vim 扩展,事情应该会恢复正常。 or refer to this vim cheatsheet for more information about using vim as a text editor.或参阅vim 备忘单以获取有关使用 vim 作为文本编辑器的更多信息。

Press Insert it should return back to normal.插入它应该恢复正常。 You can also press ctrl + shift + I .您也可以按ctrl + shift + I In mac os it is control.在mac os中它是控制。 Head back to code this problem can be cumbersome.返回编码这个问题可能很麻烦。

Cursor styles can be set with the following lines in settings.json : (with the vim-extension)可以使用settings.json的以下几行settings.json光标样式:(使用 vim-extension)

"vim.cursorStylePerMode.insert": "line",
"vim.cursorStylePerMode.normal": "block",
"vim.cursorStylePerMode.replace": "block",
"vim.cursorStylePerMode.visual": "block",

In my case, I couldn't use the arrow keys to move the cursor past the end of line (to the next line) or before the beginning of line to the (previous line).就我而言,我无法使用箭头键将光标移动到行尾(到下一行)或行首之前到(上一行)。 Uninstalling VIM and restarting VS Code fixed my problem卸载 VIM 并重新启动 VS Code 解决了我的问题

"

Remove the unnecessary extension mainly in my case its "VIM extension"删除不必要的扩展名,主要是在我的情况下它的“VIM 扩展名”

Yes, in my case it was caused due to the Vim extension in VS Code.是的,就我而言,这是由于 VS Code 中的 Vim 扩展引起的。 If it is installed then try pressing "i" or uninstall the extension.如果已安装,请尝试按“i”或卸载扩展程序。

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

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