Created
February 24, 2026 14:05
-
-
Save Artturin/abb14bcd40c259a89696fb8fe30b314f to your computer and use it in GitHub Desktop.
Only attach copilot.lua in git repos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("copilot").setup({ | |
| should_attach = function(_, _) | |
| local obj = vim.system({ "git", "-C", vim.fn.expand("%:p:h"), "rev-parse", "--is-inside-work-tree" }, { text = true }):wait() | |
| if obj.code == 0 then | |
| return true | |
| else | |
| return false | |
| end | |
| end, | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment