On Tue, Nov 8, 2011 at 3:50 PM, Jean-Rene David <[email protected]> wrote:
> * Peng Yu [2011.11.08 12:20]:
>> I'm editing a bash script. It will be convenient if I can complete
>> command that find in PATH. I'm sure that there is a way to do so.
>> Could any expert let me know how to do it? Thanks!
>
> One way would be to generate a list of all the
> programs in PATH and use dictionary completion.
>
> On *nix platforms this would be one way to
> generate the list:
>
> --------------- %< ----------------
> #!/bin/sh
> IFS=:
> for dir in $PATH
> do
>   ( cd $dir && printf "%s\n" * )
> done > /tmp/program-list
> --------------- %< ----------------
>
> Then in vim:
>
> :set dictionary=/tmp/program-list
>
> And complete with CTRL-X_CTRL-K

files like xxx.sh only shown as xxx after I press CTRL-X_CTRL-K. Is
there a way to show xxx.sh instead of xxx?

-- 
Regards,
Peng

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to