{"id":18041847,"url":"https://github.com/bfrg/vim-cuda-syntax","last_synced_at":"2025-04-09T19:24:00.861Z","repository":{"id":201851677,"uuid":"146832075","full_name":"bfrg/vim-cuda-syntax","owner":"bfrg","description":"CUDA syntax highlighting for Vim","archived":false,"fork":false,"pushed_at":"2020-10-18T10:37:23.000Z","size":299,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T21:22:46.295Z","etag":null,"topics":["cuda","highlighting","syntax","vim","vim-syntax"],"latest_commit_sha":null,"homepage":null,"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/bfrg.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}},"created_at":"2018-08-31T02:37:17.000Z","updated_at":"2025-02-22T05:53:16.000Z","dependencies_parsed_at":"2023-11-10T12:08:17.165Z","dependency_job_id":null,"html_url":"https://github.com/bfrg/vim-cuda-syntax","commit_stats":null,"previous_names":["bfrg/vim-cuda-syntax"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-cuda-syntax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-cuda-syntax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-cuda-syntax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-cuda-syntax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfrg","download_url":"https://codeload.github.com/bfrg/vim-cuda-syntax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248096200,"owners_count":21046998,"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","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":["cuda","highlighting","syntax","vim","vim-syntax"],"created_at":"2024-10-30T16:13:03.415Z","updated_at":"2025-04-09T19:24:00.824Z","avatar_url":"https://github.com/bfrg.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-cuda-syntax\n\nSyntax highlighting for CUDA in Vim. Compared to Vim's default CUDA syntax file,\nit adds highlighting of all CUDA defined:\n- types\n- enums\n- constants\n- global variables\n- namespaces\n- thrust keywords\n\nAll keywords are accumulated from the [CUDA Toolkit Documentation][toolkit].\n\nOptionally triple-angle brackets in CUDA kernel calls can be highlighted.\n\n\n## Screenshot\n\n\u003cdl\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/6266600/95977810-9b746580-0e19-11eb-8105-4e2d9efa0c97.png\" width=\"480\"/\u003e\n\u003c/p\u003e\n\u003c/dl\u003e\n\n\n## Limitations\n\n1. Highlighting of the triple angle-brackets in CUDA kernel calls works only\n   when the angle brackets are on the same line. The function name is only\n   highlighted when called without template arguments, i.e. `MyKernel` won't be\n   highlighted in `MyKernel\u003cfoo, bar\u003e\u003c\u003c\u003cgrid, threads\u003e\u003e\u003e(data)`.\n\n2. CUDA [data fields][data-fields] are not highlighted because many keywords\n   have familiar names which could collide with either user-defined variables\n   (like `ptr`, `x`, `y`), or with C++ standard library types (like `function`\n   or `array`) and would mess up the highlighting. If you want structure or\n   class member variables appearing after the `.` or `-\u003e` operators highlighted,\n   use for example [vim-cpp-modern][vim-cpp-modern].\n\n3. Functions are not highlighted by default. There are plenty of other Vim\n   syntax plugins that provide this feature for C/C++ files. See for example\n   [vim-cpp-modern][vim-cpp-modern].\n\n\n## Optional features\n\n```vim\n\" Enable highlighting of CUDA kernel calls\nlet g:cuda_kernel_highlight = 1\n\n\" Highlight keywords from CUDA Runtime API\nlet g:cuda_runtime_api_highlight = 1\n\n\" Highlight keywords from CUDA Driver API\nlet g:cuda_driver_api_highlight = 1\n\n\" Highlight keywords from CUDA Thrust library\nlet g:cuda_thrust_highlight = 1\n```\n\n\n## Installation\n\n```bash\n$ cd ~/.vim/pack/git-plugins/start\n$ git clone https://github.com/bfrg/vim-cuda-syntax\n```\n**Note:** The directory name `git-plugins` is arbitrary, you can pick any other\nname. For more details see `:help packages`.\n\nAlternatively, use your favorite plugin manager.\n\n\n## FAQ\n\n\u003e I want everything in-between the triple angle-brackets highlighted to get a\n\u003e more distinct highlighting of kernel calls.\n\nAdd the following lines to `~/.vim/after/syntax/cuda.vim` (create the file if\nit doesn't exist):\n```vim\nsyntax match cudaKernelAngles \"\u003c\u003c\u003c\\_.\\{-}\u003e\u003e\u003e\"\nhighlight link cudaKernelAngles Operator\n```\n\n\u003e I want the CUDA language extensions (`__device__`, `__host__`, etc.)\n\u003e highlighted like the standard C/C++ keywords.\n\nAdd the following to `~/.vim/after/syntax/cuda.vim`:\n```vim\nhighlight link cudaStorageClass Statement\n```\n\n\n## License\n\nDistributed under the same terms as Vim itself. See `:help license`.\n\n\n[toolkit]: https://docs.nvidia.com/cuda/index.html\n[data-fields]: https://docs.nvidia.com/cuda/cuda-runtime-api/functions.html#functions\n[vim-cpp-modern]: https://github.com/bfrg/vim-cpp-modern\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfrg%2Fvim-cuda-syntax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfrg%2Fvim-cuda-syntax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfrg%2Fvim-cuda-syntax/lists"}