{"id":22006307,"url":"https://github.com/javiorfo/nvim-fuel","last_synced_at":"2025-05-05T21:51:27.477Z","repository":{"id":65797193,"uuid":"596360364","full_name":"javiorfo/nvim-fuel","owner":"javiorfo","description":"Neovim plugin written in Lua for running a main or script in several languages","archived":false,"fork":false,"pushed_at":"2024-09-08T13:09:53.000Z","size":218,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-08T14:33:00.992Z","etag":null,"topics":["assembly","cpp","go","haskell","java","kotlin","lua","main","neovim","neovim-plugin","python","rust","scala","scheme","zig"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javiorfo.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}},"created_at":"2023-02-02T02:20:37.000Z","updated_at":"2024-09-08T13:09:56.000Z","dependencies_parsed_at":"2023-07-12T18:00:22.769Z","dependency_job_id":"f7956ac3-1c36-4170-962a-f56d99b3b6e0","html_url":"https://github.com/javiorfo/nvim-fuel","commit_stats":null,"previous_names":["charkuils/nvim-fuel","javiorfo/nvim-fuel","caosystema/nvim-fuel","progrimorio/nvim-fuel","orfosys/nvim-fuel","chaosystema/nvim-fuel"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-fuel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-fuel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-fuel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-fuel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javiorfo","download_url":"https://codeload.github.com/javiorfo/nvim-fuel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252584041,"owners_count":21771943,"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":["assembly","cpp","go","haskell","java","kotlin","lua","main","neovim","neovim-plugin","python","rust","scala","scheme","zig"],"created_at":"2024-11-30T01:11:33.587Z","updated_at":"2025-05-05T21:51:27.433Z","avatar_url":"https://github.com/javiorfo.png","language":"Lua","funding_links":["https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G"],"categories":[],"sub_categories":[],"readme":"# nvim-fuel\n### Fuel for your programs\n*nvim-fuel is a Neovim plugin for running a main or script in several languages. This is meant to be useful for practicing and maybe teaching.*\n\n## Caveats\n- To use this plugin in a particular language, **the compiler or language itself needs to be installed**.\n- Supported languages are: **Assembly, C, C++, Clojure, Go, Haskell, Java, Kotlin, Lua, Python, Rust, Scala, Scheme and Zig**\n- Posibility to add custom language implementations\n- This plugin has been developed on and for Linux following open source philosophies.\n\n## Overview\n| Feature | nvim-fuel | NOTE |\n| ------- | ------------- | ---- |\n| Command to show results in Fuel Console | :heavy_check_mark: | Set by `Fuel` |\n| Command to close Fuel Console | :heavy_check_mark: | Set by `FuelStop` |\n| Execution in Normal Mode | :heavy_check_mark: | Set by `Fuel` |\n| Execution in Insert Mode | :heavy_check_mark: | Set by `Fuel` |\n| Console size configurable | :heavy_check_mark: | By `setup` |\n| Autosave configurable | :heavy_check_mark: | By `setup` |\n| Supports different languages in same window (different buffers)  | :heavy_check_mark: |  |\n| Supports custom language implementations | :heavy_check_mark: |  |\n| Main arguments | :x: | |\n| Stdin | :heavy_check_mark: | |\n| Popup console | :heavy_check_mark: | By `setup` |\n\n## Installation\n`Packer`\n```lua\nuse {\n    'javiorfo/nvim-fuel',\n    requires = 'javiorfo/nvim-popcorn'\n}\n```\n`Lazy`\n```lua\n{\n    'javiorfo/nvim-fuel',\n    lazy = true,\n    dependencies = { 'javiorfo/nvim-popcorn' },\n    -- ft could contain only the languages nvim-fuel will be used for\n    ft = { \"asm\", \"c\", \"cpp\", \"clojure\", \"go\", \"haskell\", \"java\", \"kotlin\", \"lua\", \"python\", \"rust\", \"scala\", \"scheme\", \"zig\" },\n    opts = {\n         -- Not necessary. Only if you want to change the setup\n         view = {\n             -- Default console size (this applies to popup size too)\n             console_size = 10,\n\n             -- Default autosave before pressing the Fuel shortcut\n             autosave = true,\n\n             -- Default false. If you want to show the console in a popup instead of a buffer\n             popup = false\n         }\n    },\n    keys = {\n        { \"\u003cleader\u003efu\", \"\u003cPlug\u003eFuel\" },\n        { \"\u003cleader\u003efs\", \"\u003cPlug\u003eFuelStop\" }\n    }\n}\n```\n\n### Configuration (Packer)\n- Set mappings in *init.vim* or *init.lua*\n```lua\nlocal opts = { noremap = true, silent = true }\n\n-- Normal mode \nvim.api.nvim_set_keymap('n', '\u003cleader\u003efu', '\u003cPlug\u003eFuel', opts)\nvim.api.nvim_set_keymap('n', '\u003cleader\u003efs', '\u003cPlug\u003eFuelStop\u003cCR\u003e', opts)\n```\n\n- Only the installation step is required to use this plugin, but you can modify this options if you like:\n```lua\nrequire'fuel'.setup{\n    view = {\n        -- Default console size (this applies to popup size too)\n        console_size = 10,\n\n        -- Default autosave before pressing the Fuel shortcut\n        autosave = true,\n\n        -- Default false. If you want to show the console in a popup instead of a buffer\n        popup = false\n    },\n    -- Override language implementations or implement a missing language\n    language_implementations = {\n        -- C example\n        c = {\n            -- Required build function\n            -- file_with_extension is this case will be 'file_name.c'\n            -- file is this case will be 'file_name'\n            build = function (file_with_extension, file)\n                vim.cmd(\"autocmd BufDelete c_fuel_main_console silent !rm -f \" .. file)\n                return string.format(\"gcc -Wall %s -o /tmp/%s \u0026\u0026 /tmp/%s \u0026\u0026 rm -f /tmp/%s 2\u003e /dev/null\", file_with_extension, file, file, file)\n            end,\n\n            -- Required statusline function\n            -- This will print on cmd statusline after build is executed\n            get_statusline = function(file)\n                return util.statusline_style(\" C\", file)\n            end,\n\n            -- Required get_footer function\n            -- This will print on footer popup after build is executed\n            get_footer = function(file)\n                return util.footer(\" C\", file)\n            end\n        }\n\n    }\n}\n```\n\n# Usage\n- Executing the map corresponding to `Fuel` in a main or scripting file, it will compile and execute the aforementioned file opening a console ouput.\n- Execute the map corresponding to `FuelStop` to close all open Fuel console. In case you are using `popup = true` just press \u003cESC\u003e\n- To see the execution string use the command `:FuelInfo` which will open a popup with info\n\n## Screenshots\n### Java:\n\u003cimg src=\"https://github.com/javiorfo/img/blob/master/nvim-fuel/fuel-java.gif?raw=true\" alt=\"java\" /\u003e\n\n### C:\n\u003cimg src=\"https://github.com/javiorfo/img/blob/master/nvim-fuel/fuel-c.gif?raw=true\" alt=\"c\" /\u003e\n\n### Haskell and Rust in the same window:\n\u003cimg src=\"https://github.com/javiorfo/img/blob/master/nvim-fuel/fuel-haskell-rust.gif?raw=true\" alt=\"haskell\" /\u003e\n\n### Kotlin:\n#### With popup console\n\u003cimg src=\"https://github.com/javiorfo/img/blob/master/nvim-fuel/fuel_popup.png?raw=true\" alt=\"popup\" /\u003e\n\n**NOTE:** The colorscheme **nebula** from [nvim-nyctophilia](https://github.com/javiorfo/nvim-nyctophilia) is used in this image.\n\n---\n\n### Donate\n- **Bitcoin** [(QR)](https://raw.githubusercontent.com/javiorfo/img/master/crypto/bitcoin.png)  `1GqdJ63RDPE4eJKujHi166FAyigvHu5R7v`\n- [Paypal](https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaviorfo%2Fnvim-fuel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaviorfo%2Fnvim-fuel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaviorfo%2Fnvim-fuel/lists"}