P4EDITOR is set to gvim in .p4enviro.
When run command p4 client in terminal, it will pop an empty tmp file.
But if change editor config to P4EDITOR=vim, it works fine.
How to fix this?

  • 1
    Read the help at :h -f Commented Aug 24, 2018 at 12:09
  • @ChristianBrabandt, Yes, after adding -f, gvim works fine. Will you turn comment to answer?
    – Fisher
    Commented Aug 24, 2018 at 12:43

1 Answer 1


As @ChristianBrabant says: Use gvim -f as P4EDITOR environment variable to fix this issue.

Adding the below line to .bashrc export P4EDITOR="gvim -f"

  • 3
    Welcome to Vi and Vim! Normally, when users post answers from the comments that are not their own, they make it community wiki or add enough explanatory details to make it a high-quality answer independent of the original comment. You can use the edit button for this.
    – D. Ben Knoble
    Commented Oct 6, 2020 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.