[{"data":1,"prerenderedAt":196},["ShallowReactive",2],{"$feqbus2xrwp1s":3},{"title":4,"date":5,"tags":6,"categories":9,"draft":12,"_id":13,"slug":14,"path":15,"document":16,"excerpt":194,"readingTimeMinutes":195},"Using pinentry-mac to sign commits from vim-fugitive","2024-05-11T00:00:00.000Z",[7,8],"vim","tip",[10,11],"tooling","tips",false,"content:blog:vim-fugitive-gpg-pinentry","vim-fugitive-gpg-pinentry","\u002Fblog\u002Fvim-fugitive-gpg-pinentry",{"frontmatter":17,"meta":18,"nodes":19},{},{},[20,39,43,48,68,72,75,102,112,132,138,156,159,191],[21,22,23,24,29,30,34,35,38],"p",{},"In order to sign git commits from within Vim using a plugin like ",[25,26,28],"a",{"href":27},"https:\u002F\u002Fgithub.com\u002Ftpope\u002Fvim-fugitive","tpope\u002Fvim-fugitive",", it is necessary to configure the ",[31,32,33],"code",{},"gpg-agent"," to use a GUI based ",[31,36,37],{},"pinentry-program",".",[40,41,42],null,{},"more",[44,45,47],"h2",{"id":46},"preface","Preface",[21,49,50,51,55,56,34,58,60,61,64,65,38],{},"The man, the myth, the legend, Timothy Popallopollis himself ",[25,52,54],{"href":53},"https:\u002F\u002Fgithub.com\u002Ftpope\u002Fvim-fugitive\u002Fissues\u002F846#issuecomment-253816577","recommends"," configuring your ",[31,57,33],{},[31,59,37],{},". On macOS this can be done quite by simply installing ",[31,62,63],{},"pinentry-mac",", and updating your ",[31,66,67],{},"gpg-agent.conf",[44,69,71],{"id":70},"configuration","Configuration",[21,73,74],{},"First things first, let's install the pinentry program.",[76,77,80],"pre",{"language":78,"class":79},"bash","shiki shiki-themes tokyo-night dark:tokyo-night",[31,81,83],{"class":82},"language-bash",[84,85,88,92,96,99],"span",{"class":86,"style":87},"line","display: inline",[84,89,91],{"style":90},"color:#C0CAF5","$",[84,93,95],{"style":94},"color:#9ECE6A"," brew",[84,97,98],{"style":94}," install",[84,100,101],{"style":94}," pinentry-mac",[21,103,104,105,107,108,111],{},"Then, all we need to do is set the ",[31,106,37],{}," option in your ",[31,109,110],{},"~\u002F.gnupg\u002Fgpg-agent.conf"," file.",[76,113,114],{"class":79},[31,115,116,121,122,121,127],{},[84,117,118],{"class":86,"style":87},[84,119,120],{},"default-cache-ttl 600","\n",[84,123,124],{"class":86,"style":87},[84,125,126],{},"max-cache-ttl 7200",[84,128,129],{"class":86,"style":87},[84,130,131],{},"pinentry-program \u002Fopt\u002Fhomebrew\u002Fbin\u002Fpinentry-mac",[21,133,134,135,38],{},"If your don't know the path to your pinentry program, you can throw down a quick ",[31,136,137],{},"which",[76,139,140],{"language":78,"class":79},[31,141,142,121,151],{"class":82},[84,143,144,146,149],{"class":86,"style":87},[84,145,91],{"style":90},[84,147,148],{"style":94}," which",[84,150,101],{"style":94},[84,152,153],{"class":86,"style":87},[84,154,155],{"style":90},"\u002Fopt\u002Fhomebrew\u002Fbin\u002Fpinentry-mac",[21,157,158],{},"Or use your Homebrew prefix.",[76,160,161],{"language":78,"class":79},[31,162,163,121,187],{"class":82},[84,164,165,167,170,174,177,181,184],{"class":86,"style":87},[84,166,91],{"style":90},[84,168,169],{"style":94}," echo",[84,171,173],{"style":172},"color:#89DDFF"," $(",[84,175,176],{"style":90},"brew",[84,178,180],{"style":179},"color:#E0AF68"," --prefix",[84,182,183],{"style":172},")",[84,185,186],{"style":94},"\u002Fbin\u002Fpinentry-mac",[84,188,189],{"class":86,"style":87},[84,190,155],{"style":90},[21,192,193],{},"But that's all it takes. Now, you should be prompted to enter your gpg pin in an external window when signing commits from vim.","In order to sign git commits from within Vim using a plugin like tpope\u002Fvimfugitive, it is necessary to configure the gpgagent to use a GUI based pinentryprogram.",1,1790648870607]