Well that was easy. I've been wanting this for a least a year. I found this post on github:
https://gist.github.com/wrzlbrmft/53c39525cfa7a3e12f58
# ~/.gimp-*/gimprc
(default-snap-to-canvas yes)
That worked! I closed gimp, added above line to C:\Users\username\.gimp-2.8\gimprc
file and restarted gimp
Update for GIMP 2.10
In Gimp 2.10 the above doesn't seem to work. The location of snap settings has changed to:
# (default-view
# (show-menubar yes)
# (show-statusbar yes)
# (show-rulers yes)
# (show-scrollbars yes)
# (show-selection yes)
# (show-layer-boundary yes)
# (show-guides yes)
# (show-grid no)
# (show-sample-points yes)
# (snap-to-guides yes)
# (snap-to-grid no)
# (snap-to-canvas no)
# (snap-to-path no)
# (padding-mode default)
# (padding-color (color-rgb 1.000000 1.000000 1.000000)))
(Note, you can see the possible settings in the system gimprc. In Windows this is located at C:\Program Files\GIMP 2\etc\gimp\2.0\gimprc
)
However despite adding the following to my user gimprc and restarting gimp the snapping didn't seem to apply.
(default-view
(snap-to-canvas yes)
Then I realized the gimprc I was editing was under a gimp-2.8 folder (C:\Users\username\.gimp-2.8\gimprc
). I do not seem to have a gimp-2.10 folder in my user directory.
In any case, however, there is now a setting for it in the GUI. Go to the menu Edit->Preferences
and the section Image Windows->Snapping
. Updating this setting sticks between restarts
