OP, in most UK jurisdictions you could also opt for a civil partnership, as an alternative. It gives you the same legal and financial rights and protection as marriage, but it is a simple as signing legal paperwork, with an authorised person and 2 witnesses.
I know some previous posters have spoken about the beauty and the emotional side of a short notice wedding, but given you've not wanted to get married previously, you can also choose to see this an another piece of the 'sorting things out' jigsaw.
Whichever route, get onto it quickly. There is a notice period (I think 29 days). Everything only gets more complicated if your partner is likely to die in a shorter period - medical and legal questions about competence etc. If your partner is currently terribly, terribly unwell, finds it difficult to remain awake and conscious, or to speak, then a civil partnership is a much easier option.
Once your partner has sadly died, access to his financial information is massively simplified if you are married or in a civil partnership. This includes things like his personal mobile phone account, subscriptions he may have had to netflix etc.
Not legal but important is getting access to as many of his online accounts as you can. Do this now. Get his passwords (only with his absoloute permission) for bank accounts, facebook, email accounts. Ask him to share his email contacts list, whatsapp friends and groups etc, his phone contacts. It can be an awful process if you are trying to contact people to tell them about a worsening situation, or a death, and your realise only then, that you have no way of contacting them.
Really sorry you're in this situation.