Food that does not spoil, lightweight, energetic and balanced
You have asked a huge question; bigger than one can reasonable answer on a site like this.

I suggest you look into "Crusing Guide" type books.  One such is Sail Away - I have no involvement with this book other than having met the authors; there are many others.

Books like this will take sailing-specific exigencies into account such as limited water/power/etc. as well as accounting for storage issues.

Sailing, like many other travel endeavours can vary widely between people as well.  My version of spartan may well be your luxury.  Power budgets lead to refrigeration issues, and the like.

Good luck and fair winds!  (from a sailboat owner)