vim colorschemes not changing background color

后端 未结 11 1825
北恋
北恋 2021-01-30 08:43

I try to apply various color schemes in vim that I have seen on the net. Whatever scheme I choose, the background remains white, even though screenshots of the applied scheme sh

11条回答
  •  礼貌的吻别
    2021-01-30 09:27

    Does the overall settings for the terminal window have something to do with it?

    Yes, terminal parameters override vim parameters (at least in OSX and iTerm). For example, I have a following script in /Users/[username]/.bashrc

    setBackground() {  
      osascript -e "tell application \"iTerm\"  
        set current_terminal to (current terminal)  
        tell current_terminal  
          set current_session to (current session)  
          tell current_session  
            set background color to $1  
          end tell  
        end tell  
      end tell"  
    }  
    
    vim() {
           (setBackground "{65025,65025,65025}" &)
           (exec vim $*)
    }
    

    The above remaps terminal vim command to execute a background color change before executing vim. Background color function is applescript (I copied the script from somewhere...). It works for iTerm. I belive that you can adapt this to work with terminal (apple product + apple script -> should work).

    br,
    Juha

提交回复
热议问题