{"id":46527320,"url":"https://github.com/evanmcpheron/rocketlog.nvim","last_synced_at":"2026-03-08T04:00:35.150Z","repository":{"id":339876016,"uuid":"1163685806","full_name":"evanmcpheron/rocketlog.nvim","owner":"evanmcpheron","description":"A lightweight Neovim plugin for inserting structured console.* statements in JavaScript and TypeScript files.","archived":false,"fork":false,"pushed_at":"2026-03-06T21:07:45.000Z","size":123,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-07T00:50:56.574Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evanmcpheron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-22T01:33:51.000Z","updated_at":"2026-03-06T21:07:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/evanmcpheron/rocketlog.nvim","commit_stats":null,"previous_names":["evanmcpheron/turbolog.nvim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/evanmcpheron/rocketlog.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmcpheron%2Frocketlog.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmcpheron%2Frocketlog.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmcpheron%2Frocketlog.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmcpheron%2Frocketlog.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanmcpheron","download_url":"https://codeload.github.com/evanmcpheron/rocketlog.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanmcpheron%2Frocketlog.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30244538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"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":[],"created_at":"2026-03-06T21:00:28.268Z","updated_at":"2026-03-08T04:00:35.143Z","avatar_url":"https://github.com/evanmcpheron.png","language":"Lua","readme":"# Rocketlog.nvim\n\nA lightweight Neovim plugin for inserting structured `console.*` statements in JavaScript and TypeScript files.\n\n`rocketlog.nvim` adds labeled logs with a consistent format that includes the file name and line number, and it can keep those labels updated as your code moves.\n\nFor details on how to help improve this tool, see [CONTRIBUTING.md](./CONTRIBUTING.md).\nFor submitting an issue or feature request, see [issues](https://github.com/evanmcpheron/rocketlog.nvim/issues).\n\n```typescript\nconsole.log(`🚀[ROCKETLOG] ~ file.ts:123 ~ variableName:`, variableName);\nconsole.warn(`🚀[ROCKETLOG] ~ file.ts:123 ~ variableName:`, variableName);\nconsole.error(`🚀[ROCKETLOG] ~ file.ts:123 ~ variableName:`, variableName);\nconsole.info(`🚀[ROCKETLOG] ~ file.ts:123 ~ variableName:`, variableName);\n```\n\n## Features\n\n- **Motions-pending logging** (works with motions/text objects)\n- **Word-under-cursor logging**\n- Supports:\n  - `console.log`\n  - `console.error`\n  - `console.warn`\n  - `console.info`\n- **Tree-sitter-first insertion** for safer placement in real code structures\n- **Heuristic fallback** when Tree-sitter is unavailable\n- **Automatic label refresh**\n  - On save (configurable)\n  - Immediately after insertion (configurable)\n- **Guardrails** to prevent invalid insertion in unsafe contexts (such as implicit arrow returns)\n- Log cleanup helpers:\n  - Delete next RocketLog\n  - Delete previous RocketLog\n  - Clear all RocketLogs in the current buffer\n\n![202602240806-ezgif com-video-to-gif-converter (1)](https://github.com/user-attachments/assets/4e6cf464-e8c2-4b1f-bd52-105f84e0cbc5)\nea57bb\n\u003cimg width=\"2904\" height=\"1640\" alt=\"image\" src=\"https://github.com/user-attachments/assets/eaedcc6b-ccdd-4e72-b035-2618678aafed\" /\u003e\n\n---\n\n## Default Keymaps\n\n### Insert logs (VIM-motions-pending)\n\nUse the motions mapping followed by a motion or text object.\n\n- `\u003cleader\u003erl` → `console.log`\n- `\u003cleader\u003ere` → `console.error`\n- `\u003cleader\u003erw` → `console.warn`\n- `\u003cleader\u003eri` → `console.info`\n\n### Insert logs (word under cursor)\n\n- `\u003cleader\u003erL` → `console.log`\n- `\u003cleader\u003erE` → `console.error`\n- `\u003cleader\u003erW` → `console.warn`\n- `\u003cleader\u003erI` → `console.info`\n\n### Delete logs\n\n- `\u003cleader\u003erd` → delete next RocketLog below the cursor\n- `\u003cleader\u003erD` → delete nearest RocketLog above the cursor\n- `\u003cleader\u003era` → delete **ALL** RocketLogs in the current buffer\n\n---\n\n## Installation (lazy.nvim)\n\n```lua\n{\n  \"evanmcpheron/rocketlog.nvim\",\n  dependencies = {\n    -- Recommended for syntax-aware insertion\n    \"nvim-treesitter/nvim-treesitter\",\n  },\n  config = function()\n    require(\"rocketlog\").setup()\n  end,\n}\n```\n\n---\n\n## Configuration\n\n```lua\nrequire(\"rocketlog\").setup({\n  keymaps = {\n    motions = \"\u003cleader\u003erl\",\n    word = \"\u003cleader\u003erL\",\n\n    error_motions = \"\u003cleader\u003ere\",\n    error_word = \"\u003cleader\u003erE\",\n\n    warn_motions = \"\u003cleader\u003erw\",\n    warn_word = \"\u003cleader\u003erW\",\n\n    info_motions = \"\u003cleader\u003eri\",\n    info_word = \"\u003cleader\u003erI\",\n\n    delete_below = \"\u003cleader\u003erd\",\n    delete_above = \"\u003cleader\u003erD\",\n    delete_all_buffer = \"\u003cleader\u003era\",\n  },\n\n  enabled = true,\n\n  label = \"ROCKETLOG\", -- customize your label that goes in the []\n\n  -- Refresh RocketLog file:line labels automatically\n  refresh_on_save = true, -- updates line numbers on file save when true\n  refresh_on_insert = true, -- updates line numbers for entire file when adding a new log\n\n  -- Insertion strategy\n  prefer_treesitter = true, -- Highly recommended to keep true... It may not work if it's false.\n  fallback_to_heuristics = true, -- this is a \"fail-safe\" (recommended to keep true)\n\n  -- Filetypes allowed for insertion\n  allowed_filetypes = {\n    javascript = true,\n    javascriptreact = true,\n    typescript = true,\n    typescriptreact = true,\n  },\n})\n```\n\n---\n\n## Usage Examples\n\n### Log a text object\n\nPress the motions mapping, then a motion/text object:\n\n- `\u003cleader\u003erliw` → log inner word\n- `\u003cleader\u003erla\"` → log around quotes\n- `\u003cleader\u003erli(` → log inside parentheses\n\n### Log the word under the cursor\n\n- `\u003cleader\u003erL`\n\n### Insert an error log instead\n\n- `\u003cleader\u003erE` (word under cursor)\n- `\u003cleader\u003ereiw` (motions + text object)\n\n---\n\n## How It Works\n\nRocketLog inserts logs in a consistent format that includes:\n\n- A RocketLog marker\n- The current file name\n- The line number where the log lives\n- The selected expression label\n\nWhen code shifts and line numbers change, RocketLog can refresh the labels automatically so they stay accurate.\n\n---\n\n## Notes\n\n- **Tree-sitter is strongly recommended** for safer insertion, especially around multiline chains, object literals, and nested expressions.\n- If Tree-sitter is unavailable or cannot parse the current buffer, RocketLog can fall back to line-based insertion (if enabled).\n- RocketLog will warn and skip insertion in contexts where adding a statement would break syntax (for example, inside an implicit arrow function return).\n\n---\n\n## Disable Auto Setup\n\nBy default, the plugin can auto-initialize with default settings.\n\nTo disable that and call `setup()` manually, set this before the plugin loads:\n\n```lua\nvim.g.rocketlog_disable_auto_setup = true\n```\n\n---\n\n## License\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":["Debugging"],"sub_categories":["CSV Files"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanmcpheron%2Frocketlog.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanmcpheron%2Frocketlog.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanmcpheron%2Frocketlog.nvim/lists"}