{"id":15178647,"url":"https://github.com/lukasx999/syncwd.nvim","last_synced_at":"2026-01-28T11:34:00.655Z","repository":{"id":250505195,"uuid":"834648076","full_name":"lukasx999/syncwd.nvim","owner":"lukasx999","description":"Sync neovim cwd with shell cwd","archived":false,"fork":false,"pushed_at":"2024-11-05T10:00:11.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T17:49:01.038Z","etag":null,"topics":["neovim","neovim-plugin","vim"],"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/lukasx999.png","metadata":{"files":{"readme":"README.md","changelog":"changecwd.sh","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":"2024-07-27T23:22:54.000Z","updated_at":"2024-11-05T10:00:15.000Z","dependencies_parsed_at":"2024-09-23T10:02:44.533Z","dependency_job_id":"774da226-23e1-4670-a6db-cca4c37403cc","html_url":"https://github.com/lukasx999/syncwd.nvim","commit_stats":null,"previous_names":["lukasx999/vimd","lukasx999/vimd.nvim","lukasx999/syncwd.nvim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lukasx999/syncwd.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasx999%2Fsyncwd.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasx999%2Fsyncwd.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasx999%2Fsyncwd.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasx999%2Fsyncwd.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukasx999","download_url":"https://codeload.github.com/lukasx999/syncwd.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukasx999%2Fsyncwd.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"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":["neovim","neovim-plugin","vim"],"created_at":"2024-09-27T15:21:02.276Z","updated_at":"2026-01-28T11:34:00.638Z","avatar_url":"https://github.com/lukasx999.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# syncwd.nvim\n\n\n## Sync Neovims working directory with the one of your shell\n\n\nNormally when you start a Vim instance and navigate to another directory and exit Vim, you return to your shells CWD.\u003cbr\u003e\n\nIf you'd like your shells working directory to be directly synced to Neovims working directory, then this plugin does just that.\u003cbr\u003e\nThis plugin is very useful if your goal is to use a file manager such as `oil.nvim` as your primary file manager.\u003cbr\u003e\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n### Install\n\n#### Neovim Plugin (via Lazy.nvim)\n\n```lua\n\nreturn { \"lukasx999/syncwd.nvim\" }\n\n```\n\n#### Shell script\n\n\n- Save the `changecwd.sh` script to somewhere on your system (eg: `~/Scripts/syncwd/changecwd.sh`)\n- Add this line to your shellrc (`~/.bashrc`, `~/.zshrc`)\n\n```bash\n\n# ~/.bashrc\n\nsource path/to/changecwd.sh  # (source is a bashism)\n# or:\n. path/to/changecwd.sh\n\n```\n\n\u003e **NOTE**: if syncwd is enabled within Neovim, but you have not configured your shell yet, your shell will exit after quitting vim!\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n### Usage\n\n- Start Vim\n- Exit Vim\n\n\n\u003e **NOTE**: Whenever your cwd gets synced when exiting, you can always use `popd` or `cd -` to go back to the previous directory before the vim session\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n### Configuration\n\n\n```lua\n\nreturn {\n    \"lukasx999/syncwd.nvim\",\n    config = function()\n\n        require(\"syncwd\").setup({\n            init = true,  -- Should syncing be enabled on startup?\n        })\n\n    end,\n}\n\n```\n\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n\n### Commands\n\n- `:SyncwdEnable`\n- `:SyncwdDisable`\n- `:SyncwdToggle`\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n### API\n\n\n```lua\nlocal syncwd = require(\"syncwd\")\nsyncwd.state()\nsyncwd.enable()\nsyncwd.disable()\nsyncwd.toggle()\n```\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n### How does this work???\n\n\nRight before quitting Vim, a autocmd is fired, which will write the current working directory to a temporary file. (`/tmp/syncwd_cwd`)\u003cbr\u003e\nThen it will get the PID of its parent process. (which is the shell that it was started from)\u003cbr\u003e\nAfter that, a signal, `SIGUSR1` (user defined signal) is sent to said pid.\u003cbr\u003e\nThe shell script, sourced in your `shellrc` then sets up a `trap` for said signal, which will then `pushd` into the cwd from `/tmp/syncwd_cwd`.\u003cbr\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasx999%2Fsyncwd.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukasx999%2Fsyncwd.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukasx999%2Fsyncwd.nvim/lists"}