Vim mode cursors


#1

I’d like to change certain aspects of the cursor depending on which vim mode I’m currently in. My stylesheet looks like this:

atom-text-editor::shadow .cursor {
border-color: red;
}

//Normal mode block cursor
atom-text-editor.vim-mode.normal-mode,
atom-text-editor.vim-mode.operator-pending-mode
{
  &.is-focused {
    &::shadow, // shadow-DOM enabled
    &          // shadow-DOM disabled
    {
      /* cursor color */
      .cursor {
        background-color: rgb(105, 238, 103);
        opacity: 0.5;
        visibility: visible;
      }
    }
  }
}

//Visual mode cursor
atom-text-editor.vim-mode.visual-mode
{
  &.is-focused {
    &::shadow, // shadow-DOM enabled
    &          // shadow-DOM disabled
    {
      /* cursor color */
      .cursor {
        background-color: rgb(0, 0, 200);
        opacity: 0.5;
        visibility: visible;
      }
    }
  }
}

//Insert mode cursor
atom-text-editor.vim-mode.insert-mode
{
  &.is-focused {
    &::shadow, // shadow-DOM enabled
    &          // shadow-DOM disabled
    {
      /* cursor color */
      .cursor {
        background-color: rgb(255, 0, 0);
        opacity: 0.5;
        visibility: visible;
        width: 0.1em;
      }
    }
  }
}

When I’m in normal mode, everything works as expected. However, I have 2 problems:

  1. In insert mode, the cursor does not respect the width variable. Currently it looks like a block cursor, but I’d prefer to make it just a line, but slightly thicker than a traditional like

  2. In visual mode, the cursor does not show up as the selected colour. It just displays as a grey colour