{"id":21206621,"url":"https://github.com/oncomouse/plenary-script.nvim","last_synced_at":"2025-03-14T23:14:12.528Z","repository":{"id":149628405,"uuid":"444947293","full_name":"oncomouse/plenary-script.nvim","owner":"oncomouse","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-05T20:53:42.000Z","size":1,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-21T15:48:39.101Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/oncomouse.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":"2022-01-05T20:53:28.000Z","updated_at":"2023-09-11T08:38:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"569bf7fc-1bb5-44a0-a3f5-4075c4c6aa3b","html_url":"https://github.com/oncomouse/plenary-script.nvim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Fplenary-script.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Fplenary-script.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Fplenary-script.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oncomouse%2Fplenary-script.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oncomouse","download_url":"https://codeload.github.com/oncomouse/plenary-script.nvim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658270,"owners_count":20326467,"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":[],"created_at":"2024-11-20T20:56:15.019Z","updated_at":"2025-03-14T23:14:12.522Z","avatar_url":"https://github.com/oncomouse.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plenary-script.nvim\n\nThis script uses [plenary.nvim](https://github.com/nvim-lua/plenary.nvim)'s filetype detection to set `'filetype'` to complement the new `filetype.lua` script in Neovim 0.7.\n\nThe idea for this plugin was suggested by [comments made on Issue #16940](https://github.com/neovim/neovim/issues/16940#issuecomment-1005902812), which mentions that there is currently no file detection based on file content in the new `filetype.lua` method.\n\n## Background\n\n[`filetype.lua`](https://github.com/neovim/neovim/pull/16600) was recently merged into Neovim. If you set `vim.g.do_filetype_lua` to 1 and `vim.g.did_load_filetypes` to 0, you can use the new `filetype.lua` system exclusively (it's much faster and `vim.filetype.add()` rocks). As [SanchayanMaity](https://github.com/SanchayanMaity) pointed out in [Issue #16940](https://github.com/neovim/neovim/issues/16940), the new API does not check things like shebangs or modelines for filetype.\n\nIt was suggested by [clason](https://github.com/clason) that [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) might be a stop-gap solution.\n\nHence this plugin, which uses [`plenary.filetype`](https://github.com/nvim-lua/plenary.nvim#plenaryfiletype) to guess `filetype` when `filetype.lua` fails (namely for files where `filetype` should be suggested by a shebang and the like).\n\n## Installation\n\n```lua\nuse({\n\t\"oncomouse/plenary-script.nvim\",\n\trequires = { \"nvim-lua/plenary.nvim\" },\n})\n```\n\n## Extension\n\nThere are instructions on [`plenary.filetype`](https://github.com/nvim-lua/plenary.nvim#plenaryfiletype)'s documentation for extending detection, but they are also reproduced below:\n\n\u003e Add filetypes by creating a new file named ~/.config/nvim/data/plenary/filetypes/foo.lua and register that file with :lua require'plenary.filetype'.add_file('foo'). Content of the file should look like that:\n\n```lua\nreturn {\n  extension = {\n    -- extension = filetype\n    -- example:\n    ['jl'] = 'julia',\n  },\n  file_name = {\n    -- special filenames, likes .bashrc\n    -- we provide a decent amount\n    -- name = filetype\n    -- example:\n    ['.bashrc'] = 'bash',\n  },\n  shebang = {\n    -- Shebangs are supported as well. Currently we provide\n    -- sh, bash, zsh, python, perl with different prefixes like\n    -- /usr/bin, /bin/, /usr/bin/env, /bin/env\n    -- shebang = filetype\n    -- example:\n    ['/usr/bin/node'] = 'javascript',\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foncomouse%2Fplenary-script.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foncomouse%2Fplenary-script.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foncomouse%2Fplenary-script.nvim/lists"}