{"id":15020926,"url":"https://github.com/ubaldot/vim9-conversion-aid","last_synced_at":"2025-10-26T17:31:00.907Z","repository":{"id":250066832,"uuid":"831406730","full_name":"ubaldot/vim9-conversion-aid","owner":"ubaldot","description":"A little help for upgrading your scripts to vim9 language.","archived":false,"fork":false,"pushed_at":"2025-04-04T10:12:42.000Z","size":64,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T11:24:20.512Z","etag":null,"topics":["vim","vim9","vim9-plugin"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ubaldot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-20T13:08:57.000Z","updated_at":"2025-04-04T10:12:46.000Z","dependencies_parsed_at":"2024-07-25T01:42:28.134Z","dependency_job_id":"ae71bf66-28f2-465a-b787-52d5ababf0e4","html_url":"https://github.com/ubaldot/vim9-conversion-aid","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":"0.018867924528301883","last_synced_commit":"ffd8ed778b9c43da85e7df4d08879c688bbf162b"},"previous_names":["ubaldot/vim9-conversion-aid"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ubaldot/vim9-conversion-aid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubaldot%2Fvim9-conversion-aid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubaldot%2Fvim9-conversion-aid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubaldot%2Fvim9-conversion-aid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubaldot%2Fvim9-conversion-aid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ubaldot","download_url":"https://codeload.github.com/ubaldot/vim9-conversion-aid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubaldot%2Fvim9-conversion-aid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281140928,"owners_count":26450542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vim","vim9","vim9-plugin"],"created_at":"2024-09-24T19:55:51.786Z","updated_at":"2025-10-26T17:31:00.902Z","avatar_url":"https://github.com/ubaldot.png","language":"Vim Script","readme":"# vim9-conversion-aid\n\nA little help for upgrading to Vim9 by converting legacy Vim to Vim 9\nscript.\nNo miracles, nor bullet proof, but giving a head start in the conversion process by a `:Vim9Convert` (that operates either on the current or supplied buffer) command to\n\n- replace all occurrences of `func`, `function`, etc. with `def` and `enddef`,\n- replace comment string `\"` with `#`,\n- replace `v:true, v:false` with `true, false`,\n- add leading/trailing space to `=` and to comparison signs as needed,\n- remove line continuation symbol `\\`,\n- ... and so much more.\n\n## Caveats\n\nThe `let` commands won't be converted automatically unless you set `g:vim9_conversion_aid_fix_let = true`, though rather **fix the\nvariables definitions, but not their usage.**\n\nFor example, if at script level you have the following statement:\n```\nlet newdict = CreateDict()\ncall PrintDictContent(newdict)\n```\nthen it will be converted to the following:\n```\ng:newdict = CreateDict()\nPrintDictContent(newdict)\n```\nThat is, the argument to the function call shall be manually fixed.\n\nFinally, in a similar vein, neither are `a:`, `l:` and `s:` removed automatically.\n\nThis way, you can better inspect if your script semantic is still valid.\nOnce done inspecting, run a simple `:%s/\\v(a:|s:|l:)//g`.\n\nOr, if you still prefer that to happen automatically, you can set `g:vim9_conversion_aid_fix_asl = true`.\n\n## Usage\n\n\u003c!-- It is recommended to use the tool with a clean `.vimrc` file. --\u003e\n\u003c!-- That is, you can start Vim with `vim --clean` and then source the plugin manually (e.g. `:source /path/to/vim9-conversion-aid/plugin/vim9-conversion-aid.vim` or you can just download the `vim9-conversion-aid.vim` file and source it), and then use `Vim9Convert`. --\u003e\n\nThe converted file will most likely have errors, but the error messages should tell you what shall be fixed and how.\nAlso, mind that `:h vim9` can be a great support for fixing the remaining errors if you really don't know how.\n\nYou can line-by-line compare the old and converted script by opening them next to each other and running `windo setlocal scrollbind diffthis`.\n\n## Testing\n\nTo see how the tool perform the upgrade you can take a look at the `./test/test_script.vim` and `./test/expected_script.vim` scripts.\n\nAs you will see, some manual work is still required, but the starting point is rather favorable compared to starting from scratch.\nNote that `./test/test_script.vim` does not do anything special, it has been written with the sole purpose of hitting a reasonable amount of corners.\n\n## Limitations\n\nThe tool works better if the original script is not written in a fancy way. As\nsaid, don't expect miracles and consider the following limitations:\n\n- no inline comments, e.g. the following won't be fixed:\n\n```\nlet s:a = 3 \" This is a comment\n```\n\nThe following will be fixed:\n\n```\n\" This is a comment\nlet s:a = 3\n```\n\n- it won't fix string concatenation if the concatenation operator `.` does not\n  have a leading and a trailer white-space,\n- functions with variable number of arguments won't be fixed,\n- it won't remove `eval`,\n- lambda expressions will not be converted in the new format,\n- Vim9 syntax/semantics updates and datatypes shall be handled manually.\n\n... but there is certainly more that you will need to fix manually. If you\nfind bugs or have improvements suggestions, please open an issue or send a PR.\nIn the latter case, don't forget to update the tests.\n\nTo circumnavigate some of the above limitations, prepare your script to don't\nhit the above limitations. Plus, avoid using script-local variable names that\nshadow vim builtin keywords (e.g. avoid to call a variable `let s:vertical`\nbecause `vertical` is a builtin keyword.\n","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubaldot%2Fvim9-conversion-aid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fubaldot%2Fvim9-conversion-aid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubaldot%2Fvim9-conversion-aid/lists"}