{"id":13496603,"url":"https://github.com/tpope/vim-projectionist","last_synced_at":"2025-05-15T03:08:48.944Z","repository":{"id":14326026,"uuid":"17035365","full_name":"tpope/vim-projectionist","owner":"tpope","description":"projectionist.vim: Granular project configuration","archived":false,"fork":false,"pushed_at":"2024-12-21T17:51:38.000Z","size":210,"stargazers_count":1069,"open_issues_count":30,"forks_count":66,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-09T03:12:01.715Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.vim.org/scripts/script.php?script_id=4989","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpope.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":"CONTRIBUTING.markdown","funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":"tpope"}},"created_at":"2014-02-20T20:57:20.000Z","updated_at":"2025-04-06T18:00:37.000Z","dependencies_parsed_at":"2024-12-03T20:42:46.267Z","dependency_job_id":"21ea9e22-9092-4d45-83a0-86d301082b22","html_url":"https://github.com/tpope/vim-projectionist","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/tpope%2Fvim-projectionist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpope%2Fvim-projectionist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpope%2Fvim-projectionist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpope%2Fvim-projectionist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpope","download_url":"https://codeload.github.com/tpope/vim-projectionist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264771,"owners_count":22041794,"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":[],"created_at":"2024-07-31T19:01:52.697Z","updated_at":"2025-05-15T03:08:43.936Z","avatar_url":"https://github.com/tpope.png","language":"Vim Script","funding_links":["https://github.com/sponsors/tpope"],"categories":["Vim Script"],"sub_categories":[],"readme":"# projectionist.vim\n\nProjectionist provides granular project configuration using \"projections\".\nWhat are projections?  Let's start with an example.\n\n## Example\n\nA while back I went and made a bunch of plugins for working with [rbenv][].\nHere's what a couple of them look like:\n\n    ~/.rbenv/plugins $ tree\n    .\n    ├── rbenv-ctags\n    │   ├── bin\n    │   │   └── rbenv-ctags\n    │   └── etc\n    │       └── rbenv.d\n    │           └── install\n    │               └── ctags.bash\n    └── rbenv-sentience\n        └── etc\n            └── rbenv.d\n                └── install\n                    └── sentience.bash\n\nAs you can see, rbenv plugins have hooks in `etc/rbenv.d/` and commands in\n`bin/` matching `rbenv-*`.  Here's a projectionist configuration for that\nsetup:\n\n    let g:projectionist_heuristics = {\n          \\   \"etc/rbenv.d/|bin/rbenv-*\": {\n          \\     \"bin/rbenv-*\": {\n          \\        \"type\": \"command\",\n          \\        \"template\": [\"#!/usr/bin/env bash\"],\n          \\     },\n          \\     \"etc/rbenv.d/*.bash\": {\"type\": \"hook\"}\n          \\   }\n          \\ }\n\nThe key in the outermost dictionary says to activate for any directory\ncontaining a subdirectory `etc/rbenv.d/` *or* files matching `bin/rbenv-*`.\nThe corresponding value contains projection definitions.  Here, two\nprojections are defined.  The first creates an `:Ecommand` navigation command\nand provides boilerplate to pre-populate new files with, and the second\ncreates an `:Ehook` command.\n\n[rails.vim]: https://github.com/tpope/vim-rails\n[rbenv]: https://github.com/sstephenson/rbenv\n\n## Features\n\nSee `:help projectionist` for the authoritative documentation.  Here are some\nhighlights.\n\n### Global and per project projection definitions\n\nIn the above example, we used the global `g:projectionist_heuristics` to\ndeclare projections based on requirements in the root directory.  If that's\nnot flexible enough, you can use the autocommand based API, or create a\n`.projections.json` in the root of the project.\n\n### Navigation commands\n\nNavigation commands encapsulate editing filenames matching certain patterns.\nHere are some examples for this very project:\n\n    {\n      \"plugin/*.vim\": {\"type\": \"plugin\"},\n      \"autoload/*.vim\": {\"type\": \"autoload\"},\n      \"doc/*.txt\": {\"type\": \"doc\"},\n      \"README.markdown\": {\"type\": \"doc\"}\n    }\n\nWith these in place, you could use `:Eplugin projectionist` to edit\n`plugin/projectionist.vim` and `:Edoc projectionist` to edit\n`doc/projectionist.txt`.  If no argument is given, it will edit an alternate\nfile of that type (see below) or a projection without a glob.  So in this\nexample `:Edoc` would default to editing `README.markdown`.\n\nThe `E` stands for `edit`.  You also get `S`, `V`, and `T` variants that\n`split`, `vsplit`, and `tabedit`.\n\nTab complete is smart.  Not quite \"fuzzy finder\" smart but smart nonetheless.\n(On that note, fuzzy finders are great, but I prefer the navigation command\napproach when there are multiple categories of similarly named files.)\n\n### Alternate files\n\nProjectionist provides `:A`, `:AS`, `:AV`, and `:AT` to jump to an \"alternate\"\nfile, based on ye olde convention originally established in [a.vim][].  Here's\nan example configuration for Maven that allows you to jump between the\nimplementation and test:\n\n    {\n      \"src/main/java/*.java\": {\"alternate\": \"src/test/java/{}.java\"},\n      \"src/test/java/*.java\": {\"alternate\": \"src/main/java/{}.java\"}\n    }\n\nIn addition, the navigation commands (like `:Eplugin` above) will search\nalternates when no argument is given to edit a related file of that type.\n\nBonus feature: `:A {filename}` edits a file relative to the root of the\nproject.\n\n[a.vim]: http://www.vim.org/scripts/script.php?script_id=31\n\n### Buffer configuration\n\nCheck out these examples for a minimal Ruby project:\n\n    {\n      \"*\": {\"make\": \"rake\"},\n      \"spec/*_spec.rb\": {\"dispatch\": \"rspec {file}\"}\n    }\n\nThat second one sets the default for [dispatch.vim][].  Plugins can use\nprojections for their own configuration.\n\n[dispatch.vim]: https://github.com/tpope/vim-dispatch\n\n## Installation\n\nInstall using your favorite package manager, or use Vim's built-in package\nsupport:\n\n    mkdir -p ~/.vim/pack/tpope/start\n    cd ~/.vim/pack/tpope/start\n    git clone https://tpope.io/vim/projectionist.git\n    vim -u NONE -c \"helptags projectionist/doc\" -c q\n\n## FAQ\n\n\u003e Why not a clearer filename like `.vim_projections.json`?\n\nNothing about the file is Vim specific.  See\n[projectionist](https://github.com/glittershark/projectionist) for an example\nof another tool that uses it.\n\n## License\n\nCopyright © Tim Pope.  Distributed under the same terms as Vim itself.\nSee `:help license`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpope%2Fvim-projectionist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpope%2Fvim-projectionist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpope%2Fvim-projectionist/lists"}