{"id":19687026,"url":"https://github.com/sergiobonatto/vim-run-code","last_synced_at":"2026-02-01T03:38:45.573Z","repository":{"id":251304964,"uuid":"837012844","full_name":"SergioBonatto/vim-run-code","owner":"SergioBonatto","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-01T23:27:59.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T13:54:06.015Z","etag":null,"topics":[],"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/SergioBonatto.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,"zenodo":null}},"created_at":"2024-08-02T03:12:54.000Z","updated_at":"2025-06-01T23:28:01.000Z","dependencies_parsed_at":"2024-08-02T04:43:53.585Z","dependency_job_id":"538bf3cf-639b-4d28-b784-1973d0594b52","html_url":"https://github.com/SergioBonatto/vim-run-code","commit_stats":null,"previous_names":["sergiobonatto/vim-run-code"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SergioBonatto/vim-run-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioBonatto%2Fvim-run-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioBonatto%2Fvim-run-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioBonatto%2Fvim-run-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioBonatto%2Fvim-run-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SergioBonatto","download_url":"https://codeload.github.com/SergioBonatto/vim-run-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioBonatto%2Fvim-run-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28966830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-11-11T18:32:23.205Z","updated_at":"2026-02-01T03:38:45.568Z","avatar_url":"https://github.com/SergioBonatto.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VimRunCode 🚀\n\nA lean, reliable Vim/Neovim plugin for executing code files with support for development and optimized compilation modes.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Vim](https://img.shields.io/badge/vim-8.0%2B-yellow.svg?logo=vim)](https://www.vim.org)\n[![Neovim](https://img.shields.io/badge/neovim-0.5%2B-green.svg?logo=neovim)](https://neovim.io)\n\n---\n\n## Overview\n\n`vim-run-code` is a minimal yet effective plugin that enables rapid execution of source code files from within Vim or Neovim. It supports both development and production (optimized) execution modes, with optional autosave, terminal clearing, and timeout handling.\n\nThe plugin is filetype-driven and supports 50+ programming languages out of the box. Users can override or define custom execution commands per filetype.\n\n---\n\n## Features\n\n* **Execution Modes**:\n\n  * **Development Mode (`:RunCodeDev`)** – Fast iteration with debug flags or interpreted mode.\n  * **Optimized Mode (`:RunCodeOpt`)** – Production-oriented execution with optimizations enabled.\n* **Automatic saving** of the current buffer before execution.\n* **Optional terminal clearing** before each run.\n* **Timeout support** for long-running processes.\n* **Error handling** for invalid files or commands.\n* **Custom command registration** per filetype.\n* **Default key mappings** for rapid usage (`r` / `R` in normal mode).\n* **Works with Vim 8+ and Neovim 0.5+**.\n\n---\n\n## Installation\n\n### Plugin Managers\n\n```vim\n\" vim-plug\nPlug 'sergiobonatto/vim-run-code'\n\n\" Vundle\nPlugin 'sergiobonatto/vim-run-code'\n\n\" packer.nvim\nuse 'sergiobonatto/vim-run-code'\n```\n\n### Manual Installation\n\n```sh\n# Vim\ngit clone https://github.com/sergiobonatto/vim-run-code ~/.vim/pack/plugins/start/vim-run-code\n\n# Neovim\ngit clone https://github.com/sergiobonatto/vim-run-code ~/.local/share/nvim/site/pack/plugins/start/vim-run-code\n```\n\n---\n\n## Default Configuration\n\n```vim\n\" Automatically save the buffer before execution\nlet g:run_code_auto_save = 1\n\n\" Clear terminal before running\nlet g:run_code_clear_terminal = 1\n\n\" Show feedback messages after execution\nlet g:run_code_show_feedback = 1\n\n\" Timeout for execution in seconds (0 = no timeout)\nlet g:run_code_timeout = 0\n\n\" Directory for storing temporary files\nlet g:run_code_temp_dir = '/tmp'\n\n\" Disable default mappings if set to 1\nlet g:run_code_no_default_mappings = 0\n```\n\n---\n\n## Supported Languages\n\n### Compiled\n\n| Language | Development Command    | Optimized Command                          |\n| -------- | ---------------------- | ------------------------------------------ |\n| C        | `clang % -o %:r`       | `clang -O3 -march=native %`                |\n| C++      | `clang++ -std=c++17 %` | `clang++ -O3 -march=native -std=c++20 %`   |\n| Go       | `go run %`             | `go build -ldflags=\"-s -w\"`                |\n| Rust     | `cargo run`            | `cargo run --release`                      |\n| Haskell  | `stack run`            | `ghc -O2 -threaded %`                      |\n| Java     | `javac % \u0026\u0026 java %:r`  | `javac % \u0026\u0026 java -server -XX:+UseG1GC %:r` |\n\n### Interpreted\n\n| Language   | Development Command | Optimized Command |\n| ---------- | ------------------- | ----------------- |\n| Python     | `python3 -u %`      | `python3 -O %`    |\n| JavaScript | `bun run %`         | `node %`          |\n| TypeScript | `bun run %`         | `tsc % \u0026\u0026 node`   |\n| Ruby       | `ruby %`            | -                 |\n| PHP        | `php %`             | -                 |\n| Lua        | `lua %`             | -                 |\n\n---\n\n## Commands\n\n| Command                            | Description                                                         |\n| ---------------------------------- | ------------------------------------------------------------------- |\n| `:RunCodeDev`                      | Execute current file in development mode                            |\n| `:RunCodeOpt`                      | Execute current file in optimized mode                              |\n| `:RunCodeSet \u003cfiletype\u003e \u003ccommand\u003e` | Register a custom command for a given filetype                      |\n| `:RunCodeGet [filetype] [opt]`     | Show the command used for a filetype (optional `opt` for optimized) |\n| `:RunCodeList`                     | Display supported filetypes and their commands                      |\n| `:RunCodeConfig`                   | Print current configuration values                                  |\n\n---\n\n## Custom Commands\n\nSet or override execution commands for a given filetype:\n\n```vim\n\" Custom command for Python\n:RunCodeSet python \"python3 -u -B %\"\n\n\" Custom Node.js command\n:RunCodeSet javascript \"node --inspect %\"\n\n\" Custom C++ command\n:RunCodeSet cpp \"g++ -std=c++20 -Wall %\"\n```\n\n---\n\n## Key Mappings\n\nIf `g:run_code_no_default_mappings` is not set or false, the following mappings are enabled:\n\n| Key | Mode   | Action                  |\n| --- | ------ | ----------------------- |\n| `r` | Normal | Run in development mode |\n| `R` | Normal | Run in optimized mode   |\n\nExample of disabling defaults and setting custom mappings:\n\n```vim\nlet g:run_code_no_default_mappings = 1\nnnoremap \u003cleader\u003er :RunCodeDev\u003cCR\u003e\nnnoremap \u003cleader\u003eR :RunCodeOpt\u003cCR\u003e\n```\n\n---\n\n## Error Handling\n\nThe plugin handles and reports the following cases:\n\n* Unreadable or unsaved files\n* Unsupported or unset commands\n* Missing external tools in `$PATH`\n* Timeout exceeded (if configured)\n* General execution errors\n\n---\n\n## Contributing\n\nContributions are welcome. To contribute:\n\n1. Fork the repository.\n2. Create a feature branch.\n3. Write or update code/tests.\n4. Submit a pull request.\n\n---\n\n## License\n\nMIT License. See the `LICENSE` file for details.\n\n---\n\n## Author\n\n**Sergio Bonatto**\n[github.com/sergiobonatto](https://github.com/sergiobonatto)\n\n---\n\nFor issues or feature requests, open a [GitHub Issue](https://github.com/sergiobonatto/vim-run-code/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiobonatto%2Fvim-run-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergiobonatto%2Fvim-run-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiobonatto%2Fvim-run-code/lists"}