{"id":22340858,"url":"https://github.com/ingram1107/origin.nvim","last_synced_at":"2025-03-26T09:24:55.736Z","repository":{"id":52435735,"uuid":"361361659","full_name":"ingram1107/origin.nvim","owner":"ingram1107","description":"A Neovim plugin that provide functionalities to set your current working directory","archived":false,"fork":false,"pushed_at":"2024-01-25T17:22:23.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T10:42:32.133Z","etag":null,"topics":["current-working-directory","cwd","lua","neovim","nvim","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ingram1107.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":"2021-04-25T07:33:57.000Z","updated_at":"2023-07-27T14:33:08.000Z","dependencies_parsed_at":"2024-12-04T07:53:49.282Z","dependency_job_id":null,"html_url":"https://github.com/ingram1107/origin.nvim","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/ingram1107%2Forigin.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingram1107%2Forigin.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingram1107%2Forigin.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingram1107%2Forigin.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ingram1107","download_url":"https://codeload.github.com/ingram1107/origin.nvim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245624128,"owners_count":20645888,"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":["current-working-directory","cwd","lua","neovim","nvim","nvim-plugin"],"created_at":"2024-12-04T07:42:06.156Z","updated_at":"2025-03-26T09:24:55.708Z","avatar_url":"https://github.com/ingram1107.png","language":"Lua","readme":"# origin.nvim\n\nA Neovim plugin that provide functionalities to set your current working\ndirectory.\n\n## Requirement\n\nNeovim 0.7+\n\n## Installation\n\nVim-plug\n\n```viml\nPlug 'ingram1107/origin.nvim'\n```\n\npacker\n\n```lua\nuse 'ingram1107/origin.nvim'\n```\n\n## Usage\n\nAs Neovim has a fresh start, this plugin will set the parent directory of the\nfile that you first open as the current working directory.\n\nThis plugin provide three operational functions for its users. `Origin` to print\nthe current working directory, similarly `pwd` in native Vim.\n`OriginSetDefaultRoot` and `OriginSetManualRoot` are used to set the current\nworking directory as you want (empty string implies parent directory of the\ncurrent file). The difference between these two commands are that the operations\nof `OriginSetDefaultRoot` can be affected by the logic introduced in the\n`default_source` configuration whereas `OriginSetManualRoot` cannot.\n\nTo change the current working directory, you may use either Vim commands or\nNeovim lua commands.\n\nVim cmds\n\n```viml\n:Origin\n:OriginSetDefaultRoot\n:OriginSetManualRoot\n```\n\nNeovim lua cmds\n\n```viml\n:lua require('origin').origin() \" same with :Origin\n:lua require('origin').set_root{} \" same with :OriginSetDefaultRoot\n:lua require('origin').set_root{'', true} \" same with :OriginSetManualRoot\n```\n\nYou may change the operational logic of `OriginSetDefaultRoot` on which\ndirectory/ies is/are the sub-directory/ies for the project root by configure\nthrough the lua function `default_source` as follow:\n\n```lua\nrequire('origin').setup {\n  default_source = {\n    lua = \"lua\",\n    c = { \"src\", \"lib\", \"test\" },\n  },\n}\n```\n\nOr if you prefer VimL:\n\n```viml\nlua \u003c\u003c EOF\nrequire('origin').setup {\n  default_source = {\n    lua = \"lua\",\n    c = { \"src\", \"lib\", \"test\" },\n  },\n}\nEOF\n```\n\nIf you want to prioritise the directory that contain `.git/` as root directory,\nturn on the `git` option from the setup. Note that this options will always\nprefer git repo as directory regardless of as default source directory you have\nbeen set.\n\n```lua\nrequire('origin').setup {\n  option = true,\n  default_source = {\n    lua = \"lua\",\n    c = { \"src\", \"lib\", \"test\" },\n  },\n}\n```\n\n```viml\nlua \u003c\u003c EOF\nrequire('origin').setup {\n  option = true,\n  default_source = {\n    lua = \"lua\",\n    c = { \"src\", \"lib\", \"test\" },\n  },\n}\nEOF\n```\n\n## Plugins Recommendations\n\n- [vim-rooter](https://github.com/airblade/vim-rooter) (main inspiration,\n  provide more thorough functionalities)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingram1107%2Forigin.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fingram1107%2Forigin.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingram1107%2Forigin.nvim/lists"}