Changing the appearance of the cursor in Visual Studio code through the extension API

Is it possible to change the appearance of the cursor in Visual Studio Code using the extension APIs? Knowing that the VS code is built on top of Chromium and that there is no way to style the text cursor in the browser using CSS, this would not seem likely.

I was messing around and trying to implement some kind of simple modal editing, and I would like to create a cursor block like vim in normal mode.

+4
source share
1 answer

I'm not sure about using the extension APIs, but you can do this through your user settings file (which extensions should be able to change since the "Vim" extension does this, as indicated in my comment above):

→ →

settings.json:

// Place your settings in this file to overwrite the default settings
{
    // Controls the cursor style, accepted values are 'block', 'line' and 'underline'
    "editor.cursorStyle": "block"
}
+6

Source: https://habr.com/ru/post/1617182/


All Articles