[patch] Detect bash_completion files as bash

58 views
Skip to first unread message

James McCoy

unread,
Aug 1, 2015, 8:56:34 PM8/1/15
to Bram Moolenaar, vim...@googlegroups.com
Attached patch adds support for recognizing various locations of bash
completion files. The commonly supported locations are
~/.bash_completion, $XDG_CONFIG_HOME/bash_completion,
/etc/bash_completion, and /etc/bash_completion.d/$command.

Cheers,
--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jame...@jamessan.com>
bash_completion.diff
signature.asc

Bram Moolenaar

unread,
Aug 2, 2015, 4:32:33 PM8/2/15
to James McCoy, vim...@googlegroups.com

James McCoy wrote:

> Attached patch adds support for recognizing various locations of bash
> completion files. The commonly supported locations are
> ~/.bash_completion, $XDG_CONFIG_HOME/bash_completion,
> /etc/bash_completion, and /etc/bash_completion.d/$command.

Thanks!

--
TALL KNIGHT: We shall say Ni! again to you if you do not appease us.
ARTHUR: All right! What do you want?
TALL KNIGHT: We want ... a shrubbery!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Roland Eggner

unread,
Aug 10, 2015, 8:58:49 AM8/10/15
to vim...@googlegroups.com
Hi James
Hi Bram



On 2015-08-02 Sunday at 22:32 +0200 Bram Moolenaar wrote:
> James McCoy wrote:
> > Attached patch adds support for recognizing various locations of bash
> > completion files. The commonly supported locations are
> > ~/.bash_completion, $XDG_CONFIG_HOME/bash_completion,
> > /etc/bash_completion, and /etc/bash_completion.d/$command.
> Thanks!

On Gentoo I have
/etc/bash_completion.d/*
/etc/profile.d/bash-completion.sh
/usr/share/bash-completion/*

I enhanced the patch to cover these paths additionally to those mentioned by
James, and to cover thinkable variations. Please find it attached.

Thanks to James for taking the initiative. Some day I can remove regarding
code from my /etc/vim/vimrc file … :)


Regarding pattern “*.ebuild”:
I added pattern “*.eclass”. It regards to files providing shell code common
to multiple Gentoo ebuilds with the goal to avoid duplication of code.



--
Best regards,
Roland Eggner
bash_completion bash_completion.diff

Bram Moolenaar

unread,
Aug 11, 2015, 6:47:12 AM8/11/15
to Roland Eggner, vim...@googlegroups.com

Roland Eggner wrote:

> On 2015-08-02 Sunday at 22:32 +0200 Bram Moolenaar wrote:
> > James McCoy wrote:
> > > Attached patch adds support for recognizing various locations of bash
> > > completion files. The commonly supported locations are
> > > ~/.bash_completion, $XDG_CONFIG_HOME/bash_completion,
> > > /etc/bash_completion, and /etc/bash_completion.d/$command.
> > Thanks!
>
> On Gentoo I have
> /etc/bash_completion.d/*
> /etc/profile.d/bash-completion.sh
> /usr/share/bash-completion/*
>
> I enhanced the patch to cover these paths additionally to those mentioned by
> James, and to cover thinkable variations. Please find it attached.

Thanks, I'll include it. Please watch out for any wrongly detected
files, it's quite complicated now.

> Thanks to James for taking the initiative. Some day I can remove regarding
> code from my /etc/vim/vimrc file … :)
>
>
> Regarding pattern “*.ebuild”:
> I added pattern “*.eclass”. It regards to files providing shell code common
> to multiple Gentoo ebuilds with the goal to avoid duplication of code.

--
Q: Is selling software the same as selling hardware?
A: No, good hardware is sold new, good software has already been used by many.

Roland Eggner

unread,
Aug 13, 2015, 12:22:52 AM8/13/15
to vim...@googlegroups.com
Hi Bram



On 2015-08-11 Tuesday at 12:47 +0200 Bram Moolenaar wrote:
> Roland Eggner wrote:
> > On 2015-08-02 Sunday at 22:32 +0200 Bram Moolenaar wrote:
> > > James McCoy wrote:
> > > > Attached patch adds support for recognizing various locations of bash
> > > > completion files. The commonly supported locations are
> > > > ~/.bash_completion, $XDG_CONFIG_HOME/bash_completion,
> > > > /etc/bash_completion, and /etc/bash_completion.d/$command.
> > > Thanks!
> >
> > On Gentoo I have
> > /etc/bash_completion.d/*
> > /etc/profile.d/bash-completion.sh
> > /usr/share/bash-completion/*
> >
> > I enhanced the patch to cover these paths additionally to those mentioned by
> > James, and to cover thinkable variations. Please find it attached.
>
> Thanks, I'll include it. Please watch out for any wrongly detected
> files, it's quite complicated now.

Will do. My customized vim statusline already displays beside other things
&filetype. This should help to detect even non-obvious detection errors.

Thanks for including the patch.
Reply all
Reply to author
Forward
0 new messages