Associate a file type with a specific syntax highlighting in the text editor

That suggestion from @ian-r-rose still works for me (as of jupyter lab 2.2.2):

{
    "shortcuts": [
        {
            "command": "codemirror:change-mode",
            "keys": [
                "Shift Ctrl Alt P"
            ],
            "args": { "name": "Python" },
            "selector": ".jp-FileEditor"
        },
    ]
}