O
O
OLEGatorRB2019-01-10 19:25:06
git
OLEGatorRB, 2019-01-10 19:25:06

How to delete .swp file?

Good afternoon!
I am learning git. A file with the swp extension appeared in the folder. And it never gets removed. Not through git, not through the del button.
I understand that this file was created by git's vim editor. Because of this file, I can not change the branch in the git - it says error: cannot stat '.one.css.swp': Permission denied Tell me
how you can delete this damn file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Askhat Bikmetov, 2019-01-10
@OLEGatorRB

In the project root directory:

killall vim
find ./ -name *.swp -exec rm {} +

More secure solution:
mkdir -p ~/.vim/backup
echo 'set dir=$HOME/.vim/backup' >> ~/.vimrc
vim
[выйти из вима]
find ./ -name *.swp -exec rm {} +

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question