Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

vim - /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.

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...