Welcome to OStack Knowledge Sharing 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...