“!q” and “wq!” failed to quit vim [duplicate]
This question already has an answer here:
How to close vim from the command line?
6 answers
I tried to quit vim
"/etc/sysconfig/network-scripts"
"/etc/sysconfig/network-scripts" E212: Can't open file for writing
Press ENTER or type command to continue
When I press Enter, it returns to edit mode. I tried
!q
Press ENTER or type command to continue
[No write since last change]
/bin/bash: q: command not found
shell returned 127
Press ENTER or type command to continue
I press Enter, it returns to the previous editor mode again.
How can I quit vim in this situation?
vim
marked as duplicate by muru, karel, Yaron, Eric Carvalho, Zanna Dec 12 at 11:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How to close vim from the command line?
6 answers
I tried to quit vim
"/etc/sysconfig/network-scripts"
"/etc/sysconfig/network-scripts" E212: Can't open file for writing
Press ENTER or type command to continue
When I press Enter, it returns to edit mode. I tried
!q
Press ENTER or type command to continue
[No write since last change]
/bin/bash: q: command not found
shell returned 127
Press ENTER or type command to continue
I press Enter, it returns to the previous editor mode again.
How can I quit vim in this situation?
vim
marked as duplicate by muru, karel, Yaron, Eric Carvalho, Zanna Dec 12 at 11:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
because you cannot replaceq!with!q
– Alvin Liang
Dec 12 at 9:45
add a comment |
This question already has an answer here:
How to close vim from the command line?
6 answers
I tried to quit vim
"/etc/sysconfig/network-scripts"
"/etc/sysconfig/network-scripts" E212: Can't open file for writing
Press ENTER or type command to continue
When I press Enter, it returns to edit mode. I tried
!q
Press ENTER or type command to continue
[No write since last change]
/bin/bash: q: command not found
shell returned 127
Press ENTER or type command to continue
I press Enter, it returns to the previous editor mode again.
How can I quit vim in this situation?
vim
This question already has an answer here:
How to close vim from the command line?
6 answers
I tried to quit vim
"/etc/sysconfig/network-scripts"
"/etc/sysconfig/network-scripts" E212: Can't open file for writing
Press ENTER or type command to continue
When I press Enter, it returns to edit mode. I tried
!q
Press ENTER or type command to continue
[No write since last change]
/bin/bash: q: command not found
shell returned 127
Press ENTER or type command to continue
I press Enter, it returns to the previous editor mode again.
How can I quit vim in this situation?
This question already has an answer here:
How to close vim from the command line?
6 answers
vim
vim
edited Dec 12 at 11:54
Zanna
50k13131238
50k13131238
asked Dec 12 at 8:01
recursivleyGreedy
224
224
marked as duplicate by muru, karel, Yaron, Eric Carvalho, Zanna Dec 12 at 11:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by muru, karel, Yaron, Eric Carvalho, Zanna Dec 12 at 11:54
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
because you cannot replaceq!with!q
– Alvin Liang
Dec 12 at 9:45
add a comment |
because you cannot replaceq!with!q
– Alvin Liang
Dec 12 at 9:45
because you cannot replace
q! with !q– Alvin Liang
Dec 12 at 9:45
because you cannot replace
q! with !q– Alvin Liang
Dec 12 at 9:45
add a comment |
1 Answer
1
active
oldest
votes
If you want save changes :wq!, but if something wrong and you want quit anyway (ignore changes) - :q!
Often you can start edit file with no permissions to save it. You can make many changes and then understood, you can't save it. In this case i recommend save as it:
:w tmp_filename
then exit vim and replace old file with tmp_filename.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want save changes :wq!, but if something wrong and you want quit anyway (ignore changes) - :q!
Often you can start edit file with no permissions to save it. You can make many changes and then understood, you can't save it. In this case i recommend save as it:
:w tmp_filename
then exit vim and replace old file with tmp_filename.
add a comment |
If you want save changes :wq!, but if something wrong and you want quit anyway (ignore changes) - :q!
Often you can start edit file with no permissions to save it. You can make many changes and then understood, you can't save it. In this case i recommend save as it:
:w tmp_filename
then exit vim and replace old file with tmp_filename.
add a comment |
If you want save changes :wq!, but if something wrong and you want quit anyway (ignore changes) - :q!
Often you can start edit file with no permissions to save it. You can make many changes and then understood, you can't save it. In this case i recommend save as it:
:w tmp_filename
then exit vim and replace old file with tmp_filename.
If you want save changes :wq!, but if something wrong and you want quit anyway (ignore changes) - :q!
Often you can start edit file with no permissions to save it. You can make many changes and then understood, you can't save it. In this case i recommend save as it:
:w tmp_filename
then exit vim and replace old file with tmp_filename.
edited Dec 12 at 9:40
answered Dec 12 at 8:03
mature
1,540422
1,540422
add a comment |
add a comment |
because you cannot replace
q!with!q– Alvin Liang
Dec 12 at 9:45