Search code examples
bashvimi3

/bin/bash: redraw: command not found


On saving my .i3 config file, I get the following message at the bottom:
"~/.i3" 234L, 8266C written/bin/bash: redraw: command not found

The file does appear to save. However, I think the vim screen doesn't get redrawn, which is possibly related to the error.


Solution

  • The problem was that I had the following line in my .vimrc file which is supposed to reload the i3 session whenever the .i3 config file is saved.

    autocmd BufWritePost ~/.i3 silent !i3-msg reload | redraw
    

    When I change that line as follows, it seems to work now.

    autocmd BufWritePost ~/.i3 execute '!i3-msg reload' | redraw!
    

    I also had to add a line autocmd! at the top of my .vimrc to clear all previous autocmds.

    The explanation for exclamation point at the end of the redraw command (from the vim docs):

    :redr[aw][!]      Redraw the screen right now. When ! is included it is cleared first.