Can not modify zshrc without sudo

I can not modify zshrc wihout sudo,but I see I have the permisson to write .
I modify it the day before yestoday , but someting went wrong today.
Can anyone help me?

Whats the output of ls -l .zshrc?

-rw-r–r-- 1 chalres chalres 12050 Jan 19 22:15 .zshrc

The permissions are correct. How have you been editing the file?

Maybe the file is simply locked by another process?

lslocks | grep /home/chalres/.zshrc

PS : Is the typo on purpose in the username?

Emm , when I install the system my typing is fast,and :innocent:

there is nothing output with

lslocks | grep /home/chalres/.zshrc

use vim

Does it nag you about the file being already opened? Or does it show an error?
Or is it when you try to save modifications?

I use neovim
the output of :w

E45: ‘readonly’ option is set (and add ! to override)

Please ignore this problem,I am a fool, just type ! and nothing wrong

I’m not very familiar with the vi family features, but this seems relevant:
https://unix.stackexchange.com/questions/71109/how-can-i-exit-from-read-only-mode-in-vim

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.