{"id":50332976,"url":"https://github.com/karshprime/switchboard.nvim","last_synced_at":"2026-05-29T11:01:20.543Z","repository":{"id":244072053,"uuid":"802884678","full_name":"karshPrime/switchboard.nvim","owner":"karshPrime","description":"same keybinds, different commands depending on file type or project","archived":false,"fork":false,"pushed_at":"2026-05-18T00:01:00.000Z","size":9487,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-18T01:42:23.569Z","etag":null,"topics":["neovim","neovim-plugin","nvim","nvim-plugin","tmux"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karshPrime.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":"2024-05-19T14:31:19.000Z","updated_at":"2026-05-18T00:01:04.000Z","dependencies_parsed_at":"2024-06-23T16:27:15.955Z","dependency_job_id":"dddfa20a-96d2-469e-978c-69397b3282f3","html_url":"https://github.com/karshPrime/switchboard.nvim","commit_stats":null,"previous_names":["karshprime/tmux-compile.nvim","karshprime/switchboard.nvim"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/karshPrime/switchboard.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karshPrime%2Fswitchboard.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karshPrime%2Fswitchboard.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karshPrime%2Fswitchboard.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karshPrime%2Fswitchboard.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karshPrime","download_url":"https://codeload.github.com/karshPrime/switchboard.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karshPrime%2Fswitchboard.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33648534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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":["neovim","neovim-plugin","nvim","nvim-plugin","tmux"],"created_at":"2026-05-29T11:01:19.780Z","updated_at":"2026-05-29T11:01:20.536Z","avatar_url":"https://github.com/karshPrime.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# switchboard.nvim\n\nSwitchboard lets you run project commands without leaving Neovim. It picks the right command based on the file or project and runs it in a split, floating window, or tmux.\n\nIt’s designed so the same keybinds work across different languages and projects.\n\n### What it does\n\n* Runs commands in splits, floating windows, or tmux\n* Supports project-aware editor actions (dynamic vim keybinds)\n* Chooses commands based on file type or project\n* Falls back to `:term` if tmux isn’t available\n* Lets you define your own commands (build, run, or anything else)\n* Supports local project-specific overrides\n\n\n\n\n## Installation\n\nUsing the built-in package manager (Neovim 0.12+):\n\n```lua\nvim.pack.add({\n    'https://github.com/karshPrime/switchboard.nvim',\n})\n```\n\n\n\n## Basic idea\n\nYou define what “run”, “build”, or any editor action means per language or project:\n\n```lua\nrequire('switchboard').setup({\n    commands = {\n        lazygit = \"lazygit\",\n    },\n    build_run_config = {{\n        extension = {'py'},\n        commands  = {\n            run   = 'uv run main',\n            build = 'uv run pyinstaller bin ./*/__main__.py',\n        },\n        binds = {\n            divide = 'I#\u003cEsc\u003e79A=\u003cEsc\u003eo',\n            import = 'Iimport ',\n        }\n    },{\n        extension = {'c', 'cpp', 'h'},\n        cd_root   =  true,\n        commands  = {\n            run   = 'make run',\n            build = 'make',\n            debug = 'gdb ./bin',\n        },\n        binds = {\n            divide = 'I//\u003cEsc\u003e78A=\u003cEsc\u003eo',\n            import = 'I#include ',\n        }\n    }}\n})\n```\n\nThen you bind keys once, and reuse them everywhere:\n\n```lua\n-- Commands:\nvim.keymap.set('n', '\u003cF5\u003e', ':Switchboard split run\u003cCR\u003e', { silent = true })\nvim.keymap.set('n', '\u003cF7\u003e', ':Switchboard vsplit debug\u003cCR\u003e', { silent = true })  -- works only for C/C++ projects\nvim.keymap.set('n', '\u003cF6\u003e', ':Switchboard quickfix build\u003cCR\u003e', { silent = true }) -- :make extended\nvim.keymap.set('n', '\u003cleader\u003eg', ':Switchboard overlay lazygit\u003cCR\u003e', { silent = true }) -- works for all projects\n\n-- Keybinds:\nvim.keymap.set('n', '\u003cleader\u003eid', ':Switchboard bind divide\u003cCR\u003e', { silent = true })\nvim.keymap.set({'n','i'}, '\u003cleader\u003eii', '\u003cEsc\u003e:Switchboard bind import\u003cCR\u003e', { silent = true })\n\n-- Append \u003cEsc\u003e before :Switchboard for insert mode maps\n\n```\n\nSwitchboard handles the rest.\n\n\n\n\n## Usage\n\n### Commands\n```vim\n:Switchboard \u003cmode\u003e \u003ccommand-name\u003e\n```\nModes:\n\n* `overlay` – floating window overlay\n* `split` – opens a horizontal split\n* `vsplit` – opens a vertical split\n* `background` – background tmux window (or background term buffer)\n* `quickfix` - run the command in quickfix mode and `:copen`\n\n\nCommands come from:\n\n* global neovim config\n* file type config - in neovim config\n* project overrides - in project root\n\nSo `run` in a Python project can mean something completely different from `run` in Rust.\n\n\n### Binds\n```vim\n:Switchboard bind \u003cbind-name\u003e\n```\nBinds run configured editor actions. For example, divide can insert a Python-style divider in Python files and a C-style divider in C files.\n\n\n\n\n\n\n\n## Example config\n\n```lua\nrequire('switchboard').setup({\n    -- General settings (optional)\n    save_session = false,             -- Save files before executing\n    build_run_window_title = \"build\", -- Tmux window name\n    notify_missing_project_config = false,\n    local_config = \".switchboard-config\",\n\n    -- Window sizing (optional)\n    new_pane_everytime     = false,\n    side_width_percent     = 50,\n    bottom_height_percent  = 30,\n    overlay_width_percent  = 80,\n    overlay_height_percent = 80,\n    overlay_sleep = -1,    -- -1 = no auto-close\n\n    build_run_config = {{\n        ...\n    }},\n\n    -- Override individual projects configs\n    -- Example: for zephyr projects, use zephyr to build instead of set C/C++ configs\n    project_override_config = {{\n        project_base_dir = '~/Projects/MyProject',\n        commands = {\n            build = 'west build',\n        }\n    }}\n})\n```\nAlternatively, have a look at [my personal config](https://github.com/karshPrime/dotfiles/blob/main/nvim/lua/plugins/tmux.lua).\n\n\n\n## Project-specific config\n\nYou can override commands per project by adding a file at the root:\n\n```lua\n-- .switchboard-config\nreturn {\n    cd_root   =  true,\n    commands  = {\n        run   = 'npm start',\n        build = 'npm run build',\n        test  = 'npm test',\n    },\n    binds = {\n        import = 'ggOimport \u003cEsc\u003e',\n    }\n}\n```\n\n\n\n**In short:** define commands and editor actions once, use the same keybinds everywhere, and let Switchboard adapt to the project you’re in.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarshprime%2Fswitchboard.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarshprime%2Fswitchboard.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarshprime%2Fswitchboard.nvim/lists"}