aboutsummaryrefslogtreecommitdiffstats
path: root/ftplugin/gitcommit.vim
AgeCommit message (Collapse)Author
2017-04-28ftplugin/gitcommit.vim: Experiment providing a custom mappingTeddy Wing
Experiment with providing a custom mapping for our Git SHA completion function. We use <C-x><C-s>. The custom mapping should set our function as the custom `completefunc`, call the user completion function by programmatically running `<C-x><C-u>`, and then unset and restore the previous `completefunc` value. This allows us to not clobber a user-defined completion function and also give ourselves a special custom <C-x> mapping. Just experimenting for now. Figured out how to get this to work using a test `ASDF` function along with these resources: * http://stackoverflow.com/questions/15643234/remapping-tab-completions-in-vim * https://github.com/ervandew/supertab/blob/master/plugin/supertab.vim * http://stackoverflow.com/questions/6926034/creating-a-mapping-for-insert-mode-but-not-for-autocomplete-submode It works. The only problem is that we can't restore the old `completefunc` value. Thinking about ways to do this, and for now my most promising idea is to use the `CursorMovedI` autocommand.
2017-04-27ftplugin/gitcommit.vim: Make completion work for commit SHAsTeddy Wing
Get the list of SHAs from `git rev-list` and use this for completion. Not too different from the original structure. Renamed `res` to `matches` because that seemed clearer to me.
2017-04-27Sample completion functionTeddy Wing
Copy the completion function included in `:h complete-functions` to give us a base custom completion function to work from. We'll be using this to provide completion for Git SHAs.