UPDATE: My autocomplete script now ships with Rclone as of version 1.46. So you’re probably better off using that modified, maintained version than this old one here. This post will remain up as a reference. 🙂

—

I started playing with rclone in the interest of easily editing files from Google Drive with Vim. As it turns out, you can’t edit native Google Docs files in this manner, so that was a wash!

But a side benefit of this misadventure is this bash autocomplete script which I wrote to auto-complete remote paths for rclone with a Google Drive target. It probably works for others too, I haven’t tested them. 🙂

This implementation is in pure bash all except for the call to rclone itself to check against known remote targets. I appreciated An introduction to bash completion to get me started on the concepts, and the rest of what anyone needs is all in the bash manpage under complete .

Here in this post is the initial version I’m using. If you’re going to use it, check the current version of the file on my Github in case anything changes.