{"id":13898359,"url":"https://github.com/jenterkin/vim-autosource","last_synced_at":"2026-02-25T08:39:42.759Z","repository":{"id":40507139,"uuid":"369749825","full_name":"jenterkin/vim-autosource","owner":"jenterkin","description":"Manage Vim configuration for projects.","archived":false,"fork":false,"pushed_at":"2025-09-17T21:45:35.000Z","size":1859,"stargazers_count":30,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-17T23:32:19.561Z","etag":null,"topics":["productivity","vim","vim-plugin","vim-plugins"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","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/jenterkin.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}},"created_at":"2021-05-22T07:56:18.000Z","updated_at":"2025-09-17T21:45:40.000Z","dependencies_parsed_at":"2022-08-09T22:22:18.059Z","dependency_job_id":null,"html_url":"https://github.com/jenterkin/vim-autosource","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jenterkin/vim-autosource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenterkin%2Fvim-autosource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenterkin%2Fvim-autosource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenterkin%2Fvim-autosource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenterkin%2Fvim-autosource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenterkin","download_url":"https://codeload.github.com/jenterkin/vim-autosource/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenterkin%2Fvim-autosource/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29815025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"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":["productivity","vim","vim-plugin","vim-plugins"],"created_at":"2024-08-06T18:04:15.220Z","updated_at":"2026-02-25T08:39:42.753Z","avatar_url":"https://github.com/jenterkin.png","language":"Vim Script","readme":"# AutoSource  ![ci workflow](https://github.com/jenterkin/vim-autosource/actions/workflows/ci.yml/badge.svg)\nAutoSource is a Vim plugin that enables per project configuration by finding each Vim configuration file (`.vimrc` or `.vimrc.lua` by default) from your `$HOME` directory to the opened file.\n\n![Example usage](static/example.gif)\n\n## Security\nTo prevent arbitrary code execution attacks, AutoSource will prompt you to approve new `.vimrc` files and to re-approve those which have changed. By default AutoSource will automatically approve config changes made through Vim. See [`g:autosource_approve_on_save`](#g:autosource_approve_on_save) for more info.\n\n![Security example](static/security_example.gif)\n\nIn this gif I answered \"no\" to the prompt so that it was not sourced, then opened the `.vimrc` file that was cloned with the repo to see the _very_ malicious code inside.\n\n## Why AutoSource\nI work on many projects and each project has its' own standards and requirements. This means I can't configure Vim to handle a given language in a single way. I'll also commonly open a file in a different repo than I'm currently in to tweak something (e.g. an API response), then hop back to what I was originally doing (e.g. writing some client code that consumes said API endpoint).\n\nI wrote AutoSource because the available options (`exrc` and other plugins) didn't have either the functionality or security features that I wanted. AutoSource is configurable, unobtrusive, and secure.\n\n## Installation\n### Plug\n**[Home Page](https://github.com/junegunn/vim-plug)**\n\n```vim\nPlug 'jenterkin/vim-autosource'\n```\n\n### packer.nvim\n**[Home Page](https://github.com/wbthomason/packer.nvim)**\n\n```lua\nuse 'jenterkin/vim-autosource'\n```\n\nor if you'd like to set options after it loads:\n\n```lua\nuse {\n    'jenterkin/vim-autosource',\n    config = function()\n        vim.g.autosource_hashdir = '$XDG_CACHE_HOME/vim-autosource/hashes'\n    end\n}\n```\n\n## Lua files\nAutoSource will also look for `.vimrc.lua` files and source them with `:luafile`.\n\n## Variables\n### `g:autosource_hashdir`\n**Default:** `$HOME/.autosource_hashes`\n\nThis directory is where AutoSource stores the hashes of your files. These hashes are used to check for changes so the plugin can prompt you for re-approval.\n\n### `g:autosource_disable_autocmd`\n**Default:** `0`\n\nIf set to `1`, the autocmd that triggers AutoSource will not be enabled. This can be useful if you would like more fine-grained control over when and how it is run. For example, if you only want to run it when you start Vim you can set the following `autocmd`:\n\n```vim\naugroup sourceparents\n    autocmd!\n    autocmd VimEnter * nested call AutoSource(expand('\u003cafile\u003e:p:h'))\naugroup END\n```\n\n### `g:autosource_approve_on_save`\n**Default:** `1`\n\nWhen set to 1, AutoSource will automatically approve `.vimrc` and `.vimrc.lua` files when you save them. This reduces the number of approval prompts you'll have to see while still getting prompted when the file is changed outside of Vim (e.g. someone puts a malicious `.vimrc` file in a repo that you've cloned).\n\nIf you'd like to be approved even when you saved the config through Vim, set this option to 0.\n\n### `g:autosource_conf_names`\n**Default:** `['.vimrc', '.vimrc.lua']`\n\nThese are the file names that AutoSource looks for to source. You can set this to either a string if you're only specifying a single file, or a list if you'd like to check against multiple.\n\n```vim\nlet g:autosource_conf_names = '.lvimrc'\n\" or to check multiple\nlet g:autosource_conf_names = ['.lvimrc', '.lvimrc.lua']\n```\n\n### `g:autosource_prompt_for_new_file`\n**Default:** `1`\n\nThe primary use-case of this option is to support automated testing.\n\nWhen set to `0` AutoSource will not prompt you when it detects a new file. The file will **NOT** be sourced.\n\n### `g:autosource_prompt_for_changed_file`\n**Default:** `1`\n\nThe primary use-case of this option is to support automated testing.\n\nWhen set to `0` AutoSource will not prompt you when it detects when a file is changed. The file will **NOT** be sourced.\n\n### `g:autosource_search_from_root`\n**Default:** `0`\n\nUse to search from `/` instead of `$HOME`.\n\n#### Lua Support\nIn order for a lua file to be sourced correctly it **must** end with `.lua`.\n\n## Commands\n\n### `:AutoSource`\nSources parents of the current file.\n\n### `:AutoSourceApproveFile`\nApproves the current file.\n\n## Want to see a new feature? Report a bug?\nFeel free to submit issues on the [issues page](https://github.com/jenterkin/vim-autosource/issues).\n\n## Similar Projects\n- [vim-addon-local-vimrc](https://github.com/MarcWeber/vim-addon-local-vimrc)\n- [exrc.vim](https://github.com/ii14/exrc.vim)\n- [local_vimrc](https://github.com/LucHermitte/local_vimrc)\n- [nvim-projectconfig](https://github.com/windwp/nvim-projectconfig)\n- [vim-projectlocal](https://github.com/krisajenkins/vim-projectlocal)\n\n## Supported Operating Systems\nAutoSource only supports MacOS and Linux. Windows is not actively tested. If you would like to fix any Windows-specific issues, feel free to submit a PR.\n","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenterkin%2Fvim-autosource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenterkin%2Fvim-autosource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenterkin%2Fvim-autosource/lists"}