{"id":13412541,"url":"https://github.com/samjwill/nvim-unception","last_synced_at":"2025-03-14T18:31:40.621Z","repository":{"id":38380790,"uuid":"494939147","full_name":"samjwill/nvim-unception","owner":"samjwill","description":"A plugin that leverages Neovim's built-in RPC functionality to simplify opening files from within Neovim's terminal emulator without nesting sessions.","archived":false,"fork":false,"pushed_at":"2024-02-06T07:44:47.000Z","size":153,"stargazers_count":213,"open_issues_count":8,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-07-31T20:51:04.225Z","etag":null,"topics":["lua","neovim","nvim","plugin"],"latest_commit_sha":null,"homepage":"","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/samjwill.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}},"created_at":"2022-05-22T02:18:54.000Z","updated_at":"2024-07-27T15:56:26.000Z","dependencies_parsed_at":"2024-01-03T03:30:04.674Z","dependency_job_id":"66e25726-081e-4010-8191-715b60df30eb","html_url":"https://github.com/samjwill/nvim-unception","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samjwill%2Fnvim-unception","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samjwill%2Fnvim-unception/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samjwill%2Fnvim-unception/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samjwill%2Fnvim-unception/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samjwill","download_url":"https://codeload.github.com/samjwill/nvim-unception/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243625150,"owners_count":20321241,"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":["lua","neovim","nvim","plugin"],"created_at":"2024-07-30T20:01:25.890Z","updated_at":"2025-03-14T18:31:40.298Z","avatar_url":"https://github.com/samjwill.png","language":"Lua","readme":"# nvim-unception\n\nA plugin that leverages Neovim's built-in `RPC` functionality to simplify\nopening files from within Neovim's terminal emulator without nesting sessions.\n\nTerminal buffers will no longer enter a state of \"inception\" in which an\ninstance of Neovim is open within an instance of Neovim. Instead, the desired\nfiles and directories will be opened by the \"host\" Neovim session, which\nleverages `:argadd` to update its own arguments.\n\nhttps://user-images.githubusercontent.com/25990267/170632310-8bbee2fa-672b-4385-9dea-7ed4501a0558.mp4\n\n## Working with Git\n\nThe best way to work with git from within a terminal buffer is to make git\ndefer editing to the host session, and block until the host quits the buffer\nbeing edited. This can be done by setting your git `core.editor` to pass the\n`g:unception_block_while_host_edits=1` argument\n(like\n[this](https://github.com/samjwill/dotfiles/blob/ba56af2ff49cd23ac19fcffe7840a78c58a89c9b/.gitconfig#L5)).\nNote that the terminal will be blocked and its buffer will be hidden until Neovim's `QuitPre` event is triggered for the commit buffer, after which, the terminal buffer will be restored to its original location.\n\nHere's an example workflow with this flag set:\n\nhttps://user-images.githubusercontent.com/25990267/208282262-594b5693-8166-414b-9695-63fc02d3c25f.mp4\n\nAlternatively, if you would like to be able to edit using Neovim directly\ninside of a nested session, you can disable unception altogether by setting\nyour git `core.editor` to pass the `g:unception_disable=1` argument (like\n[this](https://github.com/samjwill/dotfiles/blob/c59477c47867fb8f5560ba01d17722443428bc7e/.gitconfig#L5)).\n\nLastly, setting your `core.editor` to another file editor, such as GNU nano would also work.\n\n## Requirements\n\nNeovim 0.7 or later.\n\n## Installation\n\n#### Using [lazy.nvim](https://github.com/folke/lazy.nvim):\n    return {\n        \"samjwill/nvim-unception\",\n        init = function()\n            -- Optional settings go here!\n            -- e.g.) vim.g.unception_open_buffer_in_new_tab = true\n        end\n    }\n#### Using [packer.nvim](https://github.com/wbthomason/packer.nvim):\n\n    use {\n        \"samjwill/nvim-unception\",\n        setup = function()\n            -- Optional settings go here!\n            -- e.g.) vim.g.unception_open_buffer_in_new_tab = true\n        end\n    }\n\n#### Using [vim-plug](https://github.com/junegunn/vim-plug):\n\n    Plug 'samjwill/nvim-unception'\n\n## Settings\n\nFor usage details and additional options (such as opening the file buffers in\nnew tabs rather than the current window), see\n[doc/nvim-unception.txt](https://github.com/samjwill/nvim-unception/blob/main/doc/nvim-unception.txt),\nor, after installation, run `:help nvim-unception`.\n\n## Can this work with terminal-toggling plugins?\n\nYep! See the [wiki](https://github.com/samjwill/nvim-unception/wiki) for setup info.\n\n## How does it work?\n\nThe plugin tells Neovim to automatically start a local server listening to a\nnamed pipe at launch. Upon launching a new Neovim session within a terminal\nemulator buffer, the arguments are forwarded to the aforementioned Neovim\nserver session via the pipe, and the server session replaces the buffer under\nthe cursor (the terminal buffer) with the first file/directory argument\nspecified.\n\n## Limitations\n\nThis plugin works well enough for me but your mileage may vary. If you\nfind an issue, feel free to create one detailing the problem on the\nGitHub repo, and I'll try to fix it if I'm able. If you run into a\nproblem, Unception can be temporarily disabled when launching Neovim\nlike so:\n`nvim --cmd \"let g:unception_disable=1\"`\n\nOther Neovim command-line arguments that do not involve editing a file or\ndirectory may not work as expected from *within* the terminal emulator (e.g.\npassing `-b` to edit in binary mode when inside of a terminal buffer will not\npropagate binary mode to the file when it's unnested, and opening a file as\nread-only when the server session is not set to read-only mode will not result\nin a read-only buffer). See `:help vim-arguments` for how these are typically\nused. Note that any arguments that might not work when launched from within a\nNeovim terminal buffer should work just fine when launching Neovim normally.\nThey should also behave as as they do by default if you pass the disable flag\ndescribed above, even if launched from within a terminal buffer.\n","funding_links":[],"categories":["Terminal Integration","Lua"],"sub_categories":["Cursorline","CSV Files"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamjwill%2Fnvim-unception","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamjwill%2Fnvim-unception","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamjwill%2Fnvim-unception/lists"}