Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

question from:https://stackoverflow.com/questions/65933122/bin-bash-redraw-command-not-found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...