Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Change color on entering/leaving modes

Open AnastasiusVivaldus opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. I asked this question on SO, but did not get any answers, so thought I'd try my luck here.

Describe the solution you'd like I want to make it visually OBVIOUS what mode I am presently in by programmatically changing color theme whenever I change modes (in particular normal <-> insert). If it's possible already then I'd appreciate an outline of the solution. If it's not possible, then please consider adding required functionality.

Describe alternatives you've considered As described in the link, in normal vim I can change colors by listening to events with the following sort of syntax:

autocmd InsertEnter * colorscheme industry | set cursorline | highlight CursorLine guibg=darkgrey ctermbg=darkgrey
autocmd InsertLeave * colorscheme torte

However, I don't think that these sorts of features are available in vscode vim. I'd also looked into using VSCode features BUT (i) I don't know if I can trigger a generic action on the event of vscode vim changeing modes, and (ii) even if I could, I cannot find a vscode action to programmatically change the theme (the closest I can find is "command":"workbench.action.selectTheme", but that just opens the menu to select a theme, and I want the theme switched automatically.

AnastasiusVivaldus avatar Mar 11 '21 17:03 AnastasiusVivaldus

On the VSCode side of things there is currently an open PR to implement the feature to be able to change theme via a command.

https://github.com/microsoft/vscode/pull/100861

As an example

    {
        "key": "ctrl+t ctrl+d",
        "command": "workbench.action.selectTheme",
        "args": {
            "id": "Default Dark+"
        }
    }

This will allow you to change theme based on what input mode you are in using "when":"vim.mode='Insert'" for example

You could take the alternative (Arguably better approach) and add it to the keybindings for VSCodeVim

{
   "vim.visualModeKeyBindings":[
      {
      
        ...
        
         "commands":[
            {
               "command":"workbench.action.selectTheme",
               "args":{
                  "id":"ayu"
               }
            }
         ]
      }
   ]
}```
    

sean-brydon avatar Mar 17 '21 15:03 sean-brydon

As of today, the only feature we have is vim.statusBarColorControl, which is janky and limited

J-Fields avatar Mar 17 '21 15:03 J-Fields

I was looking for something to essentially turn off the line highlight setting (editor.renderLineHighlight) when in insert mode and have it on otherwise. My guess is that's also not possible with the current way VSCodeVim works?

macintacos avatar Dec 03 '21 23:12 macintacos

I would also like this feature.

MiLandry avatar Jun 28 '24 19:06 MiLandry