{"id":15493508,"url":"https://github.com/adamtabrams/flatnvim","last_synced_at":"2025-04-22T20:13:22.345Z","repository":{"id":138305392,"uuid":"406915804","full_name":"adamtabrams/flatnvim","owner":"adamtabrams","description":"A simple tool that prevents nested Neovim instances","archived":false,"fork":false,"pushed_at":"2022-11-06T03:43:03.000Z","size":29,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T20:13:11.801Z","etag":null,"topics":["cli","neovim","nvim","terminal","vim"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamtabrams.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-09-15T20:28:57.000Z","updated_at":"2025-03-24T12:54:11.000Z","dependencies_parsed_at":"2023-04-20T21:18:16.765Z","dependency_job_id":null,"html_url":"https://github.com/adamtabrams/flatnvim","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamtabrams%2Fflatnvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamtabrams%2Fflatnvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamtabrams%2Fflatnvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamtabrams%2Fflatnvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamtabrams","download_url":"https://codeload.github.com/adamtabrams/flatnvim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250316058,"owners_count":21410476,"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":["cli","neovim","nvim","terminal","vim"],"created_at":"2024-10-02T08:07:34.776Z","updated_at":"2025-04-22T20:13:22.315Z","avatar_url":"https://github.com/adamtabrams.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThe goal of `flatnvim` is to make it easy to use [Neovim](https://neovim.io/)'s\n[terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html).\nWhen you open files from within the Neovim terminal, `flatnvim` will automatically add them\nto the current instance instead of creating a new nested one.\nNow you can easily use all your favorite command line programs inside Neovim.\n\n# Usage\n\n## Clone \u0026 Build\nYou'll first need the `flatnvim` binary on you system.\n\n```sh\ngit clone https://github.com/adamtabrams/flatnvim.git\ncd flatnvim\n./build.sh\n```\n\n## Environment Variables\nThere are 4 environment variables `flatnvim` can use.\nAdd them to the config file for your shell (.bashrc, .profile, .zprofile, etc).\n\n### Required: set the path to the actual editor.\n```sh\nexport FLATNVIM_EDITOR=\"nvim\"\n```\n- When `flatnvim` is called from your regular terminal, it will just pass arguments to this editor.\n\n### Recommended: set the path to the `flatnvim` binary as your default terminal editor.\n```sh\nexport EDITOR=\"$HOME/repos/flatnvim/bin/flatnvim\"\n```\n- If you don't know what this should be, use the path printed by the build.sh script.\n- In addition, you can make an alias to `flatnvim`: `alias vim=\"$EDITOR`\n\n### Optional: set a log file for `flatnvim` to use.\n```sh\nexport FLATNVIM_LOGFILE=\"$HOME/repos/flatnvim/log.txt\"\n```\n- If this is not set, any error messages are just printed.\n\n### Optional: set an extra Neovim command to be executed when preventing nested instances.\n```sh\nexport FLATNVIM_EXTRA_COMMAND=\"echo 'it works' | sleep\"\n```\n- Just in case you want `flatnvim` to do something extra before it opens files in the parent instance.\n\n\n## Neovim Configs\n\n### Recommended: disable status line when in terminal mode.\n```viml\nautocmd TermOpen * setlocal laststatus=0 noshowmode noruler\n  \\| autocmd TermClose * setlocal laststatus=2 showmode ruler\n\n```\n\n### Recommended: skip exit prompt if terminal commands were successful.\n```viml\nautocmd TermClose * if !v:event.status | exe 'bdelete! '..expand('\u003cabuf\u003e') | endif\n```\n\n### Optional: fix issue with Airline that occurs when window focus is lost.\n```viml\nautocmd TermLeave * AirlineRefresh\n```\n\n\n## Neovim Function\n\nAdding this function to your Neovim config makes it easier to access the terminal and specific command line programs.\n\n```viml\nfunction! TempTerm(...)\n    let command = get(a:, 1)\n    exe \"terminal \".command\n    return \"\"\nendfunction\n```\n\n```viml\nnnoremap \u003csilent\u003e gt  :call TempTerm(\" \")\u003cCR\u003e\nnnoremap \u003csilent\u003e gL  :call TempTerm(\"lazygit\")\u003cCR\u003e\nnnoremap \u003csilent\u003e gl  :call TempTerm(\"lf\")\u003cCR\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamtabrams%2Fflatnvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamtabrams%2Fflatnvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamtabrams%2Fflatnvim/lists"}