Skip to content

Recursive Snippet in fortran for nvim #592

@HIGGS317

Description

@HIGGS317

I was working through a project in Fortran and noticed nvim could not parse the current implementation of a recursively defined snippet (neovim/neovim#25696) for a do loop in Fortran, so I came up with a workaround for the same.

Previous Recursive Implementation

"do": {
        "prefix": "do",
        "body": "do${1: ${2:i} = ${3:1}, ${4:100}, ${5:1}}\n\t$0\nend do",
        "description": "do",
        "scope": "source.fortran"
   },

Workaround Implementation

    "do-new": {
        "prefix": "do",
        "body": [
            "do ${1:i} = ${2:1}, ${3:100}, ${4:1}",
            "\t$0",
            "end do"
        ],
        "description": "Fortran do loop"
    },

Demo is attached below

Screen.Recording.2025-07-17.at.23.29.30.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions