Gentoo, vim version 7.3.762
Problem:
ONLY happened when the vim instance has been ran for a long time (like 2 hours). Then I ran some commands which require temporary files like :Gstatus
in plugin fugitive
, I will get an error:
can't open file /tmp/RANDOM_NAME
I can't figure out what the reason caused this. Is it has anything to do with the auto-clean strategy of the operating system?
Because I encountered this problem not only when running the fugitive
commands, but also the function below:
" Use ranger as vim's file chooser
fun! RangerChooser()
silent !ranger --choosefile=/tmp/chosenfile $([ -z '%' ] && echo -n . || dirname %)
if filereadable('/tmp/chosenfile')
exec 'edit ' . system('cat /tmp/chosenfile')
call system('rm /tmp/chosenfile')
endif
redraw!
endfun
I ran into this problem because I had recently changed my shell from fish
to bash
. Changing my shell in my vimrc
fixed the problem:
set shell=/bin/bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With