Some Perforce commands will require you to input some info. Operations like changing the permissions with
p4 protect or creating a changelist with
p4 change for example. An alternative is to the the p4v GUI of course, but occasionally you might want to run them from the command line. In these cases, perforce will launch a text editor for you to make the change in. By default this will be Notepad. If you’re on Linux or Mac it will be vi (lucky you), but if you’re making games chances are you’ll be on Windows.
We can change the editor perforce uses with the P4EDITOR environment variable. Notepad++ is a good option and what I use. For this to behave well though, you’ll need to add the
-nosession arguments. The former to allow Notepad++ to launch a separate, temporary session exclusively for perforce, and the latter to avoid including all your currently open tabs in this temporary session.
The full command line looks like this:
p4 set P4EDITOR="C:\Program Files\Notepad++/Notepad++.exe -multiInst -nosession".